# Ankr — Full Documentation Generated at build time. Pages: 682. Source URLs are absolute under https://www.ankr.com/docs/. --- url: https://www.ankr.com/docs/ title: Ankr Docs description: Ankr is the open Web3 infrastructure layer. Build with public RPC, Premium endpoints, Advanced API, AppChains, and staking — all from one place. source: docs/index.mdx --- --- url: https://www.ankr.com/docs/info-map/ title: Information Map description: This section aims at navigating your ship fast and easy through the vast ocean of our docs. Here you can find the sections we have and the info they contain. source: docs/info-map.mdx --- # Information Map This section aims at navigating your ship fast and easy through the vast ocean of our docs. Here you can find the sections we have and the info they contain.
## Node API * [**Getting Started**](/rpc-service/getting-started/intro/)
Basics on Web3 API platform functionality; intro into UI; common user actions (signing in, depositing funds, using endpoints); creation of business-specific accounts, using multiple projects, and performing duties under different access rights. * [**Overview**](/rpc-service/overview/)
Basics on what a Web3 API platform is, its architecture, technologies, and user-service interaction safeguards. * [**Service Plans**](/rpc-service/service-plans/)
Service plans available to empower your Web3 projects with blockchain interaction capabilities, along with their feature list, rate limits, and charging models. * [**Pricing**](/rpc-service/pricing/)
Pay-as-you-go (PAYG) / Deal models definition and pricing per request info. * [**Supported Chains**](/rpc-service/chains/chains-list/)
The list of chains we can empower your project to interact with along with the API Reference docs for those chains. ## Advanced API * [**Overview**](/advanced-api/overview/)
Advanced API basics; chains and methods supported; pricing per methods. * [**Pricing**](/advanced-api/pricing/)
Advanced API charging model and pricing per method. * [**Full API Reference**](/api-reference/)
Advanced API Reference docs with dynamic request/response samples. * [**Ankr.js SDK**](/advanced-api/javascript-sdk/)
Docs on a JavaScript library for interaction with Advanced API. * [**Ankr.py SDK**](/advanced-api/python-sdk/)
Docs on a Python library for interaction with Advanced API. * [**Ankr React Hooks**](/advanced-api/react-hooks/)
React Hooks for fetching data from Advanced API. * [**Quickstart Guide**](/advanced-api/quickstart/overview/)
Basic tutorials for Advanced API interaction. ## Blockchain Node Snapshots * [**Blockchain Node Snapshots**](/node-snapshot/)
Node Snapshots used in nodes syncing by our Infrastructure engineering teams. ## Contract Automation * [**Overview**](/automation/overview/)
Contract automation basics; types of triggers; supported networks. * [**Time-based Automation**](/automation/time-based-automation/)
Automate calls to a contract on a custom schedule. * [**Custom Logic Automation**](/automation/custom-logic-automation/)
Automate calls to a contract on an event of your choice. * [**Manage Automation Tasks**](/automation/manage-tasks/)
Manage your automation tasks from a single dashboard. ## Tutorials * [**Basic Tutorials**](/basic-tutorials/dapp-on-ethereum-using-nocode/)
Basic tutorials to start learning when new to Web3. * [**Smart Contract Development**](/smart-contract-tutorials/erc-721-smart-contract-on-avalanche/)
Step-by-step instructions on how to create and deploy smart contracts. * [**Advanced Tutorials**](/advanced-tutorials/donation-based-crowdfunding-dapp-on-polygon-with-ankr/)
Advanced tutorials for building complex dApps. ## Scaling Services * [**Overview**](/scaling-services-overview/)
Ankr Scaling Services basics; what they are, rollup stacks, the data availability and interoperability layers supported. * [**Rollups**](/scaling-services-rollups/overview/)
A RaaS service to configure and deploy your own rollup. * [**Sidechains**](/scaling-services-sidechains/overview/)
A SaaS service to create your own fast and reliable network. ## Staking * [**For Developers**](/staking-for-developers/overview/)
Staking implementation details, smart contract and RESTful API, SDK reference, price and APR oracles, flash loans, and referral program. * [**Delegated Staking**](/delegated-staking/ankr/overview/)
Delegated staking how-tos; ANKR and GNO stake, unstake, FAQ, general information. * [**Liquid Staking**](/liquid-staking/overview/)
Liquid staking how-tos; AVAX, BNB, DOT, ETH, FTM, KSM, POL stake, unstake, FAQ, general information, audit reports. * [**Liquid Crowdloan**](/liquid-crowdloan/overview/)
Liquid Crowdloan basics; general information. * [**DeFi**](/defi/overview/)
Ankr DeFi basics; Liquidity Pools, Yield Farming, Vaults, how to use them. * [**Bridge**](/bridge/overview/)
Bridge basics; general information, how to bridge tokens between networks. * [**Switch**](/switch/overview/)
Switch basics; general information, how to switch one Liquid Staking Token for another. * [**Extra**](/staking-extra/audit-reports/)
Extra information; list of all audit reports, technical service fees, validators, smart contract addresses, compatible wallets, specific fixes, types of Liquid Staking Tokens, ANKR tokenomics and governance. ## Support * [**Request Support**](https://ankrnetwork.atlassian.net/servicedesk/customer/portal/10)
Open a ticket and request support for your problem; we will find a solution to resolve it. * [**Knowledge Base**](https://ankrnetwork.atlassian.net/wiki/spaces/EUSKB/overview)
Knowledge base with questions and answers to some topics not covered by this documentation. --- url: https://www.ankr.com/docs/node-snapshot/ title: Blockchain Node Snapshots description: Ankr has partnered with Storj to provide the community with easy access to the blockchain state snapshots used in nodes syncing by our Infrastructure enginee. source: docs/node-snapshot.mdx --- # Blockchain Node Snapshots Ankr has partnered with [Storj](https://www.storj.io/) to provide the community with easy access to the blockchain state snapshots used in nodes syncing by our Infrastructure engineering teams. **Chains supported**: * Ethereum * Polygon * BNB Smart Chain Find the full list of available snapshots [here](https://www.chainsnap.io/). ## Snapshot download **Prerequisites**: * Uplink CLI (for downloading from Storj) * Tar (for inline decompression) **Download and install Uplink**: * AMD64 see below, for other OS — see [here](https://docs.storj.io/dcs/downloads/download-uplink-cli): ```shell curl -L https://github.com/storj/storj/releases/latest/download/uplink_linux_amd64.zip -o uplink_linux_amd64.zip unzip -o uplink_linux_amd64.zip sudo install uplink /usr/local/bin/uplink ``` **Download a chain snapshot**: 1. At [chainsnap.io](https://www.chainsnap.io/), scroll down to the **Available Snapshots** list. From here, there are two flows currently at work: * **Buy Now** — click to proceed to payment that ends up by receiving an access token from Storj. * **Request Download** — click to submit a request filling in your email that will be used to send you the payment link. Available snapshots 2. Pay through the Storj portal to receive the access token required to download a snapshot. Payment 3. Use the inline multithread download that unTARs to your target directory (does not require double the hard drive space): ```shell uplink cp --parallelism 16 --access '' sj://chains/snapshot.tar.zst - | tar -xv --use-compress-program=zstd -C ~/chain/data ``` --- url: https://www.ankr.com/docs/privacy/ title: Privacy Policy description: At Ankr, we treat our user's privacy with the utmost respect. We cherish the credit of trust you put in us. And we stand guard keeping your information secur. source: docs/privacy.mdx --- # Privacy Policy At Ankr, we treat our user's privacy with the utmost respect. We cherish the credit of trust you put in us. And we stand guard keeping your information secure and confidential. > **"Let us be clear – we do not rent, sell, or trade any Personal Information."** — *Stanley Wu, CTO*. **Quick links**: * Our complete [Privacy Policy](https://www.ankr.com/privacy-policy/) page. * Our complete [Terms of Use Agreement](https://www.ankr.com/terms/) page. This section is an attempt to distill and simplify the complete Privacy Policy page to provide you with the concise essentials of our policies and practices regarding your Personal Information and the way we treat it. This section is just the way to facilitate understanding of our Privacy Policy and can't be regarded as the substitute for the complete Privacy Policy page.
You shall not pass ## General terms FAQ Let's proceed with investigating the Privacy Policy, the roles we play under it, the interaction we have as the parties, the Personal Information you might share with us, and our treatment of that information: ### What is it all about? The Ankr [Privacy Policy](https://www.ankr.com/privacy-policy/) describes how we collect, utilize, disclose, share, and protect your Personal Information upon interacting with Ankr. This Privacy Policy forms a part of our [Terms of Use Agreement](https://www.ankr.com/terms/), which governs the use of the Platform. ### Who's Ankr? Ankr is a close group of like-minded people from all over the World united by the goal of helping anyone build products using top-notch Web3 infrastructure and technology. From the legal standpoint, we refer to Ankr Inc., its subsidiaries, affiliates, employees, officers, and agents collectively as “Ankr” (or "Company", or "we", or “us”). ### Who's our user? We consider anyone who visits our Platform, uses our products and services or becomes our official client to be our user. We don't differentiate: you've come to us — we respect your privacy! ### How user interacts with Ankr? By the user interaction with Ankr, we imply the use of the Platform. ### What is the Platform? The term "Platform" encompasses the [website](https://www.ankr.com), the applications, products, and services (Public or Premium) provided by Ankr Inc., as well as any other websites or services where this Privacy Policy is linked or referenced. ### What are Public Services? Public Services consist of publicly available Web3 infrastructure accessed on a free, permissionless, basis. It requires no registration with us or on the Platform, which means less information collected to provide such services. ### What are Premium Services? Premium Services are the paid services accessible on a permissioned basis. Your subscription to any Premium Services will be subject to a separate written agreement, which requires us to collect certain information that helps facilitate payment for and communication about your Premium Services, fulfill our contract with you, and otherwise support our provision of the paid-for Premium Services. ### What is Personal Information? “Personal Information” means information that identifies, relates to, or describes, directly or indirectly, an individual or household. This Privacy Policy applies to Personal Information we collect through the following means: * On the Platform. * In email, text, or other electronic messages between you and us. * Through the apps downloaded from the Platform. It does not apply to Personal Information collected by: * Us offline or through any other means or websites operated by Company or any third party (including our affiliates and subsidiaries) that is not a part of the Platform. * Any third party through any application or content that may link to or be accessible from or on the Platform. ## Collected info FAQ Here, we continue investigating all the questions that might arise information-wise: what info we collect or you provide us with, how we use your info, how you can edit it, is it safe with us, and under what circumstances can we disclose it. ### What non-technical info you might provide us with? Depending on whether you are purchasing a Premium Service or using a free Public Service offering, you may choose to provide some or all of the following types of Personal Information: * Email address or organization name. * Filling in forms on the Platform (upon registering to use the Platform or subscribing to our service). Also refers to the information we may ask you to provide when you report a problem with the Platform. * Records and copies of correspondence and other communications you choose to direct to us. * Payment information you use to pay for a Premium Service. ### What's the technical info collected from all users? The following technical information, some of which may be capable of association with individual users or devices (“Ephemeral Activity Data”) may be collected from any user: * IP address (used to infer general location (city or zip code) on an anonymous basis), and other unique identifiers associated with your devices or browsers. * Device and system information, such as your operating system version and network information. * Information about transactions you conduct through or on the Platform (associated API key information, etc.). * Usage activity about how you view and interact with the Platform. ### How we use your info? We use information collected from you or provided to us, including any Personal Information, in the following ways: * To present the Platform and our products or services to you. * In the case of Ephemeral Activity Data, solely to facilitate improvement or optimization of the Platform (to optimize latency and quality of service, to anonymously monitor web traffic patterns and generate related, non-identifiable data used to improve quality of service, to prevent DDoS or other malicious attacks on the Platform, to respond to customer-service requests by applicable Premium Service customers, etc.). * To carry out our obligations and enforce our rights arising from any contracts entered into between you and us (including for billing and collection). * To notify you about changes to the Platform, our Website, or any products or services we offer or provide though it. * For any other purpose with your express consent. ### Can I edit, delete, or update my info? > **Sure you can. Email a request at privacy@ankr.com** Where applicable, you can review and change your Personal Information by logging into the Website and visiting your account profile page. You may also email us at privacy@ankr.com to request access to, correct, or delete any Personal Information that you have provided to us. But note that we can delete your Personal Information only by deleting your user account. We may not accommodate a request to change information if we believe the change would violate any law or legal requirement or cause the information to be incorrect. ### Is my data secure with you? > **We are doing our best for it to be safe.** We have implemented measures designed to secure your Personal Information from accidental loss and unauthorized access, use, alteration, and disclosure. The information you provide is stored on our secure servers behind firewalls. The safety and security of your information also depend on you. You are responsible for keeping your Platform's password or other private data secure and confidential. We urge you to be careful about sharing any such information with anyone. ### Can we disclose your info? > **We may — in certain cases.** We may disclose Personal Information that we collect, or that you provide, as described in this Privacy Policy: * To fulfill the purpose for which you provide it. * For any other purpose disclosed by us when you provide the information. * With your consent. We may also disclose such information: * To comply with any court order, applicable law, or enforceable legal process, including to respond to any government or regulatory request. * In connection with the sale or contemplated sale of the company, its assets, or a portion thereof. * If we believe disclosure is necessary or appropriate to protect the rights, property, or safety of Ankr, our customers, or others. ## Ephemeral Activity Data FAQ Here, we continue investigating the Privacy Policy regarding the Ephemeral Activity Data we collect: how we treat such info and what's our retention policy for it. ### How we treat the Ephemeral Activity Data? > **We will not correlate or associate Ephemeral Activity Data for the purpose of identifying or tracking you.** At no time during our collection or use of provided information do we link, correlate, or otherwise cause to be associated any non-technical identifying information you provide with any Ephemeral Activity Data that we automatically collect upon your interaction with the Platform. That is also true for any piece of Ephemeral Activity Data (for example, Internet Protocol (IP) addresses) — at no time do we link, correlate, or otherwise cause to be associated such data with any other piece of Ephemeral Activity Data for purposes of identifying, tracking, or profiling you. Ephemeral Activity Data is “anonymized” as soon as is practicable upon receiving it — to further prevent any such association. ### What about retention of Ephemeral Activity Data? > **We automatically delete Ephemeral Activity Data within thirty (30) days of its collection.** Unless we notify you on the need to retain certain data, we will automatically delete any and all Ephemeral Activity Data within thirty (30) days of its collection. This practice reflects the fact that Ankr only uses Ephemeral Activity Data to facilitate and optimize users’ access to the Platform and to generate anonymized web traffic analysis that we use to improve the performance of the services we provide the users with. ## Particular groups FAQ Here, we continue investigating our privacy practices regarding particular groups of people: children under age 13, residents of California, and non-U.S. residents. ### Can children under 13 access the Platform? > **The Platform is not intended for children under 13 years of age.** No one under age 13 may access or provide any information to or on the Platform. We do not knowingly collect Personal Information from children under 13. If we learn we have collected or received Personal Information from a child under 13 without verification of parental consent, we will delete that information. If you are the parent or guardian of a child under 13 and believe we have inadvertently collected information about your child, please contact us immediately at: privacy@ankr.com. ### Anything important for California residents? > **Residents of California can obtain certain info about the types of personal information shared with third parties for direct marketing purposes.** Under California Civil Code Section 1798.83, California residents have the right to obtain certain information about the types of personal information that companies with whom they have an established business relationship (and that are not otherwise exempt) have shared with third parties for direct marketing purposes during the preceding calendar year, including the names and addresses of those third parties, and examples of the types of services or products marketed by those third parties. If you are a California resident, and you wish to opt out; or you wish to request certain information regarding our disclosure of your Personal Information to third parties for the direct marketing purposes, please send an e-mail to privacy@ankr.com. However, please note that we do not currently sell data, nor do we share information with third parties in any way that would trigger the statute’s opt-out requirements. ### Anything important for non-U.S. residents? > **The applicable privacy laws may vary from your local ones.** The servers used in connection with the operation and use of the Platform are operated in the United States and elsewhere. Please be aware that certain information may be transferred to, processed, maintained, and used on computers, servers, and systems located outside your state, province, country, or other governmental jurisdiction where the privacy laws may not be as protective as those in your jurisdiction. If you are located outside the United States and choose to use the Platform, you hereby consent to such transfer, processing, and use in the United States and elsewhere. ## Miscellaneous FAQ Here is the closing abstract dealing with the questions on changes in the Privacy Policy or the contacts we have for you if you'd like to share your thoughts or concerns regarding it. ### What about changes to the Privacy Policy? > **If we make substantial changes to how we treat our users' Personal Information for purposes you've not consented to, we will notify you by email specified in your account.** It is our policy to post any changes we make to this Privacy Policy on this page. If we make material changes to how we treat our users' Personal Information such that we are using Personal Information for purposes of sharing data with third parties that you have not consented to, we will notify you by email to the primary email address specified in your account. The Privacy Policy's last revision date is identified at the top of the page. You are responsible for ensuring we have your up-to-date active and deliverable email address. And you are responsible for periodically visiting the Platform and the Privacy Policy to check for any changes. ### Where can I ask questions about the Privacy Policy? > **To question or comment on the Privacy Policy and our privacy practices, contact us at: privacy@ankr.com.** If you have any complaints or concerns regarding our compliance with the Privacy Policy, please contact us first. We will investigate and attempt to resolve complaints and disputes regarding the use and disclosure of Personal Information in accordance with the Privacy Policy and applicable law. --- url: https://www.ankr.com/docs/scaling-services-bsi/ title: Bitcoin Secured Infrastructure description: Bitcoin Secured Infrastructure is a supplementary framework or protocol built on top of the Bitcoin blockchain to improve its functionality, particularly in. source: docs/scaling-services-bsi.mdx --- # Bitcoin Secured Infrastructure Bitcoin Secured Infrastructure is a supplementary framework or protocol built on top of the Bitcoin blockchain to improve its functionality, particularly in terms of scalability, transaction speed, cost, and security. As a first step, Asphere forms a strategic alliance with [Babylon](https://babylonlabs.io/) and offers launching your custom Bitcoin chain that natively integrates with Babylon's network and Bitcoin Staking protocol that enhances the crypto-economic security of you chain, makes it a participant of the healthy economics, and provides a highly-scalable chain with fast finality for transactions. Asphere's Bitcoin Secured Infrastructure provide the following security benefits to chains with Babylon's Bitcoin Timestamping protocol: * **Solves long-range attacks**: Bitcoin's immutability ensures that finalized PoS blocks cannot be tampered with after they are anchored to the Bitcoin blockchain. This significantly reduces the risk of long-range attacks, where an attacker tries to rewrite the blockchain’s history by manipulating old blocks, as Bitcoin’s Proof-of-Work (PoW) makes such attacks extremely costly and unlikely. * **No weak subjectivity**: Bitcoin timestamps are objective. It can thus eliminate the dependency of PoS chains on social consensus and weak subjectivity. * **Shorter unbonding time**: By replacing social consensus, BTC timestamping can reduce the stake unbonding time of PoS chains from weeks to one day. * **New chain bootstrapping**: New PoS chains with low valuation are more vulnerable to forking attacks. BTC timestamping can help safeguard the chain alone its growth. * **Verification of state sync and snapshots**: The objective truth about a PoS chain provided by BTC allows the users of the PoS chain to verify the chain state or snapshot it has downloaded from the P2P network. * **Protecting important transactions**: BTC timestamps can be used to further confirm important PoS transactions at the cost of longer confirmation latency. * **Censorship Resistance**: BTC timestamping could also be used to fight against transaction censorship in PoS chains via posting censored transactions to BTC. ## Bitcoin Secured Infrastructure tech solution Asphere offers a comprehensive suite of technical solutions designed to accelerate launching your custom Bitcoin PoS chain: * **Cosmos SDK Template**: We offer a fully customizable template built on the Cosmos SDK, allowing developers to launch their own blockchain network quickly and start using it with an RPC URL. * **Babylon Integration**: Native integration with Babylon’s network and Bitcoin staking protocol via the Inter-Blockchain Communication (IBC) protocol ensures that your PoS chain benefits from Bitcoin’s robust security. This integration provides fast finality for transactions and allows seamless interoperability with other blockchains, enhancing the overall security and scalability of your network. * **VM Flexibility**: Developers can choose between various Virtual Machine (VM) environments, such as Ethereum Virtual Machine (EVM) or WebAssembly (WASM), based on the specific requirements of their project. This flexibility allows you to deploy smart contracts and other decentralized dApps with ease. * **Modules**: Asphere also offers optional modules like bridges and block explorers to enhance the capabilities of your network. Besides those common items, you have the vast list of modules to choose from: * **Auth**: Authentication of accounts and transactions for Cosmos SDK applications. * **Authz**: Authorization for accounts to perform actions on behalf of other accounts. * **Bank**: Token transfer functionalities. * **Bank v2**: Token transfer functionalities, enhanced. * **Circuit**: Circuit breaker module for pausing messages. * **Consensus** Consensus module for modifying CometBFT's ABCI consensus params. * **Distribution**: Fee distribution, and staking token provision distribution. * **Epochs**: Allow other modules to set that they would like to be signaled once every period. * **Evidence**: Evidence handling for double signing, misbehaviour, etc. * **Feegrant**: Grant fee allowances for executing transactions. * **Genutil**: Genesis utilities for the Cosmos SDK. * **Governance**: On-chain proposals and voting. * **Mint**: Creation of new units of staking token. * **NFT**: NFT module implemented based on ADR43. * **Params**: Globally available parameter store. * **Protocolpool**: Functionalities handling community pool funds. * **Slashing**: Validator punishment mechanisms. * **Staking**: Proof-of-Stake layer for public blockchains. * **Tx**: Tx utilities for the Cosmos SDK. * **Upgrade**: Software upgrades handling and coordination. * **Validate**: Global ante/post handlers and tx validator setup. --- url: https://www.ankr.com/docs/scaling-services-nocode-deployer/ title: No-Code Deployer description: No-code Deployer is a Rollup-as-a-Service (RaaS) platform that offers the infrastructure and tools required to implement and manage rollup solutions, elimina. source: docs/scaling-services-nocode-deployer.mdx --- # No-Code Deployer No-code Deployer is a Rollup-as-a-Service (RaaS) platform that offers the infrastructure and tools required to implement and manage rollup solutions, eliminating the need for deep expertise in the underlying technology. ## Asphere Rollup Deployment A rollup deployment process consists of the following parts: > [`Sign in`](/scaling-services-nocode-deployer/#sign-in) —> [`Deploy Rollup`](/scaling-services-nocode-deployer/#deploy-testnet-rollup) * **Sign in**: Authenticate on the platform to start using its functionality. * **Deploy Rollup**: Define your rollup settings, and then deploy it. ### Sign in First things first, sign in to use the platform's functionality: 1. Go to the [**Scaling Services**](https://rollup.asphere.xyz/) platform. 2. Click **Sign in > Continue with Google**, and then select an account you'd like to use. Congrats — you've just signed in to the Scaling Services platform! For those signing in for the first time, please enter your basic company information so that we know our customers. --- ### Deploy Testnet Rollup To deploy a rollup using a Testnet network, follow these steps: 1. [Sign in](/scaling-services-nocode-deployer/#sign-in) on the [**Scaling Services**](https://rollup.asphere.xyz/) platform. 2. In **Navigation**, click **Deploy Rollup** to start a rollup configuration process. 3. On the **Essentials** tab, select the following rollup parameters, and then click **Next**: * **Stack**: * **Instant**: [Arbitrum Orbit](/scaling-services-overview/#arbitrum-orbit), [OP Stack](/scaling-services-overview/#op-stack), [Polkadot](/scaling-services-overview/#polkadot) — deploy instantly upon completing all the steps. * **Assisted** (no label): [Base](/scaling-services-overview/#base), [Agglayer CDK](/scaling-services-overview/#agglayer-cdk), [ZKsync's ZK Stack](/scaling-services-overview/#zk-stack) — provide your rollup requirements, and we will generate a Slack or Telegram group to finalize all the aspects of your deployment specification. * **Network**: Select your **Testnet** option: * **Trial**: Explore the rollup functionality for free (48 hours). * **Persistent**: Use a permanent testing environment to experiment with your dapps before deploying them to Mainnet. * **Settlement Layer**: Select a blockchain responsible for proof verification and dispute resolution: * **Sepolia**: EVM-compatible testnet. * **Holesky**: EVM-compatible testnet. * **Base Sepolia**: a Testnet for Base. * **Kusama**: a scalable, multichain network, serving as the experimental, community-focused canary network for Polkadot. * **Westend**: a testnet for Polkadot, designed for testing features and deployments before moving to Kusama or Polkadot. * **Paseo**: a testnet in the Polkadot ecosystem for validating new features in a safe environment before mainnet deployment. * **Parachain template** (for the Polkadot stack only): Select an **EVM** or **Generic** template for you parachain. * **Coretime** (for the Polkadot stack only): Select whether a Bulk, Interlacing, or No coretime required for your rollup. * **Data Availability Layer**: * **Instant**: [Ethereum](/scaling-services-overview/#ethereum), [Arbitrum AnyTrust](/scaling-services-overview/#arbitrum-anytrust) — deploy instantly upon completing all the steps. * **Assisted** (no label): [Celestia](/scaling-services-overview/#celestia), [Eigen Layer](/scaling-services-overview/#eigen-layer), [Avail DA](/scaling-services-overview/#avail-da), [NEAR DA](/scaling-services-overview/#near) — provide your rollup requirements, and we will generate a Slack or Telegram group to finalize all the aspects of your deployment specification. 4. On the **Configuration** tab, specify the following parameters, and then click **Next**: * **Chain ID** * **Rollup Name** * **Gas Token**: * **ETH**: Use ETH to pay your network's gas fees. * **Custom Gas Token**: For gas fees, use your [custom ERC-20 token](/scaling-services-nocode-deployer/#custom-gas-token) created and deployed on the network. * **USDC**: Use USDC to pay your network's gas fees. * **ANKR**: Use ANKR to pay your network's gas fees. * **KUS/WND/PAS**: Use KUS/WND/PAS to pay for your network's gas fees. * **Create a Token**: Get help setting up a custom gas token. 5. On the **Infrastructure** tab, check the components included in your package, and then click **Confirm**. 6. In the **Summary** dialog, check your complete rollup specification, and then click **Confirm**. 7. As an anti-abuse measure, to deploy a rollup on a Testnet, you must have `1 ankrETH` in your wallet.
In the **Prove ankrETH** dialog, perform the following actions to start your rollup deployment: * Click **Connect MetaMask and prove address**. * In MetaMask, select the Ethereum address to associate with your account. * Sign with MetaMask wallet. Congrats — you've just configured and deployed your Testnet rollup! --- ### Deploy Mainnet Rollup To deploy a rollup using a Mainnet network, follow these steps: 1. [Sign in](/scaling-services-nocode-deployer/#sign-in) on the [**Scaling Services**](https://rollup.asphere.xyz/) platform. 2. In **Navigation**, click **Deploy Rollup** to start a rollup configuration process. 3. On the **Essentials** tab, select the following rollup parameters, and then click **Next**: * **Stack**: * **Instant**: [Arbitrum Orbit](/scaling-services-overview/#arbitrum-orbit), [OP Stack](/scaling-services-overview/#op-stack), [Polkadot](/scaling-services-overview/#polkadot) — deploy instantly upon completing all the steps. * **Assisted** (no label): [Base](/scaling-services-overview/#base), [Agglayer CDK](/scaling-services-overview/#agglayer-cdk), [ZKsync's ZK Stack](/scaling-services-overview/#zk-stack) — provide your rollup requirements, and we will generate a Slack or Telegram group to finalize all the aspects of your deployment specification. * **Network**: Select **Mainnet** — to deploy your rollup on a fully operational blockchain network. * **Infrastructure Package**: Upon selecting Mainnet, you have to select the Infrastructure to be used for your rollup solution: * **Starter Package**: Block Explorer, Starter RPC Package, Aggregator, Synchronizer, Bridge. * **Advanced Package**: Block Explorer, Pro RPC Package, Aggregator, Synchronizer, Bridge, Feature prioritization, Dedicated customer support, Advanced customization. * **Parachain template** (for the Polkadot stack only): Select an **EVM** or **Generic** template for you parachain. * **Coretime** (for the Polkadot stack only): Select whether a Bulk, Interlacing, or No coretime required for your rollup. * **Data Availability Layer**: * **Instant**: [Ethereum](/scaling-services-overview/#ethereum), [Arbitrum AnyTrust](/scaling-services-overview/#arbitrum-anytrust) — deploy instantly upon completing all the steps. * **Assisted** (no label): [Celestia](/scaling-services-overview/#celestia), [Eigen Layer](/scaling-services-overview/#eigen-layer), [Avail DA](/scaling-services-overview/#avail-da), [NEAR DA](/scaling-services-overview/#near) — provide your rollup requirements, and we will generate a Slack or Telegram group to finalize all the aspects of your deployment specification. 4. On the **Sequencer** tab, select whether you'd like to have an Asphere-managed sequencer or a self-managed sequencer. 5. On the **Configuration** tab, specify the following parameters, and then click **Next**: * **Chain ID** * **Rollup Name** * **Gas Token**: * **ETH**: Use ETH to pay your network's gas fees. * **Custom Gas Token**: For gas fees, use your [custom ERC-20 token](/scaling-services-nocode-deployer/#custom-gas-token) created and deployed on the network. * **USDC**: Use USDC to pay your network's gas fees. * **ANKR**: Use ANKR to pay your network's gas fees. * **DOT**: Use DOT to pay your network's gas fees. * **Create a Token**: Get help setting up a custom gas token. 6. On the **Infrastructure** tab, check the components included in your package, and then click **Confirm**. 7. In the **Summary** dialog, check your complete rollup specification, and then click **Confirm and Pay**. Make sure you have `0.9 ETH` and `0.2 Custom Gas Token` (if using such an option) in your wallet to deploy your rollup on a Mainnet. 8. On the Stripe / Loop Crypto checkout page, follow the instructions to pay for and deploy the configured rollup. Congrats — you've just configured and deployed your Mainnet rollup! --- ## Solana SPE Deployment An [SPE](https://solana.com/solutions/solana-permissioned-environments) deployment process consists of the following parts: > [`Sign in`](/scaling-services-nocode-deployer/#sign-in-2) —> [`Deploy Rollup`](/scaling-services-nocode-deployer/#deploy-testnet-rollup-2) * **Sign in**: Authenticate on the platform to start using its functionality. * **Deploy Rollup**: Define your SPE settings, and we will generate a Slack/Telegram group to finalize all the aspects of your deployment specification. ### Sign in First things first, sign in to use the platform's functionality: 1. Go to the [**Solana No-code Deployer**](https://solana.asphere.xyz/) platform. 2. Click **Sign in > Continue with Google**, and then select an account you'd like to use. Congrats — you've just signed in to the Solana SPE deployment platform! For those signing in for the first time, please enter your basic company information so that we know our customers. --- ### Deploy SPE To define an SPE deployment configuration, follow these steps: 1. [Sign in](/scaling-services-nocode-deployer/#sign-in-2) on the [**Solana No-code Deployer**](https://solana.asphere.xyz/) platform. 2. In **Navigation**, click **Deploy Chain** to start an SPE configuration process. 3. On the **Essentials** tab, select the following SPE parameters, and then click **Next**: * **Stack**: SVM. * **Network**: Select either a **Testnet** or production-ready **Mainnet** option for your SPE: * **Infrastructure Package**: * **For Testnet**: * **Trial**: Explore the SPE functionality for free (48 hours). * **Persistent**: Use a permanent testing environment to experiment with your dapps before deploying them to Mainnet. * **For Mainnet**: * **Starter package**: Block Explorer, Starter RPC Package. * **Advanced package**: Block Explorer, Pro RPC Package. * **Network access type**: * **Private**: a restricted network — access, validation, and governance limited to approved participants. * **Public**: an open network — access, validation, and governance available to all participants. 4. On the **Configuration** tab, specify the following parameters, and then click **Next**: * **Chain Name** * **Gas Token**: * **SOL**: Use [SOL](https://solana.com/docs/core/fees) to pay your network's transaction fees. * **Gasless**: Transactions require no SOL from the sender. 5. On the **Infrastructure** tab, check the components included in your package, and then click **Confirm**. 6. In the **Summary** dialog, check your complete SPE specification, click **Confirm via Telegram/Slack**, and then enter your **Telagram Username / Slack Email** so that we can generate a Slack/Telegram group to finalize all the aspects of your deployment specification. Congrats — you've just defined your SPE configuration and our specialist will reach out to you shortly via the preferred communication channel to finalize all the aspects of your deployment specification! --- ## Custom Gas Token Deploying your AnyTrust Orbit chain or OP Stack chain, you have the option of using a custom gas token, other than ETH, for gas payments on the network. When choosing this option, there are certain requirements that the token needs to comply with. ### AnyTrust Orbit chain **Requirements** A custom gas token must meet the following requirements: * **ERC-20 Compliance**: The token must conform to the ERC-20 standard. * **Native Deployment**: The token must be natively deployed on the parent chain. * **Native Bridging and Proper Configuration**: During chain deployment, the gas token must be "natively bridged" and configured as the native gas token on the Orbit chain. **Custom gas token restrictions for ERC-20**: * The token must be configured with 18 decimals. * The token can't be rebasing or have a transfer fee. * The token must only be transferable via direct calls to the token address. * The token must only be able to set allowances via direct calls to the token address. * The token must not have a callback on transfer. * Users must not be able to make a transfer to themselves that results in a revert. ### OP Stack chain **Requirements** The custom gas token must adhere to the following constraints: * Must be a valid ERC-20 token. * The number of decimals on the token MUST be exactly 18. * The name of the token MUST be less than or equal to 32 bytes. * Symbol MUST be less than or equal to 32 bytes. * Must not be yield-bearing. * Cannot be rebasing or have a transfer fee. * Must be transferrable only via a call to the token address itself. * Must only be able to set allowance via a call to the token address itself. * Must not have a callback on transfer, and more generally a user must not be able to make a transfer to themselves revert. * A user must not be able to make a transfer have unexpected side effects. ## Arbitrum Bridge Setup You might be interested in how-tos for the following scenarios: * [Add Testnet to Arbitrum bridge](/scaling-services-nocode-deployer/#add-testnet-to-arbitrum-bridge) * [Add Mainnet to Arbitrum bridge](/scaling-services-nocode-deployer/#add-mainnet-to-arbitrum-bridge) ### Add Testnet to Arbitrum Bridge Currently, adding a Testnet Orbit chain to the Arbitrum bridge must be done locally. This means that you will configure the bridge UI to display the desired chain, but this change will only apply to you and be accessible from localhost. To add a Testnet chain to Arbitrum bridge, follow these steps: 1. Navigate to https://bridge.arbitrum.io/. 2. Connect to the bridge UI using your Ethereum wallet. 3. In the bridge UI, click your **Wallet address > Settings > Turn on testnet mode** to activate a Testnet mode. 4. In **Settings > Add Testnet Orbit Chain**, add a JSON configuration, and then click **Add Chain**. The JSON configuration must contain the following data: * A transaction output from bridge deployment * Bridge setup data from `OrbitSetupScript.json` ```json { "chainInfo": { "minL2BaseFee": 100000000, "networkFeeReceiver": "0x72efD0dA4E05E1db05eB4Cd34e736Ee892437065", "infrastructureFeeCollector": "0x72efD0dA4E05E1db05eB4Cd34e736Ee892437065", "batchPoster": "0x11CF25037F5E7e789D4cF3D0AEF22bE84220BF68", "staker": "0xB9a52331D21c0b4F26b48c57A4d56C7725bCBa29", "chainOwner": "0x72efD0dA4E05E1db05eB4Cd34e736Ee892437065", "chainName": "REGEN", "chainId": 749, "parentChainId": 17000, "rpcUrl": "https://rpc-nitro.testnet-social-network.raas.ankr.com", "explorerUrl": "http://localhost", "nativeToken": "0x4c007cDcC5355f53cfD61B29cEa68174170745F8" }, "coreContracts": { "rollup": "0x27F339cfe4e43DF353370fcA6Bbd0cF2DF0F74d5", "inbox": "0x9C71868E01A91298aD3DbF9EF64C932aeC08aEb4", "outbox": "0x865A8Ab91FA987B3D5A4ED5d74932Bf1b24e75F7", "adminProxy": "0x114439795524e011944a0E69F087a497cE681e41", "sequencerInbox": "0x39eDedfaaC0EF97ffE8FD189fA18E7D8Bf2B24b7", "bridge": "0x7caDa6Efc126d59afCAeEd763E51c8A15d57269B", "utils": "0x0D5CbCc8D2c97F1dEB94f6f4dd3a36A7C01c01EE", "validatorWalletCreator": "0x653A6F645b680bF0E3c57d1eE0c0fcD1e01470F3" }, "tokenBridgeContracts": { "l2Contracts": { "customGateway": "0xA004f196Aa2c00a6743ca6850862fDAAc20FAA54", "multicall": "0xF3cA368BeF5252476E84de2A835167c90262D3C1", "proxyAdmin": "0x114439795524e011944a0E69F087a497cE681e41", "router": "0xfFbFdAd733822485b88bA1AfDB42dF76f07F802a", "standardGateway": "0xe762bED1C0fA4F49bac04580D42E2D3570E9357c", "weth": "0x0000000000000000000000000000000000000000", "wethGateway": "0x0000000000000000000000000000000000000000" }, "l3Contracts": { "customGateway": "0x850d2501E6Da6B105aFb689529497B7024776E78", "multicall": "0xc5DD7Dab959Eb221911a58dC469d769270C2De2F", "proxyAdmin": "0xe762728C1022dAe5D2d0f4a0317944B9d70B309C", "router": "0x9A2e67eE268cE392A2D91D8fF87bac1D45980B98", "standardGateway": "0xe17851222aba0821EAfc4F0AE8fDf4d8827124fa", "weth": "0x0000000000000000000000000000000000000000", "wethGateway": "0x0000000000000000000000000000000000000000" } } } ``` Congrats — you've just added a Testnet chain to the bridge UI for local use! --- ### Add Mainnet to Arbitrum Bridge To have a Mainnet chain added to the Arbitrum bridge, there are two options available: * Request adding a Mainnet chain by filling out the [form](https://docs.google.com/forms/d/e/1FAIpQLSeHusW27KPta53XMD2HAIfgzubQbIxW1ghqOCuXfg-ocWpMeQ/viewform). * Fork and host the bridge UI, modifying it to add mainnet chains. The bridge UI can be found on [OffchainLabs' GitHib](https://github.com/OffchainLabs/arbitrum-token-bridge). --- ## OP Stack: Bridging The OP Stack is designed to build Layer 2 systems that are deeply integrated with Ethereum. While OP Mainnet handles transaction execution off-chain, developers need the ability to transfer data and tokens between OP Mainnet and Ethereum. This process is known as bridging. For more information, refer to the [Bridging Basics](https://docs.optimism.io/builders/app-developers/bridging/basics) section in the official Optimism documentation. --- url: https://www.ankr.com/docs/scaling-services-overview/ title: Scaling Services Overview description: Ankr Scaling Services is a suite of layer 2 and modularity solutions aimed at bringing Web3 to a new paradigm of blockchain performance. Our particular focus. source: docs/scaling-services-overview.mdx --- # Scaling Services Overview Ankr Scaling Services is a suite of layer 2 and modularity solutions aimed at bringing Web3 to a new paradigm of blockchain performance. Our particular focus on providing the Web3 space with a comprehensive Rollup-as-a-Service (RaaS) offering is driven by the fact that Rollups have become a recognized solution in addressing critical blockchain issues of scalability, efficiency, security, and user experience. > **"Our goal for RaaS is to make the user experience of launching a layer 2 as seamless as publishing a new website at the mature stages of the dot-com industry."** — Kev Silk, Senior Product Manager of Ankr Scaling Services. ## Ankr's Rollup-as-a-Service Ankr's RaaS, a key part of its Scaling Services, equips developers with fast, secure tools for building Rollups and other scaling solutions like Sidechains across blockchain ecosystems. Merging decentralized infrastructure with financial incentives via Liquid Staking, Ankr offers a comprehensive and sustainable development experience, catering to the demand for scalable, Ethereum-secure projects, and establishing itself as a RaaS leader. ### What we offer Ankr distinguishes itself as the sole RaaS provider blending top-tier DePIN-status rollup infrastructure with developer incentives via ankrETH, and a dual token strategy. This mix ensures a sustainable, all-encompassing development setting, backed by a decentralized, superior infrastructure network. * **Infrastructure and Scalability**: As a DePIN provider, Ankr leverages not only their own world-class globally-distributed bare-metal and cloud infrastructure of nodes, but also a worldwide network of elite node providers, including IoTex, Mind Heart Soul, and Tencent. This decentralized, secure, and robust infrastructure guarantees having all the necessary means to cater to the scalability requirements of various Rollup-centric projects. Serving two trillion annual transactions on its own, Ankr has the proven capability to handle and scale to the demands that RaaS requires. * **End-to-End Support and Customization**: With your specific project requirements in mind, Ankr offers end-to-end design, engineering, customization, and maintenance services. This includes everything from design and deployment to infrastructure operations and financial incentives. * **Architecture Flexibility**: By collaborating with blockchain entities like Optimism, zkSync, Arbitrum, and Polygon, Ankr has become an approved implementation partner, enabling it to provide specialized solutions tailored to different blockchain ecosystems. This helps in creating a more interconnected and versatile Web3 environment where developers can leverage both ZK and Optimistic rollup architectures for creating dedicated Rollups. * **Liquid Staking and Financial Incentives**: Ankr integrates its liquid staking tech into RaaS offerings, allowing developers to use ankrETH as gas fees while providing staking rewards for token holders. This introduces financial incentives directly into the development process, benefiting both the platform and its users by reducing operational costs and enabling new revenue streams. * **Comprehensive Developer Tools**: Ankr's RaaS solution is designed to reduce development time and allow teams to focus on their unique use cases. By providing blockchain engineering, rollup infrastructure, development tools, and security auditing, Ankr ensures that projects can be launched with the necessary support and resources. Overall, Ankr offers a robust, scalable, and customizable RaaS solution that meets the evolving needs of Web3 developers and enterprises. This aids in the development of more efficient, secure, and user-friendly blockchain applications, accelerating the adoption and growth of the Web3 ecosystem. ### Benefits of Dual Token Economics Ankr’s RaaS gives clients the opportunity to create and use innovative new tokens as their native currency. Imagine every token on your Ethereum-based rollup offers constant rewards for holders. This is the power of using Ankr’s Ethereum liquid staking token, ankrETH, as your optional gas token. **Key benefits**: * **Share Security**: Unlock the massive capital base of staked ETH to be utilized again in securing your rollup with Ankr’s liquid staking assets. * **Collect 24/7 Rewards**: Using ankrETH as your rollup token means a constant stream of ETH staking rewards is delivered to all holders. * **Put TVL on Autopilot**: Multiply the TVL potential of your rollup as the value of tokens on the network grows daily to support every financial function. * **Achieve Gasless UX**: Use the ankrETH liquid staking token as your gas token to cover operational costs or subsidize gas fees. ## Supported Technology ### Rollup Stacks A Rollup stack is a set of technologies and protocols used to bundle or "roll up" multiple transactions into a single transaction. This approach allows for more efficient processing and significantly reduces the burden on the main blockchain, enhancing scalability and transaction speed while maintaining security and decentralization. #### Fluent Using Fluent as a Rollup stack offers several benefits including the ability to build and deploy scalable applications in a variety of programming languages through WebAssembly (Wasm), ensuring compatibility with the Ethereum Virtual Machine (EVM), and providing flexible app deployment models. These features collectively enhance developer freedom, interoperability, and efficiency in the Ethereum ecosystem. #### OP Stack The use of the OP Stack offers a distinctive approach focused on enhancing scalability and developer experience within the Ethereum ecosystem. Key aspects of using the OP Stack include: * **Scalability**: The OP Stack helps scale the Ethereum network by handling transactions off-chain and submitting condensed transaction data to the mainnet, significantly reducing gas costs and increasing transaction throughput. * **Developer Friendliness**: It provides a smooth and familiar environment for developers, leveraging existing Ethereum tooling and smart contract languages, which reduces the learning curve and accelerates dApp development. * **Security**: While prioritizing scalability and developer experience, the OP Stack also maintains high security standards, relying on the underlying security of the Ethereum blockchain and additional fraud-proof mechanisms inherent to Optimistic Rollups. * **Compatibility**: The stack is designed to be highly compatible with Ethereum, meaning that it supports EVM-compatible smart contracts and assets, facilitating easy migration of dApps from Ethereum to Ankr's Rollup-as-a-Service. * **Finality and Cost-efficiency**: Transactions processed through the OP Stack have a longer finality time compared to other solutions like ZK-Rollups, but they offer a balance between cost and speed, making it a practical choice for a variety of applications. In essence, the OP Stack provides a scalable, cost-effective, and developer-friendly platform for building and deploying decentralized applications, all while leveraging the security and interoperability of the Ethereum ecosystem. #### ZK Stack Using a ZK (Zero-Knowledge) Stack has several key differentiators: * **Enhanced Privacy**: The ZK Stack leverages zero-knowledge proofs, which allow for transaction validation without revealing the actual information contained within those transactions. This enhances privacy and security, making it ideal for applications that handle sensitive data. * **Scalability and Efficiency**: ZK-Rollups bundle hundreds or even thousands of off-chain transactions into a single transaction. The ZK Stack compresses this data and generates a cryptographic proof, known as a SNARK (Succinct Non-Interactive Argument of Knowledge), which is then posted to the Ethereum blockchain. This process significantly reduces the data stored on the blockchain, leading to higher transaction throughput and lower costs compared to traditional blockchain transactions. * **Finality and Security**: Transactions processed through a ZK Stack achieve finality quickly once posted to the mainnet, as the zero-knowledge proof ensures the correctness of all transactions in the batch without the need for multiple confirmations. This not only speeds up transactions but also leverages the underlying security of the Ethereum network. * **Developer Friendliness**: Despite the complex technology underlying ZK-Rollups, Ankr's ZK Stack is designed to be accessible for developers. It provides tools and frameworks that help in building and deploying scalable dApps with an emphasis on ease of use and integration with existing Ethereum development workflows. * **Compatibility and Interoperability**: ZK Stack is built to ensure compatibility with Ethereum standards, facilitating ease of integration with the broader Ethereum ecosystem and interoperability with other chains and layer 2 solutions. * **Economic Incentives**: The ZK Stack is designed to optimize transaction fees and token economics to ensure that validators and participants are fairly compensated, promoting a healthy and sustainable network ecosystem. In summary, the key advantages of using a ZK Stack include enhanced privacy and security through zero-knowledge proofs, improved scalability and efficiency, fast finality, developer friendliness, and strong compatibility and interoperability with the Ethereum ecosystem. #### Agglayer CDK Using Agglayer CDK (formerly Polygon CDK) as a Rollup stack offers unique advantages such as enhanced scalability, flexibility, and developer‑friendly tools. It supports various types of rollups, catering to different needs and security models, thereby providing a versatile environment for building and deploying scalable blockchain applications. The integration with Agglayer also offers a seamless connection to a broader ecosystem, facilitating easier access to users and assets within the Agglayer network. #### Arbitrum Orbit The Arbitrum Orbit stack is a customizable framework that enables the creation of personalized Layer 2 (L2) or Layer 3 (L3) blockchains based on the Arbitrum Nitro technology, offering a scalable and flexible solution for deploying decentralized applications with the potential for enhanced control over performance and cost. The main advantages of the Arbitrum Orbit stack are the following: * **Protocol Customization**: The Orbit framework enables the deployment of custom chains, allowing for tailored configurations that suit specific project needs. This includes customization at any layer of the stack, including the sequencer, state transition function, throughput, privacy settings, gas token, governance mechanisms, custom precompiles, data availability, and more. * **Flexible Technology Options**: Orbit lets you choose between Rollup, AnyTrust, or custom technology stacks. This makes Ethereum and Arbitrum technologies more adaptable by allowing you to incorporate only the elements of the technologies that you need. * **Enhanced Security and Cost-Effectiveness**: Arbitrum technology powers the most secure L2s, and you can use this same mature technology stack for your Orbit chain. By leveraging Arbitrum's Nitro core, Orbit chains can either opt for Ethereum-level security with Arbitrum One's Rollup technology or minimal trust assumptions with the Arbitrum Nova's AnyTrust technology, catering to different levels of security and cost-effectiveness requirements. * **Fraud Proofs**: Arbitrum Orbit's fraud proofs are a cornerstone of its security features, ensuring the integrity and correctness of transactions within the Arbitrum ecosystem. Arbitrum employs an innovative multi-stage anti-fraud protection mechanism, which is designed to be more gas-efficient compared to other L2 optimistic rollups. This system utilizes multi-round interactive fraud proofs, which is a battle-tested solution that allows any observer to challenge a posted transaction and guarantees resolving disputes and safeguarding against incorrect or malicious transactions. * **Custom Gas Token**: Orbit chains offer the flexibility to use alternative ERC-20 tokens as the native gas token on the network for gas fees, which can facilitate seamless integration with an application's ecosystem. * **Native Data Availability**: Arbitrum AnyTrust is a natively supported DA layer that relies on an external Data Availability Committee (DAC) to store data and provide it on-demand instead of using its parent chain as the Data Availability (DA) layer. This provides for high throughput and sub-cent transaction fees. * **EVM+ Compatibility**: Orbit chains benefit from the same EVM+ compatibility introduced in Arbitrum Nitro, allowing for the deployment of EVM-compatible smart contracts using not only Solidity but other various programming languages — C, C++, Rust, and many more — without the need to migrate away from your existing toolchain. #### Polkadot The Polkadot stack enables the creation of custom parachains that leverage the shared security and interoperability of the Polkadot network. It provides a scalable and flexible environment for deploying specialized blockchains while benefiting from Polkadot’s relay chain security and native cross-chain communication. The main advantages of the Polkadot stack are the following: * **Shared Security and Interoperability**: Parachains built on Polkadot are secured by the relay chain’s validator set, removing the need for projects to bootstrap their own consensus mechanism. They also gain seamless cross-chain communication through the Cross-Chain Message Passing (XCMP) protocol, enabling easy integration with other parachains. * **Customizable Chain Logic**: Projects can define their own runtime logic, governance, economic models, and consensus parameters, creating highly specialized chains for specific use cases such as DeFi, identity, gaming, or supply chain. * **Modular Architecture**: The Polkadot stack supports a modular approach to blockchain design, allowing developers to use existing components or add custom ones to meet unique requirements. * **Forkless Upgrades**: Parachains can implement on-chain, forkless upgrades, allowing them to evolve rapidly without disruptive hard forks, ensuring continuous innovation and security improvements. * **Ecosystem Connectivity**: Connecting as a parachain provides access to Polkadot’s growing ecosystem of applications, users, and liquidity, giving projects an immediate network effect and interoperability from day one. #### Base The Base stack enables the creation of scalable Layer 2 (L2) blockchains built on top of Ethereum using the OP Stack, the same open-source technology powering Optimism. It provides a developer-friendly and cost-effective platform for deploying decentralized applications, combining Ethereum’s security with enhanced throughput and lower transaction costs. The main advantages of the Base stack are the following: * **Ethereum Security**: Base inherits Ethereum’s security model through its rollup architecture, ensuring robust protection of assets and transactions while reducing reliance on separate validator sets. * **OP Stack Foundation**: Built on the open-source OP Stack, Base benefits from a modular architecture, standardized infrastructure, and ongoing improvements from a growing ecosystem of contributors and partner chains. * **Low Fees and High Throughput**: By batching and compressing transactions before posting them to Ethereum, Base achieves significantly lower transaction fees and improved scalability, making it ideal for user-facing applications. * **Seamless Ethereum Compatibility**: Base offers full EVM compatibility, enabling developers to deploy existing Ethereum smart contracts and tooling with minimal modifications. This compatibility streamlines migration and integration with the broader Ethereum ecosystem. * **Ecosystem Access**: Base provides access to Coinbase’s ecosystem and liquidity, enhancing visibility and adoption opportunities for applications built on its infrastructure, while also enabling interoperability with other OP Stack-based networks. ### Data Availability Layers Data Availability (DA) layer is specifically concerned with ensuring that the data necessary to reconstruct the state of the blockchain is available to all nodes. This is crucial because, in a decentralized network, if data becomes unavailable, it can lead to problems like censorship, loss of funds, or network splits. The Data Availability layer aims to ensure that data is spread throughout the network in a manner that makes it recoverable even if some nodes go offline or act maliciously. #### Ethereum Ethereum serves as a data availability layer for Rollups by ensuring that transaction data is accessible for verification, which is crucial for maintaining the integrity and security of the network. * **Data Availability for Light Nodes and Rollups**: Ethereum addresses the data availability problem by enabling light nodes and Layer 2 rollups to operate effectively without needing to download all transaction data. Solutions like Data Availability Sampling (DAS) and Data Availability Committees (DACs) ensure that all network participants, especially those with limited resources, have assurances that full transaction data has been made available for verification. * **ZK-Rollups Interaction with Ethereum**: ZK-rollups operate as off-chain protocols that periodically commit transaction batches to Ethereum's Mainnet. These transactions are recorded on-chain, maintaining immutability and allowing anyone to reconstruct the rollup's state independently. Data availability is crucial for ZK-rollups since it enables permissionless verification of the Layer 2 chain's state and ensures that operations such as user withdrawals are based on accurate and up-to-date information. Ethereum's role is to ensure the availability of data behind every update to the rollup's state, thereby maintaining the security and integrity of transactions executed off-chain. In essence, Ethereum's structure and consensus mechanisms provide a secure and transparent foundation for rollups by ensuring that data needed to validate transactions is available to all participants, which helps prevent fraudulent activities and enhances the overall security of the network. This system enables Ethereum to support various scaling solutions, including both optimistic and ZK-rollups, by providing a reliable layer for data availability and transaction finality. #### Arbitrum AnyTrust AnyTrust is an Arbitrum protocol that manages data availability with a permissioned set of parties known as the Data Availability Committee (DAC). AnyTrust settles transactions securely on the parent chain, relying on a DAC to store and verify data, which requires only two honest parties independent of the committee size. Arbitrum chains that implement the AnyTrust protocol are referred to as Arbitrum AnyTrust chains. **Key features of AnyTrust**: * **Data Availability Committee (DAC)**: The AnyTrust model uses a committee-based approach, where a group of validators, known as the Data Availability Committee (DAC), is responsible for storing and providing access to transaction data. The DAC ensures that the data for each rollup batch is available and can be retrieved by any party who needs to verify or interact with the rollup. * **Trust Assumptions:**: AnyTrust’s security model relies on the assumption that at least one committee member will behave honestly and make the data available. This is a less stringent requirement compared to other models that assume a majority of participants are honest. This model allows for faster and more efficient data availability without compromising on security. * **Efficiency and Cost Reduction**: By offloading the data availability responsibility to the DAC, Arbitrum significantly reduces the amount of data that needs to be stored and processed on the Ethereum mainnet. This reduction in data load translates to lower gas fees for users and increased throughput for the network. * **Fallback Mechanism**: In the unlikely event that the DAC fails to make the data available, Arbitrum includes a fallback mechanism that leverages Ethereum’s mainnet for data storage. This ensures that the system remains secure and operational even in cases of DAC malfunction or collusion. AnyTrust protocol provides a scalable, efficient, and secure solution to the data availability challenge, making it a cornerstone of Arbitrum’s ability to scale Ethereum effectively. #### Eigen Layer EigenDA serves Rollups as their data availability layer by storing rollup transactions until they are finalized. It scales linearly with the number of operators, ensuring security and decentralization. EigenDA operates without a separate token, reducing risks and complexity for Ethereum Layer 2 solutions. It integrates with rollups through a process involving operators, a disperser, and retrievers, facilitating efficient data storage and retrieval within the Ethereum ecosystem #### Near NEAR DA serves Rollups as their data availability layer by offering a secure and cost-effective solution for Ethereum rollups and developers. It provides an infrastructure where 100kB of calldata costs significantly less compared to Ethereum L1, making data storage for rollups vastly cheaper and more reliable while maintaining Ethereum's security. This service is part of NEAR's broader efforts to support modular blockchain development and help developers reduce costs and enhance the reliability of their rollups. The architecture of NEAR DA leverages the unique aspects of NEAR’s consensus mechanism, Nightshade, which utilizes sharding to improve scalability and cost-efficiency. This allows for a more decentralized system, increasing the available block space without overwhelming the network with excess data. NEAR DA ensures that data is available for a sufficient amount of time, making it especially useful for rollups with high transaction volumes, such as gaming chains. This structure supports an easy-to-use environment for developers, offering out-of-the-box solutions for integrating with Ethereum rollups. NEAR DA offers tools like the Blob Store Contract for storing arbitrary data, the Light Client for accessing transaction and receipt data trustlessly, and the RPC Client for submitting data blobs to NEAR, all aimed at lowering data availability fees for rollups. These components facilitate the integration of NEAR's data availability services with layer-2 rollups, making it an attractive option for developers looking to enhance the performance and cost-efficiency of their platforms. #### Celestia Celestia is a modular data availability (DA) network that securely scales with the number of users, making it easy for anyone to launch their own blockchain. Rollups and L2s use Celestia as a network for publishing and making transaction data available for anyone to download. For them, Celestia provides high-throughput DA that can be verified easily with a light node. Using Celestia as a data availability layer for Rollups presents several advantages: * **Decoupling of Consensus and Execution**: Celestia provides a platform where the consensus mechanism is responsible only for ordering transactions and ensuring their availability, not for transaction execution. This separation improves scalability and efficiency. * **Enhanced Scalability**: Celestia utilizes data availability proofs and erasure coding, which helps in scaling block verification similarly to sharded blockchains but without the complexity of managing multiple shards. This makes it possible for systems built atop Celestia to achieve very high transaction throughput. * **Flexibility and Modularity**: Celestia's approach is modular, allowing different blockchain components to be optimized and scaled independently. This modularization leads to reduced costs and increased rates of innovation, as it allows builders to swap modules as per their requirements. * **Sovereignty for Rollups**: Rollups on Celestia can operate independently without enshrining a settlement layer, providing them more control and autonomy over their operations while still leveraging Celestia for data availability. * **Cost-Effectiveness**: By focusing solely on data availability and ordering, and not on execution, Celestia provides a more cost-effective solution for rollups compared to using traditional, monolithic chains. * **Increased Transaction Throughput and Reduced Costs**: The architecture designed by Celestia allows for increased transaction throughput while also reducing the costs associated with transactions, beneficial for applications needing high on-chain data throughput. #### Avail DA Avail DA is a cutting-edge data availability layer designed to support the next generation of trust-minimized applications and sovereign rollups. It enables light clients to verify data availability efficiently via peer-to-peer sampling, simplifies blockchain integration for developers by removing complexities related to validator sets and tokenomics, and supports multiple execution environments. Avail DA is a data availability layer that combines validity proofs with data availability sampling to enhance scalability, security, and interoperability for entire networks of blockchains built on top. Avail DA's technology: * **KZG Commitments**: A type of validity proof that makes it simple for even a light client to independently generate their own mathematically verified data availability guarantees. * **Light Clients**: Lightweight nodes that enable users to access blockchain data by downloading only essential information, making them ideal for low-resource devices while maintaining security levels close to full nodes. * **Data Availability Sampling (DAS)**: Data Availability Sampling is a technique used by light clients to verify the availability of block data without having to download the entire block. This method allows clients to confirm with high certainty (99.99%) that the data is available by sampling only a small fraction (~1%) of it. * **Erasure Coding**: A redundancy method that splits data into multiple chunks and extends them, ensuring that the original data can be reconstructed even if some chunks are missing, making it difficult for malicious actors to hide data parts. * **Multiple Execution Environments**: It is designed to be data-agnostic, supporting a variety of execution environments including EVM, WASM, and custom runtimes, which provides a versatile foundation for a broad range of blockchain applications. See more on Avail DA's [transaction life cycle](/scaling-services-rollups/data-availability/avail-da/#how-avail-da-works). ### Interoperability Layers Interoperability layers refer to frameworks or systems that enable different blockchain networks to communicate and interact with each other. These layers are crucial because they allow for the transfer of data, assets, and value between otherwise isolated blockchain ecosystems, facilitating a more integrated and functional global blockchain infrastructure. Interoperability layers are essential for the practical and widespread adoption of blockchain technology, as they allow for a more connected and efficient ecosystem where different platforms can share information and value seamlessly. #### Celer The Celer interoperability protocol is designed to connect siloed blockchain environments, offering several benefits that can significantly enhance the functionality, efficiency, and user experience across different blockchain networks. Here are some of the key benefits: * **Enhanced Scalability and Efficiency**: Celer's interoperability protocol utilizes state channel technology and other layer-2 scaling solutions to facilitate high-speed, low-cost transactions across different blockchains. This can significantly reduce the congestion and high fees associated with traditional on-chain transactions, leading to more efficient cross-chain interactions. * **Seamless Asset Transfer**: Celer enables seamless asset transfers between different blockchain networks. This interoperability allows users to move assets such as tokens or NFTs across blockchains without the need for complex and costly bridge mechanisms, promoting liquidity and asset utilization across the ecosystem. * **Generalized Inter-chain Communication**: Beyond simple asset transfers, Celer supports generalized inter-chain communication. This means that beyond transferring assets, it can also facilitate the execution of complex smart contracts and cross-chain dApps interactions, broadening the scope of possible applications and use cases. * **Enhanced Security**: Celer's approach to interoperability emphasizes security, aiming to provide secure and trust-minimized communication between different blockchains. This is achieved through innovative cryptographic methods and secure multi-party computation, reducing the risk of hacks and malicious activities associated with cross-chain operations. * **Decentralization and Trust Minimization**: By enabling direct communication between blockchains without relying heavily on centralized intermediaries, Celer promotes a more decentralized blockchain ecosystem. This minimizes trust and reduces potential points of failure, aligning with the foundational principles of blockchain technology. * **Developer and User Friendliness**: Celer provides tools and frameworks that are designed to be accessible to developers, lowering the barrier to entry for creating and deploying cross-chain applications. For users, this translates to a smoother and more integrated user experience when interacting with applications that operate across multiple blockchains. * **Network Effects and Ecosystem Growth**: By facilitating interoperability between different blockchains, Celer can help foster a more interconnected and collaborative blockchain environment. This can lead to network effects where the value and utility of each connected blockchain are enhanced, contributing to the overall growth and development of the blockchain ecosystem. #### Axelar Axelar delivers secure cross-chain communication for Web3, enabling you to build Interchain dApps that grow beyond a single chain. Secure means Axelar is built on proof-of-stake, the battle-tested approach used by Ethereum, Polygon, Cosmos, and more. Cross-chain communication means you can build a complete experience for your users that lets them interact with any asset, any application, on any chain with one click. Key benefits: * **Universal Interoperability**: Axelar is designed to provide universal interoperability, meaning it can connect any blockchain, regardless of its underlying technology or consensus mechanism. This inclusivity ensures that a wide range of blockchains, from major platforms like Ethereum and Bitcoin to newer or less common networks, can communicate and share resources. * **Decentralized Security**: Axelar employs a decentralized network of validators to secure cross-chain communication. This approach ensures that the system is not reliant on a single point of failure and aligns with the decentralized ethos of blockchain technology. The security model is designed to be robust against attacks, providing a trustworthy environment for cross-chain interactions. * **Simplicity for Developers**: Axelar is designed with a focus on developer experience, providing APIs and SDKs that abstract away the complexities of cross-chain communication. This makes it easier for developers to build and deploy decentralized applications (dApps) that can interact with multiple blockchain ecosystems, without needing to understand the intricate details of each connected network. * **Seamless Asset Transfers**: The protocol facilitates the seamless transfer of assets across different blockchains, enabling users to move cryptocurrencies, tokens, and other digital assets between networks effortlessly. This can significantly enhance liquidity across the blockchain ecosystem and open up new opportunities for users and developers alike. * **Interoperable Smart Contracts**: Axelar extends beyond simple asset transfers, enabling smart contracts on different blockchains to interact with each other. This capability allows for complex, cross-chain decentralized applications and services that can leverage the unique features of various blockchains, creating more versatile and powerful applications. * **Scalability**: The Axelar network is designed to be scalable, handling a growing volume of cross-chain transactions without significant increases in costs or delays. This scalability ensures that the network can accommodate the needs of a growing ecosystem without compromising performance. * **Ecosystem Growth and Integration**: By connecting different blockchains, Axelar facilitates a more integrated and cooperative blockchain ecosystem. This can lead to new types of applications and services, increased user adoption, and a more vibrant and diverse blockchain landscape. * **Governance and Upgradeability**: Axelar includes mechanisms for governance and network upgrades, allowing the community to propose and vote on changes to the protocol. This ensures that the network can evolve in response to new developments and challenges in the blockchain space. In summary, Axelar offers a comprehensive solution for blockchain interoperability, providing security, simplicity, and scalability. By enabling different blockchains to communicate and interact, Axelar aims to foster a more connected, efficient, and innovative blockchain ecosystem. #### Hyperlane Hyperlane is another notable player in the blockchain interoperability space, designed to enable secure and efficient communication between different blockchain networks. Its architecture and approach offer unique benefits for the interconnected blockchain ecosystem: * **Secure Messaging**: Hyperlane provides a robust infrastructure for secure, inter-chain messaging. This allows blockchains to share information and execute transactions across different networks securely, ensuring data integrity and preventing unauthorized access. * **Modularity and Flexibility**: One of the standout features of Hyperlane is its modular design, which offers significant flexibility in how it can be used. This modularity allows for the customization of security models, messaging formats, and other key components to meet the specific needs of different blockchain applications and ecosystems. * **Cross-Chain Applications**: With Hyperlane, developers can build sophisticated cross-chain applications (xApps) that can operate seamlessly across multiple blockchains. This opens up new possibilities for dApps, allowing them to leverage the unique strengths and features of various blockchains, enhancing their functionality and user experience. * **Decentralized and Trustless Operation**: Hyperlane operates in a decentralized manner, reducing reliance on central authorities or single points of failure. This aligns with the trustless nature of blockchain technology, providing a more secure and resilient framework for cross-chain interactions. * **Efficiency and Scalability**: The protocol is designed for efficiency, with a focus on minimizing transaction costs and improving throughput. This makes it more viable for applications that require high volumes of cross-chain transactions and ensures that the system can scale as the number of interconnected blockchains grows. * **Interoperability with Sovereignty**: Hyperlane respects the sovereignty of individual blockchains, allowing them to maintain their own governance and operational models while still participating in the broader interconnected ecosystem. This ensures that blockchains can remain independent and true to their original design principles while benefiting from cross-chain capabilities. * **Ecosystem Collaboration**: By facilitating easier and more secure cross-chain interactions, Hyperlane encourages collaboration between different blockchain projects and communities. This can lead to the development of new partnerships, integrations, and innovations within the blockchain space. * **User Experience**: For end-users, Hyperlane can provide a more seamless and integrated experience when interacting with applications that span multiple blockchains. This can include simpler asset transfers, unified application interfaces, and more cohesive overall interactions with blockchain-based systems. --- url: https://www.ankr.com/docs/staking-overview/ title: Ankr Staking description: Ankr Staking aims to bring the benefits of DeFi to the masses with Liquid Staking, Delegated Staking, DeFi, Bridge, Switch, and Parachain Crowdloan. source: docs/staking-overview.mdx --- # Ankr Staking :::tip If you're a developer, or a company looking to integrate Staking into your project, visit [For Developers](/staking-for-developers/overview/). ::: Ankr Staking aims to bring the benefits of DeFi to the masses with Liquid Staking, Delegated Staking, DeFi, Bridge, Switch, and Parachain Crowdloan.
## Liquid Staking [Liquid Staking](/liquid-staking/overview/) extends the Staking experience to solve the problem of loss of liquidity and capital inefficiency. When assets are staked, they are usually locked up on-chain helping to maintain the network. However, Liquid Staking provides instant access to Liquid Staking tokens that are equivalent in value to the stake in a 1:1 ratio. These portable Liquid Staking tokens, such as ankrPOL, ankrETH, and more, can be utilized on additional DeFi platforms to earn further rewards or instantly swap them for other assets. The clear benefits of Ankr Liquid Staking are: * Minimum commitment costs * Immediate access to liquidity * Transfer of risks to Ankr experts ## Delegated Staking [Delegated Staking](/delegated-staking/ankr/overview/) extends the Liquid Staking experience to make it more decentralized and transparent. Instead of relying solely on a limited subset of validators, users will be able to choose from a larger range of validators to stake with, and validators will be able to choose incentives and their amount to stimulate users to stake with them. This is a next step towards Ankr 2.0. ## DeFi [Ankr DeFi](/defi/overview/) features a cross-chain dashboard with trading and yield opportunities for Liquid Staking tokens and assets on different platforms. ## Bridge [Ankr Bridge](/bridge/overview/) enables bridging assets between networks for users to bring their Liquid Staking Tokens somewhere where they may get exciting yield opportunities. Ankr Bridge is secured with ECDSA cryptography and a multi-party computation based Threshold Signature Scheme. This ensures that private keys are never exposed whilst mitigating against any single point of failure. ## Switch [Ankr Switch](/switch/overview/) enables the exchange of Liquid Staking tokens: between reward earning tokens and reward bearing tokens for the same asset. ## Parachain Liquid Crowdloan [Parachain Liquid Crowdloan](/liquid-crowdloan/overview/) provides benefits similar to Staking and allows users to: 1. Bond DOT/KSM: users bond DOT or KSM to a Polkadot project during a Parachain Slot Auction. 2. Locked Liquidity: if the project wins a slot, the bonded DOT or KSM is inaccessible. 3. Attain Instant Liquidity: however, Parachain Liquid Staking tokens can be instantly obtained. These are portable and usable elsewhere. Token rewards from the winning project are distributed to Parachain Liquid Crowdloan token holders automatically. --- url: https://www.ankr.com/docs/whats-new/ title: What's New description: As part of our ongoing infrastructure optimization, a number of chains are transitioning from the Public to the Freemium service plan. To interact with these. source: docs/whats-new.mdx --- # What's New ## Free APIs via sign in As part of our ongoing infrastructure optimization, a number of chains are transitioning from the Public to the Freemium service plan. To interact with these chains, you will need to sign in on the Web3 API platform. This change will help us ensure a higher level of security, prevent abuse, and improve the overall quality of service. It is designed to maintain a reliable platform for all users, ensuring fair and secure usage of our API endpoints. **The list of chains**: `Aptos`, `Arbitrum`, `Arbitrum Nova`, `Avalanche`, `Base`, `BNB Smart Chain`, `Bitcoin`, `Ethereum`, `Gnosis`, `Harmony`, `IoTeX`, `Moonbeam`, `Nervos`, `Polygon`, `Rollux`, `Sei`, `Solana`, `Sui`, `Syscoin`, `TON`, `Optimism`. **Chains availability on various service plans**: With the latest updates, we have differentiated API access for different audiences, labeling the corresponding chain groups for quick reference. * **Premium Only**: As the label suggests, these chains are available only to Premium users. Sign-in is required to use them, and blockchain interactions are served under the corresponding [Pricing](/rpc-service/pricing/). * **Freemium/Premium**: With the chains labeled this way, you can sign in and start interacting with blockchains for free, with limited Freemium functionality. Alternatively, you can always opt in to use superior rate limits and other robust features available for [Premium users](/rpc-service/service-plans/#feature-list). * **No label**: These chains can be interacted with immediately by Public users and do not require signing in, as long as your rate limit and feature requirements are within [Public limits](/rpc-service/service-plans/#feature-list). Nevertheless, they can also serve both Freemium and Premium traffic, which will require sign in or corresponding [Premium plan options](/rpc-service/service-plans/#charging-models). --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/0g/ title: 0G description: 0G Chain is a highly scalable, AI-optimized L1 blockchain designed to meet the needs of data-heavy applications. 30 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/0g/index.mdx --- # 0G
> 0G API is available on [Web3 API platform](https://www.ankr.com/rpc/0g). 0G Chain is a highly scalable, AI-optimized L1 blockchain designed to meet the needs of data-heavy applications. Built with a modular architecture, it allows for the independent optimization of key components like consensus, execution, and storage — making it ideal for AI-driven workflows. 0G is fully EVM-compatible, so decentralized applications (dApps) already deployed on other L1 or L2 chains (such as Ethereum or rollups) can easily leverage 0G's products without needing to migrate entirely. 0G Chain supports a data availability network, distributed storage network, and AI compute network. All of these networks integrate with 0G Chain's highly scalable consensus network, built to handle massive data volumes suitable for AI. In order for your Web3 application to interact with 0G — either by reading blockchain data or sending transactions to the network — it must connect to an 0G node. Developers interact with the blockchain using the methods provided by the API. We support the following networks and protocols for 0G: * [EVM JSON-RPC API](/rpc-service/chains/chains-api/0g/#evm-json-rpc-methods) * [Tendermint JSON-RPC/REST API](/rpc-service/chains/chains-api/0g/#tendermint-json-rpcrest-methods) * [Beaconkit REST API](/rpc-service/chains/chains-api/0g/#beaconkit-rest-methods) Responses come in [JSON format](https://www.json.org/json-en.html). ## EVM JSON-RPC methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/0g/methods/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/0g/methods/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/0g/methods/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/0g/methods/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/0g/methods/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/0g/methods/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/0g/methods/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/0g/methods/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/0g/methods/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/0g/methods/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/0g/methods/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/0g/methods/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/0g/methods/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/0g/methods/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/0g/methods/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/0g/methods/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/0g/methods/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/0g/methods/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/0g/methods-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/0g/methods-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/0g/methods-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/0g/methods-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Tendermint JSON-RPC/REST methods **Info — node information**: * [`blockchain`](/rpc-service/chains/chains-api/0g/information/#blockchain) — retrieves block headers (max: 20) for `minHeight <= height <= maxHeight`. * [`block`](/rpc-service/chains/chains-api/0g/information/#block) — retrieves a block at a specified height. * [`block_by_hash`](/rpc-service/chains/chains-api/0g/information/#block_by_hash) — retrieves a block by hash. * [`block_results`](/rpc-service/chains/chains-api/0g/information/#block_results) — retrieves block results at a specified height. * [`commit`](/rpc-service/chains/chains-api/0g/information/#commit) — retrieves commit results at a specified height. * [`validators`](/rpc-service/chains/chains-api/0g/information/#validators) — retrieves a validator set at a specified height. * [`genesis_chunked`](/rpc-service/chains/chains-api/0g/information/#genesis_chunked) — retrieves the Genesis in multiple chunks. * [`dump_consensus_state`](/rpc-service/chains/chains-api/0g/information-p2/#dump_consensus_state) — retrieves consensus state. * [`consensus_state`](/rpc-service/chains/chains-api/0g/information-p2/#consensus_state) — retrieves consensus state. * [`consensus_params`](/rpc-service/chains/chains-api/0g/information-p2/#consensus_params) — retrieves consensus parameters. * [`unconfirmed_txs`](/rpc-service/chains/chains-api/0g/information-p2/#unconfirmed_txs) — retrieves the list of unconfirmed transactions. * [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/0g/information-p2/#num_unconfirmed_txs) — retrieves data about unconfirmed transactions. * [`tx_search`](/rpc-service/chains/chains-api/0g/information-p2/#tx_search) — searches for transactions. * [`block_search`](/rpc-service/chains/chains-api/0g/information-p2/#block_search) — searches for blocks by `BeginBlock` and `EndBlock` events. * [`tx`](/rpc-service/chains/chains-api/0g/information-p2/#tx) — retrieves transactions by hash. **Tx — transactions broadcast information**: * [`broadcast_tx_sync`](/rpc-service/chains/chains-api/0g/information-p3/#broadcast_tx_sync) — returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. * [`broadcast_tx_async`](/rpc-service/chains/chains-api/0g/information-p3/#broadcast_tx_async) — returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. * [`broadcast_tx_commit`](/rpc-service/chains/chains-api/0g/information-p3/#broadcast_tx_commit) — returns with the responses from `CheckTx` and `DeliverTx`. * [`check_tx`](/rpc-service/chains/chains-api/0g/information-p3/#check_tx) — checks the transaction without executing it. **ABCI — ABCI info**: * [`abci_info`](/rpc-service/chains/chains-api/0g/information-p3/#abci_info) — retrieves info about the application. * [`abci_query`](/rpc-service/chains/chains-api/0g/information-p3/#abci_query) — queries the application for some information. --- ## Beaconkit REST methods * [`GET /eth/v1/node/version`](/rpc-service/chains/chains-api/0g/information-p3/#get-ethv1nodeversion) — retrieves node version info. * [`GET /eth/v2/debug/beacon/states/{state_id}`](/rpc-service/chains/chains-api/0g/information-p3/#get-ethv2debugbeaconstatesstate_id) — retrieves debug info. ## Methods ### Methods - [`web3_clientVersion`](/rpc-service/chains/chains-api/0g/methods/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/0g/methods/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/0g/methods/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/0g/methods/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/0g/methods/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/0g/methods/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/0g/methods/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/0g/methods/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/0g/methods/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/0g/methods/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/0g/methods/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/0g/methods/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/0g/methods/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/0g/methods/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/0g/methods/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/0g/methods/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/0g/methods/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/0g/methods/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/0g/methods-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/0g/methods-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/0g/methods-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/0g/methods-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/0g/methods-p3/#eth_getlogs) ### Information, Transactions, ABCI, Methods - [`blockchain`](/rpc-service/chains/chains-api/0g/information/#blockchain) - [`block`](/rpc-service/chains/chains-api/0g/information/#block) - [`block_by_hash`](/rpc-service/chains/chains-api/0g/information/#block_by_hash) - [`block_results`](/rpc-service/chains/chains-api/0g/information/#block_results) - [`commit`](/rpc-service/chains/chains-api/0g/information/#commit) - [`validators`](/rpc-service/chains/chains-api/0g/information/#validators) - [`genesis_chunked`](/rpc-service/chains/chains-api/0g/information/#genesis_chunked) - [`dump_consensus_state`](/rpc-service/chains/chains-api/0g/information-p2/#dump_consensus_state) - [`consensus_state`](/rpc-service/chains/chains-api/0g/information-p2/#consensus_state) - [`consensus_params`](/rpc-service/chains/chains-api/0g/information-p2/#consensus_params) - [`unconfirmed_txs`](/rpc-service/chains/chains-api/0g/information-p2/#unconfirmed_txs) - [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/0g/information-p2/#num_unconfirmed_txs) - [`tx_search`](/rpc-service/chains/chains-api/0g/information-p2/#tx_search) - [`block_search`](/rpc-service/chains/chains-api/0g/information-p2/#block_search) - [`tx`](/rpc-service/chains/chains-api/0g/information-p2/#tx) - [`broadcast_tx_sync`](/rpc-service/chains/chains-api/0g/information-p3/#broadcast_tx_sync) - [`Parameters`](/rpc-service/chains/chains-api/0g/methods/#parameters) - [`broadcast_tx_async`](/rpc-service/chains/chains-api/0g/information-p3/#broadcast_tx_async) - [`broadcast_tx_commit`](/rpc-service/chains/chains-api/0g/information-p3/#broadcast_tx_commit) - [`check_tx`](/rpc-service/chains/chains-api/0g/information-p3/#check_tx) - [`abci_info`](/rpc-service/chains/chains-api/0g/information-p3/#abci_info) - [`abci_query`](/rpc-service/chains/chains-api/0g/information-p3/#abci_query) - [`GET /eth/v1/node/version`](/rpc-service/chains/chains-api/0g/information-p3/#get-ethv1nodeversion) - [`GET /eth/v2/debug/beacon/states/{state_id}`](/rpc-service/chains/chains-api/0g/information-p3/#get-ethv2debugbeaconstatesstate_id) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/0g/information-p2/ title: 0G — Information, Transactions, ABCI, Methods (2/3) source: docs/rpc-service/chains/chains-api/0g/information-p2.mdx --- # 0G — Information, Transactions, ABCI, Methods (2/3) > API reference for [0G](/rpc-service/chains/chains-api/0g/). [All methods ->](/rpc-service/chains/chains-api/0g/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/0g/information/) · 2 · [3](/rpc-service/chains/chains-api/0g/information-p3/) ## Information ### `dump_consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns A complete consensus state. See the [Vote string description](https://pkg.go.dev/github.com/tendermint/tendermint/types?tab=doc#Vote.String). #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "dump_consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/dump_consensus_state ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "round_state": { "height": "13211550", "round": 0, "step": 1, "start_time": "2024-12-23T13:24:44.738595111Z", "commit_time": "2024-12-23T13:24:39.738595111Z", "validators": { "validators": [ { "address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "GFeC1pZ7fslcucbIsx44x9c0MPeJlLRb+WGG/wGflbw=" }, "voting_power": "21656144", "proposer_priority": "-52387076" } ], "proposer": { "address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "GFeC1pZ7fslcucbIsx44x9c0MPeJlLRb+WGG/wGflbw=" }, "voting_power": "21656144", "proposer_priority": "-52387076" } }, "proposal": null, "proposal_block": null, "proposal_block_parts": null, "locked_round": -1, "locked_block": null, "locked_block_parts": null, "valid_round": -1, "valid_block": null, "valid_block_parts": null, "votes": [ { "round": 0, "prevotes": [ "nil-Vote", "nil-Vote" ], "prevotes_bit_array": "BA{88:________________________________________________________________________________________} 0/117388861 = 0.00", "precommits": [ "nil-Vote", "nil-Vote" ], "precommits_bit_array": "BA{88:________________________________________________________________________________________} 0/117388861 = 0.00" } ], "commit_round": -1, "last_commit": { "votes": [ "Vote{0:279EAD5DD43F 13211549/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 2F31A8E1F581 8B6CEAA65010 @ 2024-12-23T13:24:39.500074271Z}", "Vote{1:BD417EAD7FF9 13211549/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 2F31A8E1F581 31E4D1FFA299 @ 2024-12-23T13:24:39.553047425Z}" ], "votes_bit_array": "BA{88:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} 117388861/117388861 = 1.00", "peer_maj_23s": {} }, "last_validators": { "validators": [ { "address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "GFeC1pZ7fslcucbIsx44x9c0MPeJlLRb+WGG/wGflbw=" }, "voting_power": "21656144", "proposer_priority": "43345641" } ], "proposer": { "address": "5AA4440350230D5BB8CDFE6A5726656B4FC7DC6E", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "BM16Wru6ELaZXCyKZAH5WGxg5YiMYw2WlcpBnfdbnQg=" }, "voting_power": "162210", "proposer_priority": "-63939004" } }, "triggered_timeout_precommit": false }, "peers": [ { "node_address": "f8d5e677f1f68f8bd798752595371817f61dc532@178.128.156.131:26656", "peer_state": { "round_state": { "height": "13211550", "round": 0, "step": 1, "start_time": "2024-12-23T13:24:43.982077345Z", "proposal": false, "proposal_block_part_set_header": { "total": 0, "hash": "" }, "proposal_block_parts": null, "proposal_pol_round": -1, "proposal_pol": "________________________________________________________________________________________", "prevotes": "________________________________________________________________________________________", "precommits": "________________________________________________________________________________________", "last_commit_round": 0, "last_commit": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "catchup_commit_round": -1, "catchup_commit": "________________________________________________________________________________________" }, "stats": { "votes": "14173", "block_parts": "45" } } } ] } } ``` --- ### `consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns Consensus state results. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/consensus_state ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "round_state": { "height/round/step": "13213043/0/6", "start_time": "2024-12-23T15:53:01.989949876Z", "proposal_block_hash": "78CB001605FE99454B82944CB47D65D093629DDD38454260E7B7980874A6A5D7", "locked_block_hash": "78CB001605FE99454B82944CB47D65D093629DDD38454260E7B7980874A6A5D7", "valid_block_hash": "78CB001605FE99454B82944CB47D65D093629DDD38454260E7B7980874A6A5D7", "height_vote_set": [ { "round": 0, "prevotes": [ "Vote{0:279EAD5DD43F 13213043/00/SIGNED_MSG_TYPE_PREVOTE(Prevote) 78CB001605FE 619E4C697B2C @ 2024-12-23T15:53:02.160332603Z}", "Vote{1:BD417EAD7FF9 13213043/00/SIGNED_MSG_TYPE_PREVOTE(Prevote) 78CB001605FE 82F0E2036082 @ 2024-12-23T15:53:02.374084828Z}" ], "prevotes_bit_array": "BA{88:xxxxxxxxxx__xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxx_xxxxxxxxxxxxxxx} 110520639/117416870 = 0.94", "precommits": [ "Vote{0:279EAD5DD43F 13213043/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 78CB001605FE 92F18B4F01EA @ 2024-12-23T15:53:02.551832113Z}", "nil-Vote", "Vote{2:BFA6235D9556 13213043/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 78CB001605FE 0FB040BC54A6 @ 2024-12-23T15:53:02.563127503Z}", "nil-Vote" ], "precommits_bit_array": "BA{88:x_x_x________x_x__x_xx____x__xxxx___x_xx_xx_xxx_xxx__x___xxx__xx_xxx__x___x___xx___xxxx_} 52462972/117416870 = 0.45" }, { "round": 1, "prevotes": [ "nil-Vote", "nil-Vote" ], "prevotes_bit_array": "BA{88:________________________________________________________________________________________} 0/117416870 = 0.00", "precommits": [ "nil-Vote", "nil-Vote" ], "precommits_bit_array": "BA{88:________________________________________________________________________________________} 0/117416870 = 0.00" } ], "proposer": { "address": "026D3C349592A1A1D6534744106D7B0453E3C565", "index": 29 } } } } ``` --- ### `consensus_params` > Retrieves consensus parameters. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be returned. #### Returns Consensus parameters results. #### Request parameters ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_params", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/consensus_params?height=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block_height": "1", "consensus_params": { "block": { "max_bytes": "200000", "max_gas": "20000000" }, "evidence": { "max_age_num_blocks": "1000000", "max_age_duration": "6000000000000000", "max_bytes": "50000" }, "validator": { "pub_key_types": [ "ed25519" ] }, "version": { "app": "0" } } } } ``` --- ### `unconfirmed_txs` > Retrieves the list of unconfirmed transactions. #### Parameters
* `limit` (integer; default: 30; max: 100): the maximum number of unconfirmed transactions to return. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unconfirmed_txs", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/unconfirmed_txs?limit=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "n_txs": "2", "total": "4", "total_bytes": "2012", "txs": [ "CoYBCoMBCiQva2F2YS5wcmljZWZlZWQudjFiZXRhMS5Nc2dQb3N0UHJpY2USWwora2F2YTE5cmprNXFtbXd5d256ZmNjd3p5bjAyanl3Z3B3anFmNjBhZmo5MhILdXNkeDp1c2Q6MzAaEjcxODkzMDAwMDAwMDAwMDA2OSILCPHVsLsGEMCO5TcSagpSCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohA31VSgUTeXh1kcCYwNrx04+4ItSC8M6wuKV96JLq9G0pEgQKAggBGJHBFxIUCg4KBXVrYXZhEgU1MDAwMBDwkwkaQKvIEvEmlpm5Xuw9on+NLx53kPmvw3QI2Fic1/IDowITWeN8bbGHdomSC1cdnrtZ8rxaBUnfpLM7Yisnk4cqcl4=", "CoQBCoEBCiQva2F2YS5wcmljZWZlZWQudjFiZXRhMS5Nc2dQb3N0UHJpY2USWQora2F2YTF1ZWFrN256ZXNtM3BuZXY2bG5ncDZsZ2swcnkwMmRqejhwanBjZxIIdXNkeDp1c2QaEjczMzg5OTk5OTk5OTk5OTk5NyIMCLSAp7sGEMCR+NQCEmkKUgpGCh8vY29zbW9zLmNyeXB0by5zZWNwMjU2azEuUHViS2V5EiMKIQJh+Rd6tFqIDMHzDY2LUqIfd6iQjaxEk7kCf/PggVVILxIECgIIARj78XASEwoNCgV1a2F2YRIENTAwMBDwkwkaQNH1d9rV6P0l8EktESQ6pSg1htx5I8FNNit3kfg/bOXqJ0c5PxTgBfeitv167yLxWxyXBWaJueQGMVh8KOHi1W0=" ] } } ``` --- ### `num_unconfirmed_txs` > Retrieves data on unconfirmed transactions. #### Parameters
None. #### Returns The status of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "num_unconfirmed_txs", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/num_unconfirmed_txs ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "n_txs": "0", "total": "0", "total_bytes": "0", "txs": null } } ``` --- ### `tx_search` > Searches for transactions with their results. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height and txhash. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx_search", "params": { "query": "tx.height=13225811", "prove": true, "page": "1", "per_page": "5", "order_by": "desc" }, "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/tx_search?query=tx.height%3D13225811&prove=true&page=1&per_page=5&order_by=desc ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "txs": [], "total_count": "0" } } ``` --- ### `block_search` > Searches for blocks by `BeginBlock` and `EndBlock` events. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height. #### Returns The list of paginated blocks matching the search criteria. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_search", "params": { "query": "block.height=13225811", "page": "1", "per_page": "10", "order_by": "desc" }, "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/block_search?query=block.height%3D13225811&page=1&per_page=10&order_by=desc ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blocks": [ { "block_id": { "hash": "F054E236608C0E65DFE9231F9332D7F54F1A282D4C2C3DA6B35FAED5D4EE9169", "parts": { "total": 1, "hash": "4F02FC67A8503D1D5428EE6D1209FC5BC1BB67382DBDB53F38C3FD0783B2FC8A" } }, "block": { "header": { "version": { "block": "11" }, "chain_id": "0g_2222-10", "height": "13225811", "time": "2024-12-24T12:58:00.512093988Z", "last_block_id": { "hash": "304F208093FA799825FA221EB9B517B73A0879E6D9B971DD28FDF96F564EEC7C", "parts": { "total": 1, "hash": "4158FCF92A13A2A5F8D466BD0189EB466DDD5D1FCA7ACF0E40069A8A0B775792" } }, "last_commit_hash": "CCFD88F120E554844A8DED71E1DAF3FA8089B1D7CFDC276917C8A5E34FDE6DBD", "data_hash": "2E1EC915F83863741270A49157E2787F5F34F3B0E2E67BB1527368F8BA05D1CD", "validators_hash": "7C3AABDFAA6A53BF1C63DC025201337CA9CB3F7DE8A51EA0C54B2CEBDCEF6E39", "next_validators_hash": "7C3AABDFAA6A53BF1C63DC025201337CA9CB3F7DE8A51EA0C54B2CEBDCEF6E39", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "2AA5FE48061351DF5DD4F79C25A902466C31975199BEE286FE294273DB4FBF4A", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07" }, "data": { "txs": [ "CrIHCv4GCh8vZXRoZXJtaW50LmV2bS52MS5Nc2dFdGhlcmV1bVR4EtoGCpMGChovZXRoZXJtaW50LmV2bS52MS5MZWdhY3lUeBL0BQiXvhMSDDEwMTAwMDAwMDAwMBjJ9hgiKjB4ODE1ZjI3QTU2MTcxMUE2QjA0YmNFM0FhNjVjNUQ5QTE5NDVBNWVFQioBMDLkBHgmYbwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGdqr9oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA..." ] }, "evidence": { "evidence": [] }, "last_commit": { "height": "13225810", "round": 0, "block_id": { "hash": "304F208093FA799825FA221EB9B517B73A0879E6D9B971DD28FDF96F564EEC7C", "parts": { "total": 1, "hash": "4158FCF92A13A2A5F8D466BD0189EB466DDD5D1FCA7ACF0E40069A8A0B775792" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07", "timestamp": "2024-12-24T12:58:00.458392974Z", "signature": "LU+rS0/HPXczwL9jxzAWYHSck0ORgzD9MGLXx6POcKO2XpNnHRG8/QsxDSs4Ouy3hO9AAiG0RNUWBrVlgjlpBg==" } ] } } } ], "total_count": "1" } } ``` --- ### `tx` > Retrieves a transaction by hash. #### Parameters
* `hash` (string; required): a hash of a transaction to retrieve. * `prove` (boolean; default: false): adds proofs of the transaction's inclusion in the block. #### Returns Transaction info. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx", "params": ["4B6D8FEA3786BFC6152EAEA791C4DAF00C41E93DAD56A7230B565179CD29CAA1", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/tx?hash=4B6D8FEA3786BFC6152EAEA791C4DAF00C41E93DAD56A7230B565179CD29CAA1&prove=true ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "hash": "4B6D8FEA3786BFC6152EAEA791C4DAF00C41E93DAD56A7230B565179CD29CAA1", "height": "12345", "index": 2, "tx_result": { "code": 0, "log": "Success", "events": [ { "type": "transfer", "attributes": [ { "key": "sender", "value": "0g1xyz..." }, { "key": "recipient", "value": "0g1abc..." }, { "key": "amount", "value": "10000u0g" } ] } ] }, "tx": "BASE64_ENCODED_TX", // The transaction itself in Base64 format "proof": { "root_hash": "0xABC123...", "data": "BASE64_ENCODED_PROOF", "proof": { /* Detailed proof structure */ } } } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/0g/information-p3/ title: 0G — Information, Transactions, ABCI, Methods (3/3) source: docs/rpc-service/chains/chains-api/0g/information-p3.mdx --- # 0G — Information, Transactions, ABCI, Methods (3/3) > API reference for [0G](/rpc-service/chains/chains-api/0g/). [All methods ->](/rpc-service/chains/chains-api/0g/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/0g/information/) · [2](/rpc-service/chains/chains-api/0g/information-p2/) · 3 ## Transactions ### `broadcast_tx_sync` > Returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. ### Parameters
* `tx` (string; required): the signed transaction, encoded as Base64. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_sync", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/broadcast_tx_sync?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "code": 0, "data": "", "log": "transaction successfully broadcasted", "hash": "0xABC123..." // The transaction hash } } ``` --- ### `broadcast_tx_async` > Returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). 3. A node is offline. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the Base64-encoded signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_async", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/broadcast_tx_async?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "code": 0, "data": "", "log": "", "hash": "0xABC123..." // Transaction hash } } ``` --- ### `broadcast_tx_commit` > Returns with the responses from `CheckTx` and `DeliverTx`. :::warning Use only for testing and development. In production, use `BroadcastTxSync` or `BroadcastTxAsync`. You can subscribe for the transaction result using JSON-RPC via a websocket (see [CometBFT docs](https://docs.cometbft.com/v0.34/core/subscription.html)). ::: :::tip CONTRACT: only returns error if `mempool.CheckTx()` errs or if we timeout waiting for tx to commit. If `CheckTx` or `DeliverTx` fails, no error will be returned, but the result will contain a non-OK ABCI code. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. ::: #### Parameters
* `tx` (string; required): the Base64-encoded signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_commit", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/broadcast_tx_commit?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "check_tx": { "code": 0, "data": "", "log": "Transaction checked successfully" }, "deliver_tx": { "code": 0, "data": "", "log": "Transaction delivered successfully", "events": [ { "type": "transfer", "attributes": [ { "key": "sender", "value": "0g1xyz..." }, { "key": "recipient", "value": "0g1abc..." }, { "key": "amount", "value": "10000u0g" } ] } ] }, "hash": "0xABC123...", "height": "12345" } } ``` --- ### `check_tx` > Checks the transaction without executing it. The transaction won't be added to the mempool. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the Base64-encoded signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "check_tx", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/check_tx?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "code": 0, "data": "", "log": "Transaction is valid", "events": [ { "type": "transfer", "attributes": [ { "key": "sender", "value": "0g1xyz..." }, { "key": "recipient", "value": "0g1abc..." }, { "key": "amount", "value": "10000u0g" } ] } ] } } ``` --- ## ABCI ### `abci_info` > Retrieves application info. #### Parameters
None. #### Returns Application info. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_info", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/abci_info ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "response": { "data": "0g", "version": "0.27.0", "app_version": "8", "last_block_height": "13239641", "last_block_app_hash": "wLirVXfBEeq0jZcrshBGWS7AGN19N7p8aQqMAiaIl+I=" } } } ``` --- ### `abci_query` > Queries the application for particular information. #### Parameters
* `path` (string; required): a path to the data ("/a/b/c"). * `data` (string; required): the hex-encoded data. * `height` (integer; default: 0): the height (0 means latest). * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. #### Returns Particular info according to the query submitted. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_query", "params": ["a/b/c", "the_data", "1", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/blockchain?path=%2Fa%2Fb%2Fc&data=the_data&height=1&prove=true ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "response": { "code": 0, "log": "", "info": "", "index": -1, "key": "0x6b61766131387879377a...", "value": "0x123456789abcdef", // Hex-encoded value "proofOps": null, "height": "12345", "codespace": "" } } } ``` --- ## `GET /eth/v1/node/version` > Retrieves node version info. ### Parameters None. ### Request example ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_beaconkit/eth/v1/node/version ``` ### Response example ```json { "data": { "version": "1.1.0" } } ``` --- ## `GET /eth/v2/debug/beacon/states/{state_id}` > Retrieves debug info. Returns a quantity of debug information, including the following: * Validator root. * Latest beacon and execution chain block headers. * Various root hashes. * The node's understanding of the validator set voting power, slashing status. ### Parameters * `state_id` (string, hex; path): ID for the state to query. Can be one of the following: * A block root (32-byte hex string, e.g., 0xabc123...). * A state root (32-byte hex string). * A block ID alias such as: * `head` – the latest known state. * `genesis` – the genesis state. * `finalized` – the latest finalized state. * `justified` – the latest justified state. ### Request example ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_beaconkit/eth/v2/debug/beacon/states/head ``` ### Response example ```json { "version": "electra", "execution_optimistic": false, "finalized": true, "data": { "genesis_validators_root": "0xc22d6f6c6672c738e5696fa0e43c0aa0acf25ec09bd301b68036d61eb79c2daf", "slot": "0x1c3b08", "fork": { "previous_version": "0x05000000", "current_version": "0x05000000", "epoch": "0x0" }, "latest_block_header": { "slot": "0x1c3b08", "proposer_index": "0x0", "parent_block_root": "0x7ce89c85094fa830a5cf6649621000400d3a882240fa222ddd0f021f0bcbb42a", "state_root": "0x0000000000000000000000000000000000000000000000000000000000000000", "body_root": "0xa8e552f88c09ff0f7394b82041ab25a712cbe73d9e646190ac5330d50073d21f" }, "block_roots": [ "0x2f3a417b224d5262596c7d4dfa696abaf3800ccf7593cc749952f88e3948c7cd", "0x7f40aa67f38b9eb7dc36a9dd5f6cdf6a3e9a94a206084240f81345100708290f", "0xa703243bff9736a2154d4fbb158bfc0317a8c52af58516ae6844a17d497d739d", "0x0d9701998fbf960cebe13cdb89647595334db848c2a326bd39cce67815e42adb", "0x6a705f37d7fccfe3b7ae202bd22840c3c70f7138a366f3506fa533da4f26dea7", "0x7bc0ea29114f8a334cf28eb1de33443de5214810fbe5c5b49a07d4878c5342ff", "0xf3875ec20169e7f48c576a7076ab04a4dac25c15a7c80c721defcc10851af802", "0x7ce89c85094fa830a5cf6649621000400d3a882240fa222ddd0f021f0bcbb42a" ], "state_roots": [ "0xde5cf944fec524820e3d4d9174ca5b42855ebb9ad89104d92bc5001c4a9b9e32", "0xac2e45403552d2b2372950fea027f0c826b4d09b8af1bafba14be45347b1e69a", "0x5a5663ca9e37572174e5957e1260c221aca96384a3b441de8491de58afd6e44f", "0x593206fbb5b8f1ae140c4041d8ab865cb5afb7fccc7da019ce2834ce9f11bb0a", "0x39262683ed866217509ec6bd75b655c8380b42874d8b1d1eb5c40ead206ef700", "0x5dc2e2b8c9f04cea3e5574aefca4365d2a920d90c9cdad3eb4d5adee26fec217", "0x8a048f206b906dddb5c0144e2d6248b32ed5e593ef1494f9d0e9141a19cc5862", "0x6cede03f993b5ee611cea35969a54f655693f8004fba4ab7e3740ffd5d1b9cbc" ], "eth1_data": { "depositRoot": "0xa14b8fd2b3468db5bc151c63cf07b85bf774bfa94cc45e4bd4c7d5f450888a79", "depositCount": "0x0", "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" }, "eth1_deposit_index": 7, "latest_execution_payload_header": { "parentHash": "0x812d076cc7ea828fbb4a93a23db0b68e0e952ced2e56eaaadff43a48e1ca2337", "feeRecipient": "0x0000000000000000000000000000000000000001", "stateRoot": "0x115cfcd4e912feb47ca34a490b02f1a71fea4dd402893ed62385bc0688d1f26a", "receiptsRoot": "0xc1e4e11c4d71733acebe11c2ea4c179267e56838eefbec0cd2609500010f66bd", "logsBloom": "0x1201000014800000100006808228400420c010020100800102000110400020104300c0004008010000100004010000092010691000202040020140000028800000002040080000094888010804000800400040800400050002080000000000c030022800024100020800000020040c0200080100000c8008010880308408002000000010000420020020040b02840000900080021100040a00041110200004000e001210009026000b0a100000040004113020200801000944220000440440100408200640000401200004000200000004000002f4100200922000080101280080d80c0880048400000000001c00000020a0200008280040002000084000c001", "prevRandao": "0x73ca1a22bd4c673a6a320736f17e462c01f024303d6b74bd7dadd78296500348", "blockNumber": "0x1c3b08", "gasLimit": "0x2255100", "gasUsed": "0x4f71d5", "timestamp": "0x6848429c", "extraData": "0xd883010f0b846765746888676f312e32332e38856c696e7578", "baseFeePerGas": "9", "blockHash": "0xf43ec3c5eb64cb5c205af34fc90675117f6ad9ed1b8453220e77d7d424a2952e", "transactionsRoot": "0xb6577e8b117a399b7ef1a8b25080c4601f01cd9ccc5bd2fc02388ef4deb37d73", "withdrawalsRoot": "0x0145cc91e1ba724070abab6da58080fc905c13e071e17882988043e70efe0988", "blobGasUsed": "0x0", "excessBlobGas": "0x0" }, "validators": [ { "pubkey": "0xa21978649e2dca81ff5b5a9c1206ff28d86f55debf3cf0e47ed0354a168ffcdbf14ed556ad4e9260b9bdd6b0f01907a9", "withdrawalCredentials": "0x01000000000000000000000063df5c411aa90b9866e7e6082230ffbf61aeda8c", "effectiveBalance": "0x1fe5d61a000", "slashed": false, "activationEligibilityEpoch": "0x0", "activationEpoch": "0x0", "exitEpoch": "0xffffffffffffffff", "withdrawableEpoch": "0xffffffffffffffff" }, { "pubkey": "0xa68a786ea4c5b0d5b327a91d7eab6c07e69c58d301f86bc3e39991d124c7d7638efa1964089ac5d81f9f7f151a86eebf", "withdrawalCredentials": "0x01000000000000000000000063df5c411aa90b9866e7e6082230ffbf61aeda8c", "effectiveBalance": "0x773594000", "slashed": false, "activationEligibilityEpoch": "0x0", "activationEpoch": "0x0", "exitEpoch": "0xffffffffffffffff", "withdrawableEpoch": "0xffffffffffffffff" }, { "pubkey": "0x975d7a0569f6dd5560fa5054690d87f48fd99026f2336f9666f47d2c74a22611d1158d0ec3feb3511331ec4ef714f608", "withdrawalCredentials": "0x01000000000000000000000063df5c411aa90b9866e7e6082230ffbf61aeda8c", "effectiveBalance": "0x773594000", "slashed": false, "activationEligibilityEpoch": "0x0", "activationEpoch": "0x0", "exitEpoch": "0xffffffffffffffff", "withdrawableEpoch": "0xffffffffffffffff" }, { "pubkey": "0x94f8722acefe3b6d2de811a64cb4f93209bba50bb3613eaeab1d720ae09c7313c29f7de71a8718d351983c9c0c48ad09", "withdrawalCredentials": "0x010000000000000000000000565e66aa2bcb27116937983f2f208efabf620ab2", "effectiveBalance": "0xee6b28000", "slashed": false, "activationEligibilityEpoch": "0x4308", "activationEpoch": "0x4309", "exitEpoch": "0xffffffffffffffff", "withdrawableEpoch": "0xffffffffffffffff" } ], "balances": [ 2192000000000, 32000000000, 32000000000, 64000000000 ], "randao_mixes": [ "0xf3dadd64aafe134e583f639ab5b9fc650a7f0d008789b867ecb05b68e0037e2a", "0x0570972fa2cb1548eb6d3b5161d638708d89b3cf49d88727b7dd7721141325c0", "0x6761890246fa48731c333166236dd4bca041ad5ba491abf299bd94ee84faa551", "0x995cb20d32dca378b4e09f625575141ae1bac9276982971b6402dfd9bc985928", "0x995cb20d32dca378b4e09f625575141ae1bac9276982971b6402dfd9bc985928", "0x5784db6dd330eaeb0215c5de57eef097cac679458038aac95a4c6d4b2d247590", "0x7890bf970c57a80a27f1ad9e2425e9b80f5cbbb7ac1f8e3a17bbd1fd2dafadf2", "0x6ec60f8c3be68f54efe87f84c48a8474039d30922674ca1d9043eb9205eeb0df" ], "next_withdrawal_validator_index": "0x1" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/0g/information/ title: 0G — Information, Transactions, ABCI, Methods (1/3) source: docs/rpc-service/chains/chains-api/0g/information.mdx --- # 0G — Information, Transactions, ABCI, Methods (1/3) > API reference for [0G](/rpc-service/chains/chains-api/0g/). [All methods ->](/rpc-service/chains/chains-api/0g/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/0g/information-p2/) · [3](/rpc-service/chains/chains-api/0g/information-p3/) ## Information ### `blockchain` > Retrieves block headers for `minHeight <= height <= maxHeight`. At most 20 items will return for the `minHeight` or `maxHeight` parameters specified. If `maxHeight` does not yet exist, the blocks up to the current height will return. If `minHeight` does not exist (pruning), the earliest existing height will be used. #### Parameters
* `minHeight` (integer): the minimum block height to return. * `maxHeight` (integer): the maximum block height to return. #### Returns Block headers, in descending order (highest first). #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "blockchain", "params": ["1", "2"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/blockchain?minHeight=1&maxHeight=2 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "last_height": "2564978", "block_metas": [ { "block_id": { "hash": "ED3BF22DDEAABE5B194ECE00FC97B73B31D6B6E381946054ADF248FADA65FD4F", "parts": { "total": 1, "hash": "268422F8D294840DBC5B24FB031F976357E8478F72C16B66E7B7388C2429D18F" } }, "block_size": "830", "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "2", "time": "2024-06-24T07:25:41.380275895Z", "last_block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "last_commit_hash": "5148301A7ABA311392D676C3C967F299F85A1AD48D74E96AF083DA4787FF9C2D", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "21181DF7C886CEE14012C07031E55BF04428BF77979015F2869ED1EACABAD22E", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "CDFF531A3AFA255BC193D52721027366935F9BF8" }, "num_txs": "0" }, { "block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "block_size": "353", "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "1", "time": "2024-06-24T07:24:31.526533772Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD" }, "num_txs": "0" } ] } } ``` --- ### `block` > Retrieves a block at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block is to be fetched. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/blockchain?height=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "block": { "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "1", "time": "2024-06-24T07:24:31.526533772Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD" }, "data": { "txs": [] }, "evidence": { "evidence": [] }, "last_commit": { "height": "0", "round": 0, "block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "signatures": [] } } } } ``` --- ### `block_by_hash` > Retrieves a block by hash. #### Parameters
* `hash` (string; required): the Base64-encoded block hash. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_by_hash", "params": { "hash": "zNX/NZMiC0tZQVr5hlXJ9K/oIlcMzjVoXdXll630i0E=" }, "id": 1 }' ``` ```shell curl "https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/block_by_hash?hash=0xccd5ff3593220b4b59415af98655c9f4afe822570cce35685dd5e597adf48b41" ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block_id": { "hash": "CCD5FF3593220B4B59415AF98655C9F4AFE822570CCE35685DD5E597ADF48B41", "parts": { "total": 1, "hash": "24E75E2F1D225490E8890316E7E0C0D382579EF0BD8DB3DE4D41A4B92E9D9223" } }, "block": { "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "2564904", "time": "2024-12-26T12:10:47.144809998Z", "last_block_id": { "hash": "994AA199E4DCDAD2F085FE4B41D20085A0ED12BE557E88D4D9566C314D5A3486", "parts": { "total": 1, "hash": "EBF9742D10789704AC87037D05DC7F445E79DAE4AB01ACB80C99D18ED6D77D11" } }, "last_commit_hash": "2D35D340C71BD0ACDA481585236B717C98C31EDD9B7577CB4C40D23E2B16CE27", "data_hash": "080CF08012B3EDE6D0C7D9092D2B6919EA7A74C6B1F78D3732A43ABBA17A4E2C", "validators_hash": "50A4F72C26AE3EBF51D521B7BA99D263BBA2E1686CB1B710CD10EF3B81F70282", "next_validators_hash": "50A4F72C26AE3EBF51D521B7BA99D263BBA2E1686CB1B710CD10EF3B81F70282", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "8F7D4C95F3F405A5274DA79833223A8AAA50A25DF68994324296DA3EBD66F0A2", "last_results_hash": "865B5DC7B13DACE27EEFA0B4617F44946B2A3BEA44541E928859F002DCE466AF", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "CB78E69FD887112E9C3DBD9490B8A51A3EE4E318" }, "data": { "txs": [ "CssCCpcCCh8vZXRoZXJtaW50LmV2bS52MS5Nc2dFdGhlcmV1bVR4EvMBCqwBChovZXRoZXJtaW50LmV2bS52MS5MZWdhY3lUeBKNAQj/1QISAjIwGIikASIqMHg4Qjc1MmU4N2RjZTMwNjI2YTYwNjg3MzkxMWFlOGM2ODFiOUZDZTE1KgsxMDAwMDAwMDAwMDoCgdRCICKTguwyMeC0CnN5ejfXSYKT76jiJ7JyunyeFhz73HJsSiA/9hhgI3rQRu81GgjlJ5f9uTZ52PcMV22ed2S5IJlkexpCMHgyMzRmOGRkZmUxMGNhOGEyYmRhMDk2OThhN2VkODk0M2YzZmNiODNhYjgxZTE3NGNmYjg5MDg0Mzg3OTQyZWZl+j8uCiwvZXRoZXJtaW50LmV2bS52MS5FeHRlbnNpb25PcHRpb25zRXRoZXJldW1UeBIYEhYKEAoGbmV1cm9uEgY0MjAwMDAQiKQB, ..." ] }, "evidence": { "evidence": [] }, "last_commit": { "height": "2564903", "round": 0, "block_id": { "hash": "994AA199E4DCDAD2F085FE4B41D20085A0ED12BE557E88D4D9566C314D5A3486", "parts": { "total": 1, "hash": "EBF9742D10789704AC87037D05DC7F445E79DAE4AB01ACB80C99D18ED6D77D11" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD", "timestamp": "2024-12-26T12:10:47.182829723Z", "signature": "tc9915ID/XmkBPg1R+aeew0MDkGLgpTpcpo8VqpYqq17RIdwkcQ5rlZxnJuIL9G0skmOrIIXrzri2EhsudW+AQ==" } ] } } } } ``` --- ### `block_results` > Retrieves block results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block info is to be fetched. #### Returns Block results. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_results", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/block_results?height=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "height": "1", "txs_results": null, "begin_block_events": [ { "type": "coin_received", "attributes": [ { "key": "receiver", "value": "0g1m3h30wlvsf8llruxtpukdvsy0km2kum85yn938", "index": true }, { "key": "amount", "value": "38487598u0g", "index": true } ] }, { "type": "block_gas", "attributes": [ { "key": "height", "value": "1", "index": true }, { "key": "amount", "value": "0", "index": true } ] } ], "validator_updates": null, "consensus_param_updates": { "block": { "max_bytes": "200000", "max_gas": "20000000" }, "evidence": { "max_age_num_blocks": "1000000", "max_age_duration": "6000000000000000", "max_bytes": "50000" }, "validator": { "pub_key_types": [ "ed25519" ] } } } } ``` --- ### `commit` > Retrieves commit results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be fetched. #### Returns Commit results. Canonical switches from false to true for block H once block H+1 has been committed, until then it's subjective and only reflects what this node has seen so far. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "commit", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/commit?height=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "signed_header": { "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "1", "time": "2024-06-24T07:24:31.526533772Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD" }, "commit": { "height": "1", "round": 0, "block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD", "timestamp": "2024-06-24T07:25:41.481185893Z", "signature": "VtIJZ4q7ooX/Bcy5uNojugXaWSxnW2K0hYcqHdZTAhFEURZFCuwqWYKpFCr2Tu95QQR9ROrCVVC9/3UNlPTYDQ==" }, { "block_id_flag": 1, "validator_address": "", "timestamp": "0001-01-01T00:00:00Z", "signature": null } ] } }, "canonical": true } } ``` --- ### `validators` > Retrieves a validator set at a specified height. Validators are sorted by voting power. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the validator set corresponding to the latest block is to be fetched. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30; max: 100): a number of entries per page. #### Returns Commit results. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "validators", "params": ["1","1","30"], "id": 1 }' ``` ```shell curl "https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/validators?height=1&page=1&per_page=30" ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block_height": "1", "validators": [ { "address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "Cu7jYSsTcNgCfi4upLVfH1ak5OM7A4OEFHJiXQe6lR8=" }, "voting_power": "5000000", "proposer_priority": "-15000000" }, { "address": "542977517E9B10F6D51792A92BCC5F5B9C1DC74A", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "sa0J8aTS4tscdWI0On+JEhWjs+szgH49i4jhzAcyh40=" }, "voting_power": "5000000", "proposer_priority": "5000000" }, { "address": "CDFF531A3AFA255BC193D52721027366935F9BF8", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "kyAfOOxIQSLf2WXQLB8D3gqItZiOHiSeHGjfhhDtlyQ=" }, "voting_power": "5000000", "proposer_priority": "5000000" }, { "address": "FAD365F3FF137C1F70CBA4E3B3E61F4EFD2CDF02", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "ZJGhAhqDwuq1MUsUqT32mGnjlqtjlH7MHzOv8ezK7cg=" }, "voting_power": "5000000", "proposer_priority": "5000000" } ], "count": "4", "total": "4" } } ``` --- ### `genesis_chunked` > Retrieves Genesis in multiple chunks. Gets genesis document in multiple chunks to make it easier to iterate through larger genesis structures. Each chunk is produced by converting the genesis document to JSON and then splitting the resulting payload into 16MB blocks, and then Base64-encoding each block. #### Parameters
* `chunk` (integer; default: 0): a sequence number of the chunk to download. #### Returns A Genesis chunk response. #### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "genesis_chunked", "params": ["0"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/genesis_chunked?chunk=0 ``` #### Response example ```json { "jsonrpc": "2.0", "id": -1, "result": { "chunk": "0", "total": "1", "data": "eyJnZW5lc2lzX3RpbWUiOiIyMDI0LTA2LTI0VDA3OjI0OjMxLjUyNjUzMzc3MloiLCJjaGFpbl9pZCI6InpndGVuZGVybWludF8xNjYwMC0yIiwiaW5pdGlhbF9oZWlnaHQiOiIxIiwiY29uc2Vuc3VzX3BhcmFtcyI6eyJibG9jayI6eyJtYXhfYnl0ZXMiOiIyMjAyMD..." } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/0g/methods-p2/ title: 0G — Methods (2/3) source: docs/rpc-service/chains/chains-api/0g/methods-p2.mdx --- # 0G — Methods (2/3) > API reference for [0G](/rpc-service/chains/chains-api/0g/). [All methods ->](/rpc-service/chains/chains-api/0g/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/0g/methods/) · 2 · [3](/rpc-service/chains/chains-api/0g/methods-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0x83c4A688174A8d4b99b4C8A2feC124dff79D58d2", "to": "0x7E359114E9098cBeB28f4e23648a39E3Fcb915D0", "data": "0xa9059cbb000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf90000000000000000000000000000000000000000000000000000000000000064" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x705a" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xc0f659554c7d61d4259afb5b3f43de2624a7339e765ea306b5b0a332e885e724", false], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x17d7840", "gasUsed": "0xa640", "hash": "0xc0f659554c7d61d4259afb5b3f43de2624a7339e765ea306b5b0a332e885e724", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x2f3c", "parentHash": "0xd9f7ea5876fd41bb813fc9b398f6757ab92e180a6491d326d68af958a7aa8d27", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1c35", "stateRoot": "0xacd51211e93c698d8ada90fcf5cf201ae4f396007b3e5548b4f1026486662c74", "timestamp": "0x667a35ab", "totalDifficulty": "0x0", "transactions": [ "0x77ffa56267d61485b5a250b69537fd37f1c14b9dd2572e191870f2c47ad70a4d", "0xb36be3d2197fd10bcd5ce0b105f4fdb5465b69e964150fe56bb40fa7de977d1e" ], "transactionsRoot": "0xff05085919eb0bd88b94901cd035a3445853f9b74de9d91dddc6f77ed5950406", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x2F3C", false], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x17d7840", "gasUsed": "0xa640", "hash": "0xc0f659554c7d61d4259afb5b3f43de2624a7339e765ea306b5b0a332e885e724", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x2f3c", "parentHash": "0xd9f7ea5876fd41bb813fc9b398f6757ab92e180a6491d326d68af958a7aa8d27", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1c35", "stateRoot": "0xacd51211e93c698d8ada90fcf5cf201ae4f396007b3e5548b4f1026486662c74", "timestamp": "0x667a35ab", "totalDifficulty": "0x0", "transactions": [ "0x77ffa56267d61485b5a250b69537fd37f1c14b9dd2572e191870f2c47ad70a4d", "0xb36be3d2197fd10bcd5ce0b105f4fdb5465b69e964150fe56bb40fa7de977d1e" ], "transactionsRoot": "0xff05085919eb0bd88b94901cd035a3445853f9b74de9d91dddc6f77ed5950406", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x77ffa56267d61485b5a250b69537fd37f1c14b9dd2572e191870f2c47ad70a4d"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xc0f659554c7d61d4259afb5b3f43de2624a7339e765ea306b5b0a332e885e724", "blockNumber": "0x2f3c", "from": "0x83c4a688174a8d4b99b4c8a2fec124dff79d58d2", "gas": "0x5208", "gasPrice": "0x2540be400", "hash": "0x77ffa56267d61485b5a250b69537fd37f1c14b9dd2572e191870f2c47ad70a4d", "input": "0x", "nonce": "0x839", "to": "0xec33ad015cfd18e1e297fc599b9a4c2545d6f570", "transactionIndex": "0x0", "value": "0xde0b6b3a7640000", "type": "0x1", "accessList": [], "chainId": "0x40d8", "v": "0x1", "r": "0xcb9d36fad167f688c4340d2ce17c5bc8048164af619c109e989208245a5ef1cd", "s": "0x7fc1d67ad61b5ed62c67e79d2f6a867f2003cc765a17a2f5acdb785c264e9cb1" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0x41a807e984a4e73512979cbbf7ad7cf6cba17d133e87ddf9e2446ec2063c59a5", "0x0" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x41a807e984a4e73512979cbbf7ad7cf6cba17d133e87ddf9e2446ec2063c59a5", "blockNumber": "0x27226b", "from": "0xd0d01fa55e7920a3f90f18aa48f184752b3ed554", "gas": "0x5208", "gasPrice": "0x14", "hash": "0x59fcf4411839f410cc034b151fe94a50814d8cc87f1d55a3e1f3807558d6c65b", "input": "0x", "nonce": "0xaad6", "to": "0x9f218404ddc2aee210c2836361e97813a7993ca1", "transactionIndex": "0x0", "value": "0x2540be400", "type": "0x0", "chainId": "0x40d8", "v": "0x81d3", "r": "0xfdd63bb645b4ba5288fd47fb177e6cb2db157c858a0c8141f50cc7df613548d", "s": "0x2ae3fa2a8461302e0c5f1e49c6c3c448eea55758484dcdbaadfaa754724b8ec2" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x1a607bc23c79c1cd894d85a39f18c8a0cc0f6c14a0709723b3e0e4807d893df8", "blockNumber": "0x2722c4", "from": "0x83c4a688174a8d4b99b4c8a2fec124dff79d58d2", "gas": "0x17d7840", "gasPrice": "0x2540be400", "hash": "0x6900d33fc30327f12295886329b612a1e54760aa29b50f9bfedcd8bd3f70b76b", "input": "0x", "nonce": "0xc914c", "to": "0x8990e6db035f041edce0f3174d3af58251f79457", "transactionIndex": "0x0", "value": "0xde0b6b3a7640000", "type": "0x1", "accessList": [], "chainId": "0x40d8", "v": "0x0", "r": "0xeba5d9e8e61d5f7fa8d10cab4be75d545be434822e3683148b47020d3735474d", "s": "0xc84dec7945fa5517da680093ef2d876da151a72184ede6f33cec0ad840b9a2b" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/0g/methods-p3/ title: 0G — Methods (3/3) source: docs/rpc-service/chains/chains-api/0g/methods-p3.mdx --- # 0G — Methods (3/3) > API reference for [0G](/rpc-service/chains/chains-api/0g/). [All methods ->](/rpc-service/chains/chains-api/0g/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/0g/methods/) · [2](/rpc-service/chains/chains-api/0g/methods-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x74418d226679f370574a1f82635c63598a91bfdbf3638e70122ec1dc182556ad"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x10e8d7221051ed761a33b62fc7c6c012a0675467d7fadd2112a31d5c182099c9", "blockNumber": "0x158d", "contractAddress": null, "cumulativeGasUsed": "0x5208", "from": "0x83c4a688174a8d4b99b4c8a2fec124dff79d58d2", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0xda6941c4f108084dedcfb294f506c9e4eeafe2f6", "transactionHash": "0x74418d226679f370574a1f82635c63598a91bfdbf3638e70122ec1dc182556ad", "transactionIndex": "0x0", "type": "0x1" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x10e8d7221051ed761a33b62fc7c6c012a0675467d7fadd2112a31d5c182099c9", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x272328", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "fromBlock": "0x1", "toBlock": "0x65" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0x361b62b78fdbf68a0e19c2136c167f72059d2a8e", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000008873cc79c5b3b5666535c825205c9a128b1d75f1" ], "data": "0x", "blockNumber": "0x323", "transactionHash": "0xc3fdb3cd6bdb987ae99cfe7dc6f78e81a18ea9888cea584e35dc0691df104464", "transactionIndex": "0x0", "blockHash": "0x713cb11222119183f553533df5835c1610190c04c113d02fa7a2e17460a6f6a2", "logIndex": "0x0", "removed": false }, { "address": "0x85f6722319538a805ed5733c5f4882d96f1c7384", "topics": [ "0xbfeb006f16aca8eb3d9953cf44db6b11b6f3041a313875dfa18f2e9d71bd309e", "0x4a6310b386fdabbe95b1cb8fa92d362dd51a32051d1e24cf929856e0cb174a74", "0x00000000000000000000000063df5c411aa90b9866e7e6082230ffbf61aeda8c" ], "data": "0x", "blockNumber": "0x7c5", "transactionHash": "0xad9036c230807cebcfb78f11fc27824c202b68c3938233877d232ca8a739e4b3", "transactionIndex": "0x0", "blockHash": "0x73f32feb88bbd78e03809d28a22dda63f0f1862ce3bd22763efc42bf1a029cee", "logIndex": "0x0", "removed": false } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/0g/methods/ title: 0G — Methods (1/3) source: docs/rpc-service/chains/chains-api/0g/methods.mdx --- # 0G — Methods (1/3) > API reference for [0G](/rpc-service/chains/chains-api/0g/). [All methods ->](/rpc-service/chains/chains-api/0g/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/0g/methods-p2/) · [3](/rpc-service/chains/chains-api/0g/methods-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "Version dev ()\nCompiled at using Go go1.21.13 (amd64)" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5b2c76da96136d193336fad3fbc049867b8ca157da22f69ae0e4923648250acc" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "16600" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x14" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x27221a" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x83c4A688174A8d4b99b4C8A2feC124dff79D58d2", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x209e65811b7e34e40de0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x83c4A688174A8d4b99b4C8A2feC124dff79D58d2", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x83c4A688174A8d4b99b4C8A2feC124dff79D58d2", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xc9121" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x14d481f2a9bd51b3bb5ab2b64d41deb7083b9b8036969d407da673d163a09905"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x87D"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x14d481f2a9bd51b3bb5ab2b64d41deb7083b9b8036969d407da673d163a09905"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x87D"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x83c4A688174A8d4b99b4C8A2feC124dff79D58d2", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/0g/methods-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_tx_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a08231000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf9" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/allora/cosmos-rest-methods-2/ title: Allora — Cosmos REST methods source: docs/rpc-service/chains/chains-api/allora/cosmos-rest-methods-2.mdx --- # Allora — Cosmos REST methods > API reference for [Allora](/rpc-service/chains/chains-api/allora/). [All methods ->](/rpc-service/chains/chains-api/allora/#methods) ### `/cosmos/tx/v1beta1/txs` > Fetches txs by event. #### Parameters * `events` (array[string]): a list of transaction event type. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Transactions. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/tx/v1beta1/txs ``` #### Response example ```json { "txs": [ { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] } ], "tx_responses": [ { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/tx/v1beta1/txs` > Broadcasts a transaction. #### Parameters * `` (object; required): ```json { "tx_bytes": "string", "mode": "BROADCAST_MODE_UNSPECIFIED" } ``` #### Returns Broadcasted transaction. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/tx/v1beta1/txs ```` #### Response example ```json { "tx_response": { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } } ``` --- ### `/cosmos/tx/v1beta1/txs/{hash}` > Fetches a tx by hash. #### Parameters * `hash` (string, hex; required): a tx hash to query, encoded as a hex string. #### Returns Transaction. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/tx/v1beta1/txs/{hash} ``` #### Response example ```json { "tx": { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] }, "tx_response": { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/ title: Allora — Cosmos REST methods (2/4) source: docs/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2.mdx --- # Allora — Cosmos REST methods (2/4) > API reference for [Allora](/rpc-service/chains/chains-api/allora/). [All methods ->](/rpc-service/chains/chains-api/allora/#methods) > > Part 2 of 4: [1](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/) · 2 · [3](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/) · [4](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/) ## Cosmos REST methods ### `/cosmos/slashing/v1beta1/signing_infos` > Retrieves signing info of all validators. #### Parameters * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns The signing info of all validators. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/slashing/v1beta1/signing_infos ``` #### Response example ```json { "info": [ { "address": "string", "start_height": "string", "index_offset": "string", "jailed_until": "2021-01-19T06:33:32.230Z", "tombstoned": true, "missed_blocks_counter": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/slashing/v1beta1/signing_infos/{cons_address}` > Retrieves the signing info of given cons address. #### Parameters * `cons_address` (string, required): an address to query signing info for. #### Returns The signing info of all specified cons address. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/slashing/v1beta1/signing_infos/{cons_address} ``` #### Response example ```json { "val_signing_info": { "address": "string", "start_height": "string", "index_offset": "string", "jailed_until": "2021-01-19T06:34:40.106Z", "tombstoned": true, "missed_blocks_counter": "string" } } ``` --- ### Staking methods ### `/cosmos/staking/v1beta1/delegations/{delegator_addr}` > Retrieves all delegations of a given delegator address. #### Parameters * `delegator_addr` (string, required): a delegator address to query for. * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Delegations from a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/delegations/{delegator_addr} ``` #### Response example ```json { "delegation_responses": [ { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations` > Retrieves the redelegations of a given address. #### Parameters * `delegator_addr` (string, required): a delegator address to query for. * `src_validator_addr` (string): the validator address to redelegate from. * `dst_validator_addr` (string): the validator address to redelegate to. * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` `string, uint64`: a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Delegations from a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations ``` #### Response example ```json { "redelegation_responses": [ { "redelegation": { "delegator_address": "string", "validator_src_address": "string", "validator_dst_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T06:58:45.718Z", "initial_balance": "string", "shares_dst": "string" } ] }, "entries": [ { "redelegation_entry": { "creation_height": "string", "completion_time": "2021-01-19T06:58:45.718Z", "initial_balance": "string", "shares_dst": "string" }, "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations` > Retrieves all unbonding delegations of a given delegator address. #### Parameters * `delegator_addr` (string, required): a delegator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Unbonding delegations from a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations ``` #### Response example ```json { "unbonding_responses": [ { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T07:01:25.628Z", "initial_balance": "string", "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators` > Retrieves all validators info for given delegator address. #### Parameters * `delegator_addr` (string; required): a delegator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Validator info for a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators ``` #### Response example ```json { "validators": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:06:38.006Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:06:38.006Z" }, "min_self_delegation": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}` > Retrieves validator info for a given delegator-validator pair. #### Parameters * `delegator_addr` (string; required): a delegator address to query for. * `validator_addr` (string; required): a validator address to query for. #### Returns Validator info for a given delegator pair. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr} ``` #### Response example ```json { "validator": { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:08:34.100Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:08:34.100Z" }, "min_self_delegation": "string" } } ``` --- ### `/cosmos/staking/v1beta1/historical_info/{height}` > Retrieves the historical info for a given height. #### Parameters * `height` (string, int64): defines at which height to query the historical info for. #### Returns Historical info for a given height. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/historical_info/{height} ``` #### Response example ```json { "hist": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2021-01-19T07:13:57.974Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "valset": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:13:57.974Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:13:57.974Z" }, "min_self_delegation": "string" } ] } } ``` --- ### `/cosmos/staking/v1beta1/params` > Retrieves the staking parameters. #### Parameters None. #### Returns Staking parameters. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/params ``` #### Response example ```json { "params": { "unbonding_time": "string", "max_validators": 0, "max_entries": 0, "historical_entries": 0, "bond_denom": "string" } } ``` --- ### `/cosmos/staking/v1beta1/pool` > Retrieves the pool info. #### Parameters None. #### Returns Pool info. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/pool ``` #### Response example ```json { "pool": { "not_bonded_tokens": "string", "bonded_tokens": "string" } } ``` --- ### /cosmos/staking/v1beta1/validators > Retrieves all validators that match the given status. #### Parameters * `status` (string): a status to query validators by. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Validators that match the given status. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/validators ``` #### Response example ```json { "validators": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:21:25.914Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:21:25.914Z" }, "min_self_delegation": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}` > Retrieves validator info for a given validator address. #### Parameters * `validator_addr` (string; required): a validator address to query for. #### Returns Validator info for a given validator address. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/validators/{validator_addr} ``` #### Response example ```json { "validator": { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:25:26.679Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:25:26.679Z" }, "min_self_delegation": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations` > Retrieves delegate info for a given validator. #### Parameters * `validator_addr` (string; required): a validator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` `string, uint64`: a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Delegate info for a given validator. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/validators/{validator_addr}/delegations ``` #### Response example ```json { "delegation_responses": [ { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}` > Retrieves delegate info for a given validator-delegator pair. #### Parameters * `validator_addr` (string; required): a validator address to query for. * `delegator_addr` (string; required): a delegator address to query for. #### Returns Delegate info for a given validator delegator pair. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr} ``` #### Response example ```json { "delegation_response": { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation` > Retrieves unbonding info for a given validator-delegator pair. #### Parameters * `validator_addr` (string; required): a validator address to query for. * `delegator_addr` (string; required): a delegator address to query for. #### Returns Unbonding info for a given validator delegator pair. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation ``` #### Response example ```json { "unbond": { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T07:35:28.235Z", "initial_balance": "string", "balance": "string" } ] } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations` > Retrieves unbonding delegations of a validator. #### Parameters * `validator_addr` (string, required): a validator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Unbonding info for a given validator. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations ``` #### Response example ```json { "unbonding_responses": [ { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T07:37:20.281Z", "initial_balance": "string", "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### Upgrade methods ### `/cosmos/upgrade/v1beta1/applied_plan/{name}` > Retrieves a previously applied upgrade plan by its name. #### Parameters * `name` (string; required): a name of the applied plan to query for. #### Returns Previously applied upgrade plan. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/upgrade/v1beta1/applied_plan/{name} ``` #### Response example ```json { "height": "string" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/ title: Allora — Cosmos REST methods (3/4) source: docs/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3.mdx --- # Allora — Cosmos REST methods (3/4) > API reference for [Allora](/rpc-service/chains/chains-api/allora/). [All methods ->](/rpc-service/chains/chains-api/allora/#methods) > > Part 3 of 4: [1](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/) · [2](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/) · 3 · [4](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/) ## Cosmos REST methods ### `/cosmos/upgrade/v1beta1/current_plan` > Retrieves the current upgrade plan. #### Parameters * `name` (string; required): a name of the applied plan to query for. #### Returns Current upgrade plan. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/upgrade/v1beta1/current_plan ``` #### Response example ```json { "plan": { "name": "string", "time": "2021-01-19T07:49:08.875Z", "height": "string", "info": "string", "upgraded_client_state": { "type_url": "string", "value": "string" } } } ``` --- ### `/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}` > Retrieves the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain, not supported with legacy querier. #### Parameters * `last_height` (string, int64): a required last height under which next consensus state is stored. #### Returns Consensus state. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height} ``` #### Response example ```json { "upgraded_consensus_state": { "type_url": "string", "value": "string" } } ``` --- ### Ibc core methods ### `/ibc/core/channel/v1beta1/channels` > Retrieves all the IBC channels of a chain. #### Parameters * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns IBC channels of a chain. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels ``` #### Response example ```json { "channels": [ { "state": "STATE_UNINITIALIZED_UNSPECIFIED", "ordering": "ORDER_NONE_UNSPECIFIED", "counterparty": { "port_id": "string", "channel_id": "string" }, "connection_hops": [ "string" ], "version": "string", "port_id": "string", "channel_id": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}` > Retrieves an IBC Channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. #### Returns IBC channels of a chain. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id} ``` #### Response example ```json { "channel": { "state": "STATE_UNINITIALIZED_UNSPECIFIED", "ordering": "ORDER_NONE_UNSPECIFIED", "counterparty": { "port_id": "string", "channel_id": "string" }, "connection_hops": [ "string" ], "version": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state` > Retrieves the client state for the channel associated with the provided channel identifiers. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. #### Returns Client state. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state ``` #### Response example ```json { "identified_client_state": { "client_id": "string", "client_state": { "type_url": "string", "value": "string" } }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}` > Retrieves the consensus state for the channel associated with the provided channel identifiers. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `revision_number` (string, uint64; required): a revision number of the consensus state. * `revision_height` string, uint64; required: a revision height of the consensus state. #### Returns Consensus state. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height} ``` #### Response example ```json { "consensus_state": { "type_url": "string", "value": "string" }, "client_id": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence` > Retrieves the next receive sequence for a given channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. #### Returns Next receive sequence. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence ``` #### Response example ```json { "next_sequence_receive": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements` > Retrieves all the packet acknowledgements associated with a channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Packet acknowledgements. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements ``` #### Response example ```json { "acknowledgements": [ { "port_id": "string", "channel_id": "string", "sequence": "string", "data": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}` > Retrieves a stored packet acknowledgement hash. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `sequence` (string, uint64): a packet sequence. #### Returns Packet acknowledgements. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence} ``` #### Response example ```json { "acknowledgement": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments` > Retrieves all the packet commitments hashes associated with a channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Packet commitments. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments ``` #### Response example ```json { "commitments": [ { "port_id": "string", "channel_id": "string", "sequence": "string", "data": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks` > Retrieves all the unreceived IBC acknowledgements associated with a channel and sequences. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `packet_ack_sequence` (array[string]): a required list of acknowledgement sequences. #### Returns Unreceived IBC acknowledgements. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks ``` #### Response example ```json { "sequences": [ "string" ], "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets` > Retrieves all the unreceived IBC packets associated with a channel and sequences. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `packet_commitment_sequences` (array[string]): a list of packet sequences. #### Returns Unreceived IBC packets. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets ``` #### Response example ```json { "sequences": [ "string" ], "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}` > Retrieves a stored packet commitment hash. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `packet_commitment_sequences` (array[string]): a list of packet sequences. #### Returns Packet commitment hash. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence} ``` #### Response example ```json { "commitment": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}` > Checks whether a given packet sequence has been received on the queried chain. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `sequence` (string, uint64): a required packet sequence. #### Returns Whether the given packet has been received or not. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence} ``` #### Response example ```json { "received": true, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/connections/{connection}/channels` > Retrieves all the channels associated with a connection end. #### Parameters * `connection` (string, required): a connection unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` string($uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Channels associated with a connection. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/channel/v1beta1/connections/{connection}/channels ``` #### Response example ```json { "channels": [ { "state": "STATE_UNINITIALIZED_UNSPECIFIED", "ordering": "ORDER_NONE_UNSPECIFIED", "counterparty": { "port_id": "string", "channel_id": "string" }, "connection_hops": [ "string" ], "version": "string", "port_id": "string", "channel_id": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/client/v1beta1/params` > Retrieves all parameters of the IBC client. #### Parameters None. #### Returns Params of the IBC client. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/client/v1beta1/params ``` #### Response example ```json { "params": { "allowed_clients": [ "string" ] } } ``` --- ### `/ibc/core/client/v1beta1/client_states` > Retrieves all the IBC light clients of a chain. #### Parameters * `pagination.key` (string; byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string; uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string; uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns IBC light clients. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/client/v1beta1/client_states ``` #### Response example ```json { "client_states": [ { "client_id": "string", "client_state": { "type_url": "string", "value": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/ibc/core/client/v1beta1/client_states/{client_id}` > Retrieves an IBC light client. #### Parameters * `client_id` (string; required): a client state unique identifier. #### Returns IBC light client from client_id. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/client/v1beta1/client_states/{client_id} ``` #### Response example ```json { "client_state": { "type_url": "string", "value": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/client/v1beta1/consensus_states/{client_id}` > Retrieves all the consensus state associated with a given client. #### Parameters * `client_id` (string; required): a client unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Consensus state associated with given client #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/client/v1beta1/consensus_states/{client_id} ``` #### Response example ```json { "consensus_states": [ { "height": { "revision_number": "string", "revision_height": "string" }, "consensus_state": { "type_url": "string", "value": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}` > Retrieves a consensus state associated with a client state at a given height. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `revision_number` (string, uint64): a required consensus state revision number. * `revision_height`(string, uint64): a required consensus state revision height. * `latest_height` (boolean): overrides the height field and queries the latest stored consensus state. #### Returns Consensus state associated with a client state at a given height. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height} ``` #### Response example ```json { "consensus_state": { "type_url": "string", "value": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/client_connections/{client_id}` > Retrieves the connection paths associated with a client state. #### Parameters * `client_id` (string, required): a client identifier associated with a connection. #### Returns Connections paths associated with a client state. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/connection/v1beta1/client_connections/{client_id} ``` #### Response example ```json { "connection_paths": [ "string" ], "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/connections` > Retrieves all the IBC connections of a chain. #### Parameters * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns IBC connections. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/connection/v1beta1/connections ``` #### Response example ```json { "connections": [ { "id": "string", "client_id": "string", "versions": [ { "identifier": "string", "features": [ "string" ] } ], "state": "STATE_UNINITIALIZED_UNSPECIFIED", "counterparty": { "client_id": "string", "connection_id": "string", "prefix": { "key_prefix": "string" } }, "delay_period": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/ title: Allora — Cosmos REST methods (4/4) source: docs/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4.mdx --- # Allora — Cosmos REST methods (4/4) > API reference for [Allora](/rpc-service/chains/chains-api/allora/). [All methods ->](/rpc-service/chains/chains-api/allora/#methods) > > Part 4 of 4: [1](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/) · [2](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/) · [3](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/) · 4 ## Cosmos REST methods ### `/ibc/core/connection/v1beta1/connections/{connection_id}` > Retrieves an IBC connection end. #### Parameters * `connection_id` (string; required): a connection unique identifier. #### Returns IBC connections end. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/connection/v1beta1/connections/{connection_id} ``` #### Response example ```json { "connection": { "client_id": "string", "versions": [ { "identifier": "string", "features": [ "string" ] } ], "state": "STATE_UNINITIALIZED_UNSPECIFIED", "counterparty": { "client_id": "string", "connection_id": "string", "prefix": { "key_prefix": "string" } }, "delay_period": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/connections/{connection_id}/client_state` > Retrieves the client state associated with the connection. #### Parameters * `connection_id` (string; required): a connection unique identifier. #### Returns Client state. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/connection/v1beta1/connections/{connection_id}/client_state ``` #### Response example ```json { "identified_client_state": { "client_id": "string", "client_state": { "type_url": "string", "value": "string" } }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}` > Retrieves the consensus state associated with the connection. #### Parameters * `connection_id` (string; required): a connection unique identifier. * `revision_number` (string, uint64): a required revision number. * `revision_height` (string, uint64): a required revision height. #### Returns Consensus state. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height} ``` #### Response example ```json { "consensus_state": { "type_url": "string", "value": "string" }, "client_id": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### Ibc applications methods ### `/ibc/applications/transfer/v1beta1/denom_traces` > Retrieves all denomination traces. #### Parameters * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Denomination traces. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/applications/transfer/v1beta1/denom_traces ``` #### Response example ```json { "denom_traces": [ { "path": "string", "base_denom": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/ibc/applications/transfer/v1beta1/denom_traces/{hash}` > Retrieves a denomination trace information by hash. #### Parameters * `hash` (string, hex; required): a hash of the denomination trace information. #### Returns Denomination traces. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/applications/transfer/v1beta1/denom_traces/{hash} ``` #### Response example ```json { "denom_trace": { "path": "string", "base_denom": "string" } } ``` --- ### `/ibc/applications/transfer/v1beta1/params` > Retrieves all parameters of the IBC transfer module. #### Parameters None. #### Returns Parameters of the IBC transfer module. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/ibc/applications/transfer/v1beta1/params ``` #### Response example ```json { "params": { "send_enabled": true, "receive_enabled": true } } ``` --- ### Tx methods ### `/cosmos/tx/v1beta1/simulate` > Simulates executing a transaction for estimating gas usage. #### Parameters * `` (object; required): ```json { "tx": { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] } } ``` #### Returns Estimated gas usage. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/tx/v1beta1/simulate ```` #### Response example ```json { "gas_info": { "gas_wanted": "string", "gas_used": "string" }, "result": { "data": "string", "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string", "index": true } ] } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/allora/cosmos-rest-methods/ title: Allora — Cosmos REST methods (1/4) source: docs/rpc-service/chains/chains-api/allora/cosmos-rest-methods.mdx --- # Allora — Cosmos REST methods (1/4) > API reference for [Allora](/rpc-service/chains/chains-api/allora/). [All methods ->](/rpc-service/chains/chains-api/allora/#methods) > > Part 1 of 4: 1 · [2](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/) · [3](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/) · [4](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/) ## Cosmos REST methods **Query**: * [Auth methods](#auth-methods) * [Bank methods](#bank-methods) * [Distribution methods](#distribution-methods) * [Evidence methods](#evidence-methods) * [Gov methods](#gov-methods) * [Mint methods](#mint-methods) * [Slashing methods](#slashing-methods) * [Staking methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#staking-methods) * [Upgrade methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#upgrade-methods) * [Ibc core methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibc-core-methods) * [Ibc applications methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#ibc-applications-methods) **Service**: * [Tx methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#tx-methods) ### Auth methods ## Cosmos REST methods ### `/cosmos/auth/v1beta1/accounts/{address}` > Retrieves account details based on address. #### Parameters * `address` (string; required): an address to query for account details. #### Returns Account details. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/auth/v1beta1/accounts/{address} ``` #### Response example ```json { "account": { "type_url": "string", "value": "string" } } ``` --- ### `/cosmos/auth/v1beta1/params` > Retrieves all parameters. #### Parameters None. #### Returns Parameters. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/auth/v1beta1/params ``` #### Response example ```json { "params": { "max_memo_characters": "string", "tx_sig_limit": "string", "tx_size_cost_per_byte": "string", "sig_verify_cost_ed25519": "string", "sig_verify_cost_secp256k1": "string" } } ``` --- ### Bank methods ### `/cosmos/bank/v1beta1/balances/{address}` > Retrieves the balance of all coins for a single account. #### Parameters * `address`(string; required): an address to query balances for. * `pagination.key` (string, byte): value returned in `PageResponse.next_key` to begin querying the next page most efficiently. Only one of offset or key should be set. * `pagination.offset` (string, uint64): numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set. * `pagination.limit` (string, uint64): total number of results to be returned in the result page. If left empty it will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. `count_total` is only respected when `offset` is used, it is ignored when `key` is set. #### Returns Balance of all coins for a single account. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/bank/v1beta1/balances/{address} ``` #### Response example ```json { "balances": [ { "denom": "string", "amount": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` ### `/cosmos/bank/v1beta1/balances/{address}/{denom}` > Retrieves balance of a single coin for a single account. #### Parameters * `address` (string; required): an address to query balances for. * `denom` (string; required): a coin denom to query balances for. #### Returns Balance of the specific coin for a single account. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/bank/v1beta1/balances/{address}/{denom} ``` #### Response example ```shell { "balance": { "denom": "string", "amount": "string" } } ``` ### `/cosmos/bank/v1beta1/params` > Retrieves the parameters of x/bank module. #### Parameters None. #### Returns Parameters of x/bank module. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/bank/v1beta1/params ``` #### Response example ```json { "params": { "send_enabled": [ { "denom": "string", "enabled": true } ], "default_send_enabled": true } } ``` --- ### `/cosmos/bank/v1beta1/supply` > Retrieves the total supply of all coins. #### Parameters None. #### Returns Supply of all coins. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/bank/v1beta1/supply ``` #### Response example ```json { "supply": [ { "denom": "string", "amount": "string" } ] } ``` --- ### Distribution methods ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards` > Retrieves the total rewards accrued by each validator. #### Parameters * `delegator_address` (string; required): a delegator address to query for. #### Returns Rewards from each validator. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards ``` #### Response example ```shell { "rewards": [ { "validator_address": "string", "reward": [ { "denom": "string", "amount": "string" } ] } ], "total": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}` > Retrieves the total rewards accrued by a delegation. #### Parameters * `delegator_address` (string; required): a delegator address to query for. * `validator_address` (string; required): a validator address to query for. #### Returns Total rewards accrued by a delegation for a specific validator. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address} ``` #### Response example ```json { "rewards": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators` > Retrieves the validators of a delegator. #### Parameters * `delegator_address` (string; required): a delegator address to query for. #### Returns Validators for a given delegator. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators ``` #### Response example ```json { "validators": [ "string" ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address` > Retrieves withdraw address of a delegator. #### Parameters * `delegator_address` (string, required): a delegator address to query for. #### Returns Withdraw address of delegator. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address ``` #### Response example ```json { "withdraw_address": "string" } ``` --- ### `/cosmos/distribution/v1beta1/params` > Retrieves params of the distribution module. #### Parameters None. #### Returns Params of the distribution module. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/distribution/v1beta1/params ``` #### Response example ```json { "params": { "community_tax": "string", "base_proposer_reward": "string", "bonus_proposer_reward": "string", "withdraw_addr_enabled": true } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/commission` > Retrieves accumulated commission for a validator. #### Parameters * `validator_address` (string; required): a validator address to query for. #### Returns Total commission for a validator. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/distribution/v1beta1/validators/{validator_address}/commission ``` #### Response example ```json { "commission": { "commission": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards` > Retrieves the rewards of a validator address. #### Parameters * `validator_address` (string; required): validator address to query for. #### Returns Total outstanding rewards for a validator. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards ``` #### Response example ```json { "rewards": { "rewards": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/slashes` > Retrieves slash events of a validator. #### Parameters * `validator_address` (string; required): a validator address to query for. * `starting_height` (string, uint64): the optional starting height to query the hashes * `ending_height` (string, uint64): the optional ending height to query the hashes * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns All slash events of a validator. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/distribution/v1beta1/validators/{validator_address}/slashes ``` #### Response example ```json { "slashes": [ { "validator_period": "string", "fraction": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### Evidence methods ### `/cosmos/evidence/v1beta1/evidence` > Retrieves all evidence. #### Parameters * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns All evidence. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/evidence/v1beta1/evidence ``` #### Response example ```json { "evidence": [ { "type_url": "string", "value": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/evidence/v1beta1/evidence/{evidence_hash}` > Retrieves evidence based on evidence hash. #### Parameters * `evidence_hash` (string, byte): the hash of the requested evidence. #### Returns Evidence for a given hash. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/evidence/v1beta1/evidence/{evidence_hash} ``` #### Response example ```json { "evidence": { "type_url": "string", "value": "string" } } ``` --- ### Gov methods ### `/cosmos/gov/v1beta1/params/{params_type}` > Retrieves all parameters of the gov module. #### Parameters * `params_type` (string, required): parameters to query for; possible values: `voting`, `tallying`, or `deposit`. #### Returns Parameters of the gov module. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/gov/v1beta1/params/{params_type} ``` #### Response example ```json { "voting_params": { "voting_period": "string" }, "deposit_params": { "min_deposit": [ { "denom": "string", "amount": "string" } ], "max_deposit_period": "string" }, "tally_params": { "quorum": "string", "threshold": "string", "veto_threshold": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals` > Retrieves all proposals based on given status. #### Parameters * `proposal_status`: defines status of the proposals. See below for different options. Default value = PROPOSAL_STATUS_UNSPECIFIED. Other statuses: * `PROPOSAL_STATUS_UNSPECIFIED`: default proposal status. * `PROPOSAL_STATUS_DEPOSIT_PERIOD`: defines a proposal status during the deposit period. * `PROPOSAL_STATUS_VOTING_PERIOD`: defines a proposal status during the voting period. * `PROPOSAL_STATUS_PASSED`: defines a proposal status of a proposal that has passed. * `PROPOSAL_STATUS_REJECTED`: defines a proposal status of a proposal that has been rejected. * `PROPOSAL_STATUS_FAILED`: defines a proposal status of a proposal that has failed. * `voter` (string): defines the voter address for the proposals. * `depositor` (string): defines the deposit addresses from the proposals. * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Proposals based on given status. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/gov/v1beta1/proposals ``` #### Response example ```json { "proposals": [ { "proposal_id": "string", "content": { "type_url": "string", "value": "string" }, "status": "PROPOSAL_STATUS_UNSPECIFIED", "final_tally_result": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" }, "submit_time": "2021-01-19T03:03:05.413Z", "deposit_end_time": "2021-01-19T03:03:05.413Z", "total_deposit": [ { "denom": "string", "amount": "string" } ], "voting_start_time": "2021-01-19T03:03:05.413Z", "voting_end_time": "2021-01-19T03:03:05.413Z" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}` > Retrieves proposal details based on `ProposalID`. #### Parameters * `proposal_id` (string; required): a unique id of the proposal. #### Returns Proposal details based on proposalID. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/gov/v1beta1/proposals/{proposal_id} ``` #### Response example ```json { "proposal": { "proposal_id": "string", "content": { "type_url": "string", "value": "string" }, "status": "PROPOSAL_STATUS_UNSPECIFIED", "final_tally_result": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" }, "submit_time": "2021-01-19T03:30:27.807Z", "deposit_end_time": "2021-01-19T03:30:27.807Z", "total_deposit": [ { "denom": "string", "amount": "string" } ], "voting_start_time": "2021-01-19T03:30:27.807Z", "voting_end_time": "2021-01-19T03:30:27.807Z" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` > Retrieves all deposits of a single proposal. #### Parameters * `proposal_id` (string, uint64; required): a unique id of the proposal. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns All deposits based on a proposalID. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits ``` #### Response example ```json { "deposits": [ { "proposal_id": "string", "depositor": "string", "amount": [ { "denom": "string", "amount": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}` > Retrieves single deposit information based `proposalID` and `depositAddr`. #### Parameters * `proposal_id` (string, uint64): a required unique id of the proposal. * `depositor` (string): the deposit addresses from the proposals. #### Returns Single deposit based on a proposalID. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor} ``` #### Response example ```json { "deposit": { "proposal_id": "string", "depositor": "string", "amount": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/tally` > Retrieves the tally of a proposal vote. #### Parameters * `proposal_id` (string, uint64): a required unique ID of the proposal. #### Returns Tally of proposal vote. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/gov/v1beta1/proposals/{proposal_id}/tally ``` #### Response example ```json { "tally": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/votes` > Retrieves the votes of a given proposal. #### Parameters * `proposal_id` (string($uint64), required): a unique id of the proposal * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Votes for a given proposal. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/gov/v1beta1/proposals/{proposal_id}/votes ``` #### Response example ```json { "votes": [ { "proposal_id": "string", "voter": "string", "option": "VOTE_OPTION_UNSPECIFIED" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}` > Retrieves voted information based on `proposalID` and `voterAddr`. #### Parameters * `proposal_id` (string, uint64; required): a unique ID of the proposal. * `voter` (string): the other address for the proposals. #### Returns Votes for a given proposal. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter} ``` #### Response example ```json { "vote": { "proposal_id": "string", "voter": "string", "option": "VOTE_OPTION_UNSPECIFIED" } } ``` --- ### Mint methods ### `/cosmos/mint/v1beta1/annual_provisions` > Retrieves the current minting annual provisions value. #### Parameters None. #### Returns Value of minting annual provisions. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/mint/v1beta1/annual_provisions ``` #### Response example ```json { "error": "string", "code": 0, "message": "string", "details": [ { "type_url": "string", "value": "string" } ] } ``` --- ### `/cosmos/mint/v1beta1/inflation` > Retrieves the current minting inflation value. #### Parameters None. #### Returns Current minting inflation value. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/mint/v1beta1/inflation ``` #### Response example ```json { "inflation": "string" } ``` --- ### `/cosmos/mint/v1beta1/params` > Retrieves the total set of minting parameters #### Parameters None. #### Returns Total set of minting params. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/mint/v1beta1/params ``` #### Response example ```json { "params": { "mint_denom": "string", "inflation_rate_change": "string", "inflation_max": "string", "inflation_min": "string", "goal_bonded": "string", "blocks_per_year": "string" } } ``` --- ### Slashing methods ### `/cosmos/slashing/v1beta1/params` > Retrieves the slashing module parameters. #### Parameters None. #### Returns The parameters of a slashing module. #### Request example ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/slashing/v1beta1/params ``` #### Response example ```json { "params": { "signed_blocks_window": "string", "min_signed_per_window": "string", "downtime_jail_duration": "string", "slash_fraction_double_sign": "string", "slash_fraction_downtime": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/allora/ title: Allora description: The Allora Network is an advanced protocol that leverages decentralized AI and machine learning (ML) to generate… Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/allora/index.mdx --- # Allora
> Allora API is available on [Web3 API platform](https://www.ankr.com/rpc/allora). The Allora Network is an advanced protocol that leverages decentralized AI and machine learning (ML) to generate and share predictions among its participants. It provides a structured way for users to access on-chain AI predictions and pay the AI/ML node operators who produce these insights. Allora acts as a bridge between various parties — data owners, processors, AI/ML predictors, market analysts, and end-users — allowing them to utilize and act on these predictions. AI/ML agents on the network use their data and algorithms to broadcast predictions across a peer-to-peer network. They also evaluate predictions from other agents. The network’s consensus mechanism then combines these predictions and assessments, rewarding agents based on the quality of their contributions. This incentive system helps Allora continuously learn and adapt to changing market conditions. ## Tendermint JSON-RPC/REST methods **Info — node information**: * [`blockchain`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#blockchain) — retrieves block headers (max: 20) for `minHeight <= height <= maxHeight`. * [`block`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#block) — retrieves a block at a specified height. * [`block_by_hash`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#block_by_hash) — retrieves a block by hash. * [`block_results`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#block_results) — retrieves block results at a specified height. * [`commit`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#commit) — retrieves commit results at a specified height. * [`validators`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#validators) — retrieves a validator set at a specified height. * [`genesis_chunked`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#genesis_chunked) — retrieves the Genesis in multiple chunks. * [`dump_consensus_state`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#dump_consensus_state) — retrieves consensus state. * [`consensus_state`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#consensus_state) — retrieves consensus state. * [`consensus_params`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#consensus_params) — retrieves consensus parameters. * [`unconfirmed_txs`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#unconfirmed_txs) — retrieves the list of unconfirmed transactions. * [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#num_unconfirmed_txs) — retrieves data about unconfirmed transactions. * [`tx_search`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#tx_search) — searches for transactions. * [`block_search`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#block_search) — searches for blocks by `BeginBlock` and `EndBlock` events. * [`tx`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#tx) — retrieves transactions by hash. **Tx — transactions broadcast information**: * [`broadcast_tx_sync`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#broadcast_tx_sync) — returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. * [`broadcast_tx_async`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#broadcast_tx_async) — returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. * [`broadcast_tx_commit`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#broadcast_tx_commit) — returns with the responses from `CheckTx` and `DeliverTx`. * [`check_tx`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#check_tx) — checks the transaction without executing it. **ABCI — ABCI info**: * [`abci_info`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#abci_info) — retrieves info about the application. * [`abci_query`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#abci_query) — queries the application for some information. --- ## Methods ### Networks/Protocols supported, Information, Transactions, ABCI - [`Networks/Protocols supported`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#networksprotocols-supported) - [`blockchain`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#blockchain) - [`block`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#block) - [`block_by_hash`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#block_by_hash) - [`block_results`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#block_results) - [`commit`](/rpc-service/chains/chains-api/allora/networks-protocols-supported/#commit) - [`validators`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#validators) - [`genesis_chunked`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#genesis_chunked) - [`dump_consensus_state`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#dump_consensus_state) - [`consensus_state`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#consensus_state) - [`consensus_params`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#consensus_params) - [`unconfirmed_txs`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#unconfirmed_txs) - [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#num_unconfirmed_txs) - [`tx_search`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#tx_search) - [`block_search`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#block_search) - [`tx`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/#tx) - [`broadcast_tx_sync`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#broadcast_tx_sync) - [`Parameters`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#parameters-15) - [`broadcast_tx_async`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#broadcast_tx_async) - [`broadcast_tx_commit`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#broadcast_tx_commit) - [`check_tx`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#check_tx) - [`abci_info`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#abci_info) - [`abci_query`](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/#abci_query) ### Cosmos REST methods - [`Auth methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#auth-methods) - [`/cosmos/auth/v1beta1/accounts/{address}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosauthv1beta1accountsaddress) - [`/cosmos/auth/v1beta1/params`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosauthv1beta1params) - [`Bank methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#bank-methods) - [`/cosmos/bank/v1beta1/balances/{address}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosbankv1beta1balancesaddress) - [`/cosmos/bank/v1beta1/balances/{address}/{denom}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosbankv1beta1balancesaddressdenom) - [`/cosmos/bank/v1beta1/params`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosbankv1beta1params) - [`/cosmos/bank/v1beta1/supply`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosbankv1beta1supply) - [`Distribution methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#distribution-methods) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosdistributionv1beta1delegatorsdelegator_addressrewards) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosdistributionv1beta1delegatorsdelegator_addressrewardsvalidator_address) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosdistributionv1beta1delegatorsdelegator_addressvalidators) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosdistributionv1beta1delegatorsdelegator_addresswithdraw_address) - [`/cosmos/distribution/v1beta1/params`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosdistributionv1beta1params) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/commission`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosdistributionv1beta1validatorsvalidator_addresscommission) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosdistributionv1beta1validatorsvalidator_addressoutstanding_rewards) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/slashes`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosdistributionv1beta1validatorsvalidator_addressslashes) - [`Evidence methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#evidence-methods) - [`/cosmos/evidence/v1beta1/evidence`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosevidencev1beta1evidence) - [`/cosmos/evidence/v1beta1/evidence/{evidence_hash}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosevidencev1beta1evidenceevidence_hash) - [`Gov methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#gov-methods) - [`/cosmos/gov/v1beta1/params/{params_type}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosgovv1beta1paramsparams_type) - [`/cosmos/gov/v1beta1/proposals`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosgovv1beta1proposals) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_id) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_iddeposits) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_iddepositsdepositor) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/tally`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_idtally) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_idvotes) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_idvotesvoter) - [`Mint methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#mint-methods) - [`/cosmos/mint/v1beta1/annual_provisions`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosmintv1beta1annual_provisions) - [`/cosmos/mint/v1beta1/inflation`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosmintv1beta1inflation) - [`/cosmos/mint/v1beta1/params`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosmintv1beta1params) - [`Slashing methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#slashing-methods) - [`/cosmos/slashing/v1beta1/params`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#cosmosslashingv1beta1params) - [`/cosmos/slashing/v1beta1/signing_infos`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosslashingv1beta1signing_infos) - [`/cosmos/slashing/v1beta1/signing_infos/{cons_address}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosslashingv1beta1signing_infoscons_address) - [`Staking methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#staking-methods) - [`/cosmos/staking/v1beta1/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegationsdelegator_addr) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegatorsdelegator_addrredelegations) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegatorsdelegator_addrunbonding_delegations) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidators) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidatorsvalidator_addr) - [`/cosmos/staking/v1beta1/historical_info/{height}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1historical_infoheight) - [`/cosmos/staking/v1beta1/params`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1params) - [`/cosmos/staking/v1beta1/pool`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1pool) - [`/cosmos/staking/v1beta1/validators`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1validators) - [`/cosmos/staking/v1beta1/validators/{validator_addr}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addr) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrdelegations) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addr) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addrunbonding_delegation) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrunbonding_delegations) - [`Upgrade methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#upgrade-methods) - [`/cosmos/upgrade/v1beta1/applied_plan/{name}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#cosmosupgradev1beta1applied_planname) - [`/cosmos/upgrade/v1beta1/current_plan`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#cosmosupgradev1beta1current_plan) - [`/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#cosmosupgradev1beta1upgraded_consensus_statelast_height) - [`Ibc core methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibc-core-methods) - [`/ibc/core/channel/v1beta1/channels`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channels) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_id) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idclient_state) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idconsensus_staterevisionrevision_numberheightrevision_height) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idnext_sequence) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_acknowledgements) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_ackssequence) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitments) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitmentspacket_ack_sequencesunreceived_acks) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitmentspacket_commitment_sequencesunreceived_packets) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitmentssequence) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_receiptssequence) - [`/ibc/core/channel/v1beta1/connections/{connection}/channels`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccorechannelv1beta1connectionsconnectionchannels) - [`/ibc/client/v1beta1/params`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibcclientv1beta1params) - [`/ibc/core/client/v1beta1/client_states`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccoreclientv1beta1client_states) - [`/ibc/core/client/v1beta1/client_states/{client_id}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccoreclientv1beta1client_statesclient_id) - [`/ibc/core/client/v1beta1/consensus_states/{client_id}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccoreclientv1beta1consensus_statesclient_id) - [`/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccoreclientv1beta1consensus_statesclient_idrevisionrevision_numberheightrevision_height) - [`/ibc/core/connection/v1beta1/client_connections/{client_id}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1client_connectionsclient_id) - [`/ibc/core/connection/v1beta1/connections`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1connections) - [`/ibc/core/connection/v1beta1/connections/{connection_id}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#ibccoreconnectionv1beta1connectionsconnection_id) - [`/ibc/core/connection/v1beta1/connections/{connection_id}/client_state`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#ibccoreconnectionv1beta1connectionsconnection_idclient_state) - [`/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#ibccoreconnectionv1beta1connectionsconnection_idconsensus_staterevisionrevision_numberheightrevision_height) - [`Ibc applications methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#ibc-applications-methods) - [`/ibc/applications/transfer/v1beta1/denom_traces`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#ibcapplicationstransferv1beta1denom_traces) - [`/ibc/applications/transfer/v1beta1/denom_traces/{hash}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#ibcapplicationstransferv1beta1denom_traceshash) - [`/ibc/applications/transfer/v1beta1/params`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#ibcapplicationstransferv1beta1params) - [`Tx methods`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#tx-methods) - [`/cosmos/tx/v1beta1/simulate`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#cosmostxv1beta1simulate) ### Cosmos REST methods - [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-2/#cosmostxv1beta1txs-1) - [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-2/#cosmostxv1beta1txs-1) - [`/cosmos/tx/v1beta1/txs/{hash}`](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-2/#cosmostxv1beta1txshash) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/ title: Allora — Networks/Protocols supported, Information, Transactions, ABCI (2/3) source: docs/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2.mdx --- # Allora — Networks/Protocols supported, Information, Transactions, ABCI (2/3) > API reference for [Allora](/rpc-service/chains/chains-api/allora/). [All methods ->](/rpc-service/chains/chains-api/allora/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/allora/networks-protocols-supported/) · 2 · [3](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/) ## Information ### `validators` > Retrieves a validator set at a specified height. Validators are sorted by voting power. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the validator set corresponding to the latest block is to be fetched. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30; max: 100): a number of entries per page. #### Returns Commit results. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "validators", "params": ["1","1","30"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/validators?height=1&page=2&per_page=30 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "block_height": "55", "validators": [ { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } ], "count": "1", "total": "25" } } ``` --- ### `genesis_chunked` > Retrieves Genesis in multiple chunks. Gets genesis document in multiple chunks to make it easier to iterate through larger genesis structures. Each chunk is produced by converting the genesis document to JSON and then splitting the resulting payload into 16MB blocks, and then Base64-encoding each block. #### Parameters
* `chunk` (integer; default: 0): a sequence number of the chunk to download. #### Returns A Genesis chunk response. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "genesis_chunked", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/genesis_chunked?chunk=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "chunk": 0, "total": 1, "data": "Z2VuZXNpcwo=" } } ``` --- ### `dump_consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns A complete consensus state. See the [Vote string description](https://pkg.go.dev/github.com/tendermint/tendermint/types?tab=doc#Vote.String). #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "dump_consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/dump_consensus_state ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "round_state": { "height": "1311801", "round": 0, "step": 3, "start_time": "2019-08-05T11:28:49.064658805Z", "commit_time": "2019-08-05T11:28:44.064658805Z", "validators": { "validators": [ { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } ], "proposer": { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } }, "locked_round": -1, "valid_round": "-1", "votes": [ { "round": "0", "prevotes": [ "nil-Vote", "Vote{19:46A3F8B8393B 1311801/00/1(Prevote) 000000000000 64CE682305CB @ 2019-08-05T11:28:47.374703444Z}" ], "prevotes_bit_array": "BA{100:___________________x________________________________________________________________________________} 209706/170220253 = 0.00", "precommits": [ "nil-Vote" ], "precommits_bit_array": "BA{100:____________________________________________________________________________________________________} 0/170220253 = 0.00" } ], "commit_round": -1, "last_commit": { "votes": [ "Vote{0:000001E443FD 1311800/00/2(Precommit) 3071ADB27D1A 77EE1B6B6847 @ 2019-08-05T11:28:43.810128139Z}" ], "votes_bit_array": "BA{100:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} 170220253/170220253 = 1.00", "peer_maj_23s": {} }, "last_validators": { "validators": [ { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } ], "proposer": { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } }, "triggered_timeout_precommit": false }, "peers": [ { "node_address": "357f6a6c1d27414579a8185060aa8adf9815c43c@68.183.41.207:26656", "peer_state": { "round_state": { "height": "1311801", "round": "0", "step": 3, "start_time": "2019-08-05T11:28:49.21730864Z", "proposal": false, "proposal_block_parts_header": { "total": 0, "hash": "" }, "proposal_pol_round": -1, "proposal_pol": "____________________________________________________________________________________________________", "prevotes": "___________________x________________________________________________________________________________", "precommits": "____________________________________________________________________________________________________", "last_commit_round": 0, "last_commit": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "catchup_commit_round": -1, "catchup_commit": "____________________________________________________________________________________________________" }, "stats": { "votes": "1159558", "block_parts": "4786" } } } ] } } ``` --- ### `consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns Consensus state results. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/consensus_state ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "round_state": { "height/round/step": "1262197/0/8", "start_time": "2019-08-01T11:52:38.962730289Z", "proposal_block_hash": "634ADAF1F402663BEC2ABC340ECE8B4B45AA906FA603272ACC5F5EED3097E009", "locked_block_hash": "634ADAF1F402663BEC2ABC340ECE8B4B45AA906FA603272ACC5F5EED3097E009", "valid_block_hash": "634ADAF1F402663BEC2ABC340ECE8B4B45AA906FA603272ACC5F5EED3097E009", "height_vote_set": [ { "round": 0, "prevotes": [ "Vote{0:000001E443FD 1262197/00/1(Prevote) 634ADAF1F402 7BB974E1BA40 @ 2019-08-01T11:52:35.513572509Z}", "nil-Vote" ], "prevotes_bit_array": "BA{100:xxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} 169753436/170151262 = 1.00", "precommits": [ "Vote{5:18C78D135C9D 1262197/00/2(Precommit) 634ADAF1F402 8B5EFFFEABCD @ 2019-08-01T11:52:36.25600005Z}", "nil-Vote" ], "precommits_bit_array": "BA{100:xxxxxx_xxxxx_xxxx_x_xxx_xx_xx_xx__x_x_x__xxxxxxxxxxxxxx_xxxx_xx_xxxxxx_xxxxxxxx_xxxx_xxx_x_xxxx__xxx} 118726247/170151262 = 0.70" } ], "proposer": { "address": "D540AB022088612AC74B287D076DBFBC4A377A2E", "index": 0 } } } } ``` --- ### `consensus_params` > Retrieves consensus parameters. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be returned. #### Returns Consensus parameters results. #### Request parameters ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_params", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/consensus_params?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "block_height": "1", "consensus_params": { "block": { "max_bytes": "22020096", "max_gas": "1000", "time_iota_ms": "1000" }, "evidence": { "max_age": "100000" }, "validator": { "pub_key_types": [ "ed25519" ] } } } } ``` --- ### `unconfirmed_txs` > Retrieves the list of unconfirmed transactions. #### Parameters
* `limit` (integer; default: 30; max: 100): the maximum number of unconfirmed transactions to return. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unconfirmed_txs", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/unconfirmed_txs?limit=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "n_txs": "82", "total": "82", "total_bytes": "19974", "txs": [ "gAPwYl3uCjCMTXENChSMnIkb5ZpYHBKIZqecFEV2tuZr7xIUA75/FmYq9WymsOBJ0XSJ8yV8zmQKMIxNcQ0KFIyciRvlmlgcEohmp5wURXa25mvvEhQbrvwbvlNiT+Yjr86G+YQNx7kRVgowjE1xDQoUjJyJG+WaWBwSiGannBRFdrbma+8SFK2m+1oxgILuQLO55n8mWfnbIzyPCjCMTXENChSMnIkb5ZpYHBKIZqecFEV2tuZr7xIUQNGfkmhTNMis4j+dyMDIWXdIPiYKMIxNcQ0KFIyciRvlmlgcEohmp5wURXa25mvvEhS8sL0D0wwgGCItQwVowak5YB38KRIUCg4KBXVhdG9tEgUxMDA1NBDoxRgaagom61rphyECn8x7emhhKdRCB2io7aS/6Cpuq5NbVqbODmqOT3jWw6kSQKUresk+d+Gw0BhjiggTsu8+1voW+VlDCQ1GRYnMaFOHXhyFv7BCLhFWxLxHSAYT8a5XqoMayosZf9mANKdXArA=" ] } } ``` --- ### `num_unconfirmed_txs` > Retrieves data on unconfirmed transactions. #### Parameters
None. #### Returns The status of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "num_unconfirmed_txs", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/num_unconfirmed_txs ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "n_txs": "31", "total": "82", "total_bytes": "19974" } } ``` --- ### `tx_search` > Searches for transactions with their results. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height and txhash. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx_search", "params": ["4D2000", true, "1", "30", "asc"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/tx_search?query=tx.height%4D2000&prove=true&page=1&per_page=30&order_by=asc ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "txs": [ { "hash": "D70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED", "height": "1000", "index": 0, "tx_result": { "log": "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]", "gas_wanted": "200000", "gas_used": "28596", "tags": { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } }, "tx": "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=", "proof": { "RootHash": "72FE6BF6D4109105357AECE0A82E99D0F6288854D16D8767C5E72C57F876A14D", "Data": "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=", "Proof": { "total": "2", "index": "0", "leaf_hash": "eoJxKCzF3m72Xiwb/Q43vJ37/2Sx8sfNS9JKJohlsYI=", "aunts": [ "eWb+HG/eMmukrQj4vNGyFYb3nKQncAWacq4HF5eFzDY=" ] } } } ], "total_count": "2" } } ``` --- ### `block_search` > Searches for blocks by `BeginBlock` and `EndBlock` events. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height. #### Returns The list of paginated blocks matching the search criteria. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_search", "params": ["4D2000", "1", "30", "asc"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/block_search?query=block.height%4D2000&page=1&per_page=30&order_by=asc ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "blocks": [ { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } ], "total_count": 2 } } ``` --- ### `tx` > Retrieves a transaction by hash. #### Parameters
* `hash` (string; required): a hash of a transaction to retrieve. * `prove` (boolean; default: false): adds proofs of the transaction's inclusion in the block. #### Returns Transaction info. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx", "params": ["0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/tx?hash=0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED&prove=true ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "hash": "D70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED", "height": "1000", "index": 0, "tx_result": { "log": "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]", "gas_wanted": "200000", "gas_used": "28596", "tags": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] }, "tx": "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/ title: Allora — Networks/Protocols supported, Information, Transactions, ABCI (3/3) source: docs/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3.mdx --- # Allora — Networks/Protocols supported, Information, Transactions, ABCI (3/3) > API reference for [Allora](/rpc-service/chains/chains-api/allora/). [All methods ->](/rpc-service/chains/chains-api/allora/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/allora/networks-protocols-supported/) · [2](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/) · 3 ## Transactions ### `broadcast_tx_sync` > Returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. ### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_sync", "params": ["456"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/broadcast_tx_sync?tx=456 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "code": "0", "data": "", "log": "", "codespace": "ibc", "hash": "0D33F2F03A5234F38706E43004489E061AC40A2E" }, "error": "" } ``` --- ### `broadcast_tx_async` > Returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). 3. A node is offline. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_async", "params": ["123"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/broadcast_tx_async?tx=123 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "code": "0", "data": "", "log": "", "codespace": "ibc", "hash": "0D33F2F03A5234F38706E43004489E061AC40A2E" }, "error": "" } ``` --- ### `broadcast_tx_commit` > Returns with the responses from `CheckTx` and `DeliverTx`. :::warning Use only for testing and development. In production, use `BroadcastTxSync` or `BroadcastTxAsync`. You can subscribe for the transaction result using JSON-RPC via a websocket (see [CometBFT docs](https://docs.cometbft.com/v0.34/core/subscription.html)). ::: :::tip CONTRACT: only returns error if `mempool.CheckTx()` errs or if we timeout waiting for tx to commit. If `CheckTx` or `DeliverTx` fails, no error will be returned, but the result will contain a non-OK ABCI code. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. ::: #### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_commit", "params": ["785"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/broadcast_tx_commit?tx=785 ``` #### Response example ```json { "error": "", "result": { "height": "26682", "hash": "75CA0F856A4DA078FC4911580360E70CEFB2EBEE", "deliver_tx": { "log": "", "data": "", "code": "0" }, "check_tx": { "log": "", "data": "", "code": "0" } }, "id": 0, "jsonrpc": "2.0" } ``` --- ### `check_tx` > Checks the transaction without executing it. The transaction won't be added to the mempool. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "check_tx", "params": ["785"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/check_tx?tx=785 ``` #### Response example ```json { "error": "", "result": { "code": "0", "data": "", "log": "", "info": "", "gas_wanted": "1", "gas_used": "0", "events": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "codespace": "bank" }, "id": 0, "jsonrpc": "2.0" } ``` --- ## ABCI ### `abci_info` > Retrieves application info. #### Parameters
None. #### Returns Application info. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_info", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/abci_info ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "response": { "data": "data-sample", "version": "1.6.1", "last_block_height": "7690381", "last_block_app_hash": "J1tJC9R3q3cNzkDcI7ipyi9NuZ8XUVbMyy7B42TPWuc=" } } } ``` --- ### `abci_query` > Queries the application for particular information. #### Parameters
* `path` (string; required): a path to the data ("/a/b/c"). * `data` (string; required): the data. * `height` (integer; default: 0): the height (0 means latest). * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. #### Returns Particular info according to the query submitted. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_query", "params": ["a/b/c", "the_data", "1", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/blockchain?path=%2Fa%2Fb%2Fc&data=the_data&height=1&prove=true ``` #### Response example ```json { "error": "", "result": { "response": { "log": "exists", "height": "0", "proof": "010114FED0DAD959F36091AD761C922ABA3CBF1D8349990101020103011406AA2262E2F448242DF2C2607C3CDC705313EE3B0001149D16177BC71E445476174622EA559715C293740C", "value": "61626364", "key": "61626364", "index": "-1", "code": "0" } }, "id": 0, "jsonrpc": "2.0" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/allora/networks-protocols-supported/ title: Allora — Networks/Protocols supported, Information, Transactions, ABCI (1/3) source: docs/rpc-service/chains/chains-api/allora/networks-protocols-supported.mdx --- # Allora — Networks/Protocols supported, Information, Transactions, ABCI (1/3) > API reference for [Allora](/rpc-service/chains/chains-api/allora/). [All methods ->](/rpc-service/chains/chains-api/allora/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p2/) · [3](/rpc-service/chains/chains-api/allora/networks-protocols-supported-p3/) ## Networks/Protocols supported We support the following networks and protocols for Allora: * [Tendermint JSON-RPC/REST API](/rpc-service/chains/chains-api/allora/#tendermint-json-rpcrest-methods) * [Cosmos REST API](/rpc-service/chains/chains-api/allora/#cosmos-rest-methods) Currently, we provide two interfaces to query Allora API — [JSON-RPC](https://www.jsonrpc.org/specification) and REST. Responses for both of them come in [JSON format](https://www.json.org/json-en.html). Here is the request/response structure to use for querying: ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["761001"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/block?height=761001 ``` ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/base/tendermint/v1beta1/blocks/{height} ``` ```json { "jsonrpc": "2.0", "id": -1, "result": { "block_id": { "hash": "663789D1BAA0354453A5BB1474C46C9F74E6140B247153482BBE84893C029600", "parts": { "total": 1, "hash": "BFCC2C78C439E367ABEEA996FD9A120EAA70DC44572B8BFDCA032908BA4B439B" } }, "block": { "header": { "version": { "block": "11" }, "chain_id": "allora-testnet-1", "height": "761001", "time": "2024-08-21T21:33:36.088780054Z", "last_block_id": { "hash": "AD51186842A63CB515A4946C558DF1DA71D384DF646EC5522ECD5008E3FAEDA0", "parts": { "total": 1, "hash": "16A9CCD523F2E593E66F46CBD20FCC03B5849ACE5325951E50BC53B6D7D2F893" } }, "last_commit_hash": "77BE45E09B5A5F40FA1F10BF430C2E14371445B9E2DF89952478E84A98DFA081", "data_hash": "78F2AF9D01AC871045FB53CB383AA50EF4C0094E9563428BFF8BA59071801050", "validators_hash": "CB957FF7AB192A9F9321F0E471C7BAE5A9AA82573FF8D509F8ACF7CA3A450A42", "next_validators_hash": "CB957FF7AB192A9F9321F0E471C7BAE5A9AA82573FF8D509F8ACF7CA3A450A42", "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", "app_hash": "72AEC5979CEA9EE65275B77DA8F31676C7E52DA57B991D86C4870237E3D40127", "last_results_hash": "455FD6D9D1888EBE5B8602E20E84EEACA30020B717A5B5298890E7236CAB84AD", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "01458B61F0D7DE6E90798FE8C370413D718EB34C" }, "data": { "txs": [ "CuECCt4CCiQvZW1pc3Npb25zLnYyLk1zZ0luc2VydFdvcmtlclBheWxvYWQStQIKK2FsbG8xYWhhcGE2ZHpkOG0yNjc0MHp5N2gyd3pnamx1ZnM4NjRmeDR1eHcShQIKK2FsbG8xYWhhcGE2ZHpkOG0yNjc0MHp5N2gyd3pnamx1ZnM4NjRmeDR1eHcSBAiRuS4YBSJICkYIBRCRuS4aK2FsbG8xYWhhcGE2ZHpkOG0yNjc0MHp5N2gyd3pnamx1ZnM4NjRmeDR1eHciETE0NS42NTg1MDk2NjIzMjkzKkBkgCxd7XHQh+Debe/yvS+c8BBoKguydI/J/YNqRaYpBDpnwQo+4/LPouiYF04JXDBa4qxTfJFlpdSJ9EgoX+TAMkIwMmQ4MjYzOTFiYWI4ZjYzNWYzNDhkYmQxNDQ1ZGUxZmQ0YjgzZjNiNGJiZjFkY2EzY2Q4YWFjM2FlMWMyYmY5ODcSWApQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohAtgmORurj2NfNI29FEXeH9S4PztLvx3KPNiqw64cK/mHEgQKAggBGCkSBBDAhD0aQN1AnyLR2Kz/KMZ5yr+Sz4wo+4Tp8OnyDqSlr98oCNQVPtF69bWneamHvTEq7r5WUGuwQfWSD+sybXlUgnDlmIw=", "CuECCt4CCiQvZW1pc3Npb25zLnYyLk1zZ0luc2VydFdvcmtlclBheWxvYWQStQIKK2FsbG8xcmZweng2MGR6MDc5dWhuZXRxdHNkdTJ1ZTM0dmdyMnJ3ZGFrd2cShQIKK2FsbG8xcmZweng2MGR6MDc5dWhuZXRxdHNkdTJ1ZTM0dmdyMnJ3ZGFrd2cSBAiTuS4YAyJICkYIAxCTuS4aK2FsbG8xcmZweng2MGR6MDc5dWhuZXRxdHNkdTJ1ZTM0dmdyMnJ3ZGFrd2ciETYxMzI3LjIzMTM5NzQ3MTg1KkA2b71NaRNK8PFRv+nLbaTfB53wu/AqI4cGoFYED/4U/3c8JOYW+Q2moUdlX35tKF0U2gneVA2jQy0vmem8uIz6MkIwMzA5Zjg2ZWY3YzNlM2IyZjUzMzg3OGZiNjY2Mjk1NjljNjFkYTNhMzg2OTkyNjNmMWM4MDhlMTcxMTQzOWYxMmMSWQpRCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohAwn4bvfD47L1M4ePtmYpVpxh2jo4aZJj8cgI4XEUOfEsEgQKAggBGLJKEgQQwIQ9GkAYepebNx4qruj3/XCxlmVQ3XDbhfsXZlZyM+yeqUs7d263LfRxugRgQH3aiV/ROiC/gVH0bID6GA00y5QMWM+B" ] }, "evidence": { "evidence": [] }, "last_commit": { "height": "761000", "round": 0, "block_id": { "hash": "AD51186842A63CB515A4946C558DF1DA71D384DF646EC5522ECD5008E3FAEDA0", "parts": { "total": 1, "hash": "16A9CCD523F2E593E66F46CBD20FCC03B5849ACE5325951E50BC53B6D7D2F893" } }, "signatures": [ { "block_id_flag": 1, "validator_address": "", "timestamp": "0001-01-01T00:00:00Z", "signature": null }, { "block_id_flag": 2, "validator_address": "2D5A6E69CDFBE8FF7C0C2DAFF752387AC73B9AB1", "timestamp": "2024-08-21T21:33:36.07519025Z", "signature": "LvyV25u8kxAivi7rHuAZlXtawVBMYyOJflcr4al44TWVLmYnztqycSgGyi1S9GkUGoeA4nG+wRM/4pqk4YIKDQ==" } ] } } } } ``` --- ## Information ### `blockchain` > Retrieves block headers for `minHeight <= height <= maxHeight`. At most 20 items will return for the `minHeight` or `maxHeight` parameters specified. If `maxHeight` does not yet exist, the blocks up to the current height will return. If `minHeight` does not exist (pruning), the earliest existing height will be used. #### Parameters
* `minHeight` (integer): the minimum block height to return. * `maxHeight` (integer): the maximum block height to return. #### Returns Block headers, in descending order (highest first). #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "blockchain", "params": ["1", "2"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/blockchain?minHeight=1&maxHeight=2 ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "last_height": "1276718", "block_metas": [ { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block_size": 1000000, "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "num_txs": "54" } ] } } ``` --- ### `block` > Retrieves a block at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block is to be fetched. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/blockchain?height=1 ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } } ``` --- ### `block_by_hash` > Retrieves a block by hash. #### Parameters
* `hash` (string; required): a block hash. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_by_hash", "params": ["0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/block_by_hash?hash=0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } } ``` --- ### `block_results` > Retrieves block results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block info is to be fetched. #### Returns Block results. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_results", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/block_results?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "height": "12", "txs_results": [ { "code": "0", "data": "", "log": "not enough gas", "info": "", "gas_wanted": "100", "gas_used": "100", "events": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "codespace": "ibc" } ], "begin_block_events": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "end_block": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "validator_updates": [ { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "power": "300" } ], "consensus_params_updates": { "block": { "max_bytes": "22020096", "max_gas": "1000", "time_iota_ms": "1000" }, "evidence": { "max_age": "100000" }, "validator": { "pub_key_types": [ "ed25519" ] } } } } ``` --- ### `commit` > Retrieves commit results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be fetched. #### Returns Commit results. Canonical switches from false to true for block H once block H+1 has been committed, until then it's subjective and only reflects what this node has seen so far. #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "commit", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/commit?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "signed_header": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "commit": { "height": "1311801", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "timestamp": "2019-04-22T17:01:58.376629719Z", "signature": "14jaTQXYRt8kbLKEhdHq7AXycrFImiLuZx50uOjs2+Zv+2i7RTG/jnObD07Jo2ubZ8xd7bNBJMqkgtkd0oQHAw==" } ] } }, "canonical": true } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/aptos/accounts-p2/ title: Aptos — Accounts, Blocks, Events, General, Table, Transactions (2/2) source: docs/rpc-service/chains/chains-api/aptos/accounts-p2.mdx --- # Aptos — Accounts, Blocks, Events, General, Table, Transactions (2/2) > API reference for [Aptos](/rpc-service/chains/chains-api/aptos/). [All methods ->](/rpc-service/chains/chains-api/aptos/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/aptos/accounts/) · 2 ## Transactions ### Get transactions > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/transactions`** Retrieves on-chain committed transactions. The page size and start ledger version can be provided to get a specific sequence of transactions. If the version has been pruned, then a 410 will be returned. To retrieve a pending transaction, use [Get transactions by hash](#get-transaction-by-hash). #### Parameters * `limit` (integer; query): max number of events to retrieve. If unspecified, defaults to default page size. * `start` (string; uint64; query): a ledger version to start th list of transactions. If not provided, defaults to showing the latest transactions
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/transactions \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ] ``` --- ### Submit transaction > **POST `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/transactions`** This endpoint accepts transaction submissions in two formats. To submit a transaction as JSON, you must create a SubmitTransactionRequest. To build this request, do the following: 1. Encode the transaction as BCS. If you are using a language that has 2. Sign the encoded transaction and use it to create a TransactionSignature. 3. Submit the request. Make sure to use the "application/json" Content-Type. To submit a transaction as BCS, you must submit a SignedTransaction encoded as BCS. Make sure to use the `application/x.aptos.signed_transaction+bcs` Content-Type. #### Parameters Request is an `application/json` body with the following parameters: * `sender` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `sequence_number` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `max_gas_amount` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `gas_unit_price` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `expiration_timestamp_secs` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `payload` (object; required): a payload is one of the following objects: 1. A payload which runs a single entry function: * `type` (string; required): a payload type. Example: `entry_function_payload`. * `function` (string; required): an entry function ID is a string representation of an entry function defined on-chain.
Format: `{address}::{module name}::{function name}`
Both `module name` and `function name` are case-sensitive.
Example: `0x1::aptos_coin::transfer` * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 2. A payload which runs a script that can run multiple functions: * `type` (string; required): a payload type. Example: `script_payload`. * `code` (object; required): a Move script bytecode: * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move function: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]: required): a return type of the function. * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 3. An enum of possible transaction payloads: * `type` (string; required): a payload type. Example: `module_bundle_payload`. * `modules` (array[object]; required): * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move module: * `address` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `name` (string; required): a name of the module. * `friends` (array[string]: required): friends of the module. * `exposed_functions` (array[object]; required): public functions of the module: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]; required): a return type of the function. * `structs` (array[object]; required): structs of the module: * `name` (string; required): a name of the struct. * `is_native` (boolean; required): whether the struct is a native struct of Move. * `abilities` (array[string]; required): abilities associated with the struct. * `generic_type_params` (array[object]; required): generic types associated with the struct: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the type that uses it. * `fields` (array[object]; required): fields associated with the struct: * `name` (string; required): a name of the field. * `type` (string; required): a string representation of an on-chain Move type tag that is exposed in transaction payload.
Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` ``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match pattern: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `signature` (object; required): a signature is one of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a signature type. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 3. A multi-agent signature for multi-agent transactions (allows you to have transactions across multiple accounts): * `type` (string; required): a type of signature. Example: `multi_agent_signature`. * `sender` (object; required): a sender is on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of sender signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of sender signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `secondary_signer_addresses` (array[string]; hex; required): the other involved parties' addresses. * `secondary_signers` (array of objects): an array of on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of secondary signers' signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of secondary signers' signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/aptos/YOUR_ANKR_API_KEY/v1/transactions \ -H 'Content-Type: application/json' -d '{ "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } }' ``` #### Response example ```json { "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ``` --- ### Get transaction by hash > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/transactions/by_hash/{txn_hash}`** Retrieves a transaction by its hash. This is the same hash that is returned by the API when submitting a transaction (see PendingTransaction). When given a transaction hash, the server first looks for the transaction in storage (on-chain, committed). If no on-chain transaction is found, it looks the transaction up by hash in the mempool (pending, not yet committed). To create a transaction hash by yourself, do the following: 1. Hash message bytes: "RawTransaction" bytes + BCS bytes of Transaction. 2. Apply hash algorithm `SHA3-256` to the hash message bytes. 3. Hex-encode the hash bytes with `0x` prefix. #### Parameters * `txn_hash` (string; path; required): a hash of the transaction to retrieve. #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/transactions/by_hash/{txn_hash} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ``` --- ### Get transaction by version > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/transactions/by_version/{txn_version}`** Retrieves a transaction by a given version. If the version has been pruned, a 410 will be returned. #### Parameters * `txn_version` (string; uint64; path; required): a version of the transaction to retrieve.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/transactions/by_version/{txn_version} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ``` --- ### Get account transactions > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/transactions`** Retrieves on-chain committed transactions from an account. If the start version is too far in the past, a 410 will be returned. If no start version is given, it will start at version 0. To retrieve a pending transaction, use [Get transaction by hash](#get-transaction-by-hash). #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `limit` (integer; query): a max number of transactions to retrieve. If not provided, retrieves a default page size. * `start` (string; uint64; query): a ledger version to start the list of transactions. If not provided, defaults to showing the latest transactions.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/transactions \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ] ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/aptos/accounts/ title: Aptos — Accounts, Blocks, Events, General, Table, Transactions (1/2) source: docs/rpc-service/chains/chains-api/aptos/accounts.mdx --- # Aptos — Accounts, Blocks, Events, General, Table, Transactions (1/2) > API reference for [Aptos](/rpc-service/chains/chains-api/aptos/). [All methods ->](/rpc-service/chains/chains-api/aptos/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/aptos/accounts-p2/) ## Accounts ### Get account > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}`** Returns the authentication key and the sequence number for an account address. Optionally, a ledger version can be specified. If the ledger version is not specified in the request, the latest ledger version is used. #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "sequence_number": "32425224034", "authentication_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } ``` --- ### Get account resources > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/resources`** Retrieves all account resources for a given account and a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` * `limit` (integer; query): max number of account resources to retrieve. If not provided, retrieves a default page size. * `start` (string; query): cursor specifying where to start for pagination. This cursor cannot be derived manually client-side. Instead, you must call this endpoint once without this query parameter specified, and then use the cursor returned in the X-Aptos-Cursor header in the response.
Example: `0000000000000000000000000000000000000000000000000000000000000000012f0000000000000000000000000000000000000000000000000000000000000000010d7374616b696e675f70726f7879 ` #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/resources \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>", "data": { "authentication_key": "0x0000000000000000000000000000000000000000000000000000000000000001", "coin_register_events": { "counter": "0", "guid": { "id": { "addr": "0x1", "creation_num": "0" } } }, "self_address": "0x1", "sequence_number": "0" } } ] ``` --- ### Get account modules > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/modules`** Retrieves all account modules' bytecode for a given account at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` * `limit` (integer; query): max number of account resources to retrieve. If not provided, retrieves a default page size. * `start` (string; query): cursor specifying where to start for pagination. This cursor cannot be derived manually client-side. Instead, you must call this endpoint once without this query parameter specified, and then use the cursor returned in the X-Aptos-Cursor header in the response.
Example: `0000000000000000000000000000000000000000000000000000000000000000012f0000000000000000000000000000000000000000000000000000000000000000010d7374616b696e675f70726f7879 ` #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/modules \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "bytecode": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "abi": { "address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "name": "string", "friends": [ "0x1::aptos_coin" ], "exposed_functions": [ { "name": "string", "visibility": "private", "is_entry": true, "generic_type_params": [ { "constraints": [ "string" ] } ], "params": [ "string" ], "return": [ "string" ] } ], "structs": [ { "name": "string", "is_native": true, "abilities": [ "string" ], "generic_type_params": [ { "constraints": [ "string" ] } ], "fields": [ { "name": "string", "type": "string" } ] } ] } } ] ``` --- ### Get account resource > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/resource/{resource_type}`** Retrieves an individual resource from a given account and at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `resource_type` (string; path; required) a name of struct to retrieve.
Example: `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>`
Match pattern: `^0x[0-9a-zA-Z:_<>]+$` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/resource/{resource_type} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>", "data": { "authentication_key": "0x0000000000000000000000000000000000000000000000000000000000000001", "coin_register_events": { "counter": "0", "guid": { "id": { "addr": "0x1", "creation_num": "0" } } }, "self_address": "0x1", "sequence_number": "0" } } ``` --- ### Get account module > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/module/{module_name}`** Retrieves an individual module from a given account and at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `module_name` (string; path; required): a name of module to retrieve (example: `coin`). * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/module/{module_name} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "bytecode": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "abi": { "address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "name": "string", "friends": [ "0x1::aptos_coin" ], "exposed_functions": [ { "name": "string", "visibility": "private", "is_entry": true, "generic_type_params": [ { "constraints": [ "string" ] } ], "params": [ "string" ], "return": [ "string" ] } ], "structs": [ { "name": "string", "is_native": true, "abilities": [ "string" ], "generic_type_params": [ { "constraints": [ "string" ] } ], "fields": [ { "name": "string", "type": "string" } ] } ] } } ``` --- ## Blocks ### Get blocks by height > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/blocks/by_height/{block_height}`** This endpoint allows you to get the transactions in a block and the corresponding block information. Transactions are limited by max default transactions size. If not all transactions are present, the user will need to query for the rest of the transactions via the get transactions API. If the block is pruned, it will return a 410 #### Parameters * `block_height` (integer; path; required): a block height to look up. Starts at 0. * `with_transactions` (boolean; query): if set to true, includes all transactions in the block. If not provided, no transactions will be retrieved. #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/blocks/by_height/{block_height} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "block_height": "32425224034", "block_hash": "string", "block_timestamp": "32425224034", "first_version": "32425224034", "last_version": "32425224034", "transactions": [ { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ] } ``` --- ### Get blocks by version > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/blocks/by_version/{version}`** This endpoint allows you to get the transactions in a block and the corresponding block information given a version in the block. Transactions are limited by max default transactions size. If not all transactions are present, the user will need to query for the rest of the transactions via the get transactions API. If the block has been pruned, it will return a 410 #### Parameters * `version` (integer; path; required): a ledger version to look up block information for. * `with_transactions` (boolean; query): if set to true, includes all transactions in the block. If not provided, no transactions will be retrieved. #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/blocks/by_version/{version} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "block_height": "32425224034", "block_hash": "string", "block_timestamp": "32425224034", "first_version": "32425224034", "last_version": "32425224034", "transactions": [ { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ] } ``` --- ## Events ### Get events by creation number > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/events/{creation_number}`** Event types are globally identifiable by an account `address` and monotonically increasing `creation_number`, one per event type emitted to the given account. This API returns events corresponding to that that event type. #### Parameters * `address` (string; hex; path; required): a hex-encoded 32 byte Aptos account, with or without a `0x` prefix, for which events are queried. This refers to the account that events were emitted to, not the account hosting the move module that emits that event type.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `creation_number` (string; uint64; path; required): a creation number corresponding to the event stream originating from the given account. * `limit` (integer; query): max number of events to retrieve. If unspecified, defaults to default page size. * `start` (string; uint64; query): the starting sequence number of events. If unspecified, by default will retrieve the most recent events.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/events/{creation_number} \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "version": "32425224034", "guid": { "creation_number": "32425224034", "account_address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " }, "sequence_number": "32425224034", "type": "string", "data": null } ] ``` --- ### Get events by event handle > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/events/{event_handle}/{field_name}`** This API uses the given account `address`, `eventHandle`, and `fieldName` to build a key that can globally identify an event types. It then uses this key to return events emitted to the given account matching that event type. #### Parameters * `address` (string; hex; path; required): a hex-encoded 32 byte Aptos account, with or without a `0x` prefix, for which events are queried. This refers to the account that events were emitted to, not the account hosting the move module that emits that event type.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `event_handle` (string; path; required): a name of struct to look up event handle.
Example: `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>`
Match pattern: `^0x[0-9a-zA-Z:_<>]+$` * `field_name` (string; path; required): a name of field to look up event handle (example: `withdraw_events`). * `limit` (integer; query): max number of events to retrieve. If unspecified, defaults to default page size. * `start` (string; uint64; query): the starting sequence number of events. If unspecified, by default will retrieve the most recent events.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/accounts/{address}/events/{event_handle}/{field_name} \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "version": "32425224034", "guid": { "creation_number": "32425224034", "account_address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " }, "sequence_number": "32425224034", "type": "string", "data": null } ] ``` --- ## General ### Get ledger info > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/`** Retrieves the latest ledger information, including data such as chain ID, role type, ledger versions, epoch, etc. #### Parameters None. #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/ \ -H 'Content-Type: application/json' ``` #### Response example ```json { "chain_id": 0, "epoch": "32425224034", "ledger_version": "32425224034", "oldest_ledger_version": "32425224034", "ledger_timestamp": "32425224034", "node_role": "validator", "oldest_block_height": "32425224034", "block_height": "32425224034", "git_hash": "string" } ``` --- ## Table ### Get table item > **POST `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/tables/{table_handle}/item`** Get a table item at a specific ledger version from the table identified by `{table_handle}` in the path and the "key" (TableItemRequest) provided in the request body. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `table_handle` (string; hex; path; required): a table handle hex encoded 32-byte string.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` * `key_type` (string; body; required): a string representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>`
``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match patterns: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `value_type` (string; body; required): a string representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>`
``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match pattern: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `key` (body; required): the value of the table item's key. #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/aptos/YOUR_ANKR_API_KEY/v1/tables/{table_handle}/item \ -H 'Content-Type: application/json' \ -d '{ "key_type": "string", "value_type": "string", "key": null }' ``` #### Response example ```json 0 ``` --- ### Get raw table item > **POST `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/tables/{table_handle}/raw_item`** Get a table item at a specific ledger version from the table identified by `{table_handle}` in the path and the "key" (RawTableItemRequest) provided in the request body. The `get_raw_table_item` requires only a serialized key comparing to the full move type information comparing to the `get_table_item` api, and can only return the query in the bcs format. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `table_handle` (string; hex; path; required): a table handle hex encoded 32-byte string.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` * `key` (string; hex; body; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/aptos/YOUR_ANKR_API_KEY/v1/tables/{table_handle}/item \ -H 'Content-Type: application/json' \ -d '{ "key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " }' ``` #### Response example ```json 0 ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/aptos/ title: Aptos description: The Aptos blockchain, designed with scalability, safety, reliability, and upgradability as key principles, to… Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/aptos/index.mdx --- # Aptos
> Aptos API is available on [Web3 API platform](https://www.ankr.com/rpc/aptos). The *Aptos* blockchain, designed with scalability, safety, reliability, and upgradability as key principles, to address blockchain challenges, such as frequent outages, high costs, low throughput limits, and security concerns. The Aptos blockchain has been developed over the past three years by over 350+ developers across the globe. It offers new and novel innovations in consensus, smart contract design, system security, performance, and decentralization. The combination of these technologies will provide a fundamental building block to bring web3 to the masses. In order for your Web3 application to interact with the Aptos blockchain — either by reading blockchain data or sending transactions to the network — it must connect to an Aptos node. Developers interact with the blockchain using the methods provided by the API. Aptos API uses the REST interface for querying, responses come in [JSON format](https://www.json.org/json-en.html). ## Methods supported **Accounts**: * [Get account](/rpc-service/chains/chains-api/aptos/accounts/#get-account) — retrieves the authentication key and the sequence number for an account address. * [Get account resources](/rpc-service/chains/chains-api/aptos/accounts/#get-account-resources) — retrieves all account resources for a given account and a specific ledger version. * [Get account modules](/rpc-service/chains/chains-api/aptos/accounts/#get-account-modules) — retrieves all account modules' bytecode for a given account at a specific ledger version. * [Get account resource](/rpc-service/chains/chains-api/aptos/accounts/#get-account-resource) — retrieves an individual resource from a given account and at a specific ledger version. * [Get account module](/rpc-service/chains/chains-api/aptos/accounts/#get-account-module) — retrieves an individual module from a given account and at a specific ledger version. **Blocks**: * [Get blocks by height](/rpc-service/chains/chains-api/aptos/accounts/#get-blocks-by-height) — retrieves the transactions in a block and the corresponding block information. * [Get blocks by version](/rpc-service/chains/chains-api/aptos/accounts/#get-blocks-by-version) — retrieves the transactions in a block and the corresponding block information by version in the block. **Events**: * [Get events by creation number](/rpc-service/chains/chains-api/aptos/accounts/#get-events-by-creation-number) — retrieves events by creation number. * [Get events by event handle](/rpc-service/chains/chains-api/aptos/accounts/#get-events-by-event-handle) — retrieves events by event handle. **General**: * [Get ledger info](/rpc-service/chains/chains-api/aptos/accounts/#get-ledger-info) — retrieves the latest ledger information. **Table**: * [Get table item](/rpc-service/chains/chains-api/aptos/accounts/#get-table-item) — retrieves a table item. * [Get raw table item](/rpc-service/chains/chains-api/aptos/accounts/#get-raw-table-item) — retrieves a raw table item. **Transactions**: * [Get transactions](/rpc-service/chains/chains-api/aptos/accounts-p2/#get-transactions) — retrieves on-chain committed transactions. * [Submit transaction](/rpc-service/chains/chains-api/aptos/accounts-p2/#submit-transaction) — submits a transaction in JSON or BCS. * [Get transaction by hash](/rpc-service/chains/chains-api/aptos/accounts-p2/#get-transaction-by-hash) — retrieves a transaction by its hash. * [Get transaction by version](/rpc-service/chains/chains-api/aptos/accounts-p2/#get-transaction-by-version) — retrieves a transaction by a given version. * [Get account transactions](/rpc-service/chains/chains-api/aptos/accounts-p2/#get-account-transactions) — retrieves on-chain committed transactions from an account. * [Submit batch transactions](/rpc-service/chains/chains-api/aptos/transactions/#submit-batch-transactions) — submits multiple transactions. * [Simulate transaction](/rpc-service/chains/chains-api/aptos/transactions-p2/#simulate-transaction) — simulates transaction submission. * [Encode submission](/rpc-service/chains/chains-api/aptos/transactions-p2/#encode-submission) — accepts an EncodeSubmissionRequest, which internally is a UserTransactionRequestInner (and optionally secondary signers) encoded as JSON, validates the request format, and then returns that request encoded in BCS. * [Estimate gas price](/rpc-service/chains/chains-api/aptos/transactions-p3/#estimate-gas-price) — estimates gas price. **View**: * [Execute view function of a module](/rpc-service/chains/chains-api/aptos/transactions-p3/#execute-view-function-of-a-module) — executes the Move function with the given parameters and return its execution result. --- ## Methods ### Accounts, Blocks, Events, General, Table, Transactions - [`Get account`](/rpc-service/chains/chains-api/aptos/accounts/#get-account) - [`Get account resources`](/rpc-service/chains/chains-api/aptos/accounts/#get-account-resources) - [`Get account modules`](/rpc-service/chains/chains-api/aptos/accounts/#get-account-modules) - [`Get account resource`](/rpc-service/chains/chains-api/aptos/accounts/#get-account-resource) - [`Get account module`](/rpc-service/chains/chains-api/aptos/accounts/#get-account-module) - [`Get blocks by height`](/rpc-service/chains/chains-api/aptos/accounts/#get-blocks-by-height) - [`Get blocks by version`](/rpc-service/chains/chains-api/aptos/accounts/#get-blocks-by-version) - [`Get events by creation number`](/rpc-service/chains/chains-api/aptos/accounts/#get-events-by-creation-number) - [`Get events by event handle`](/rpc-service/chains/chains-api/aptos/accounts/#get-events-by-event-handle) - [`Get ledger info`](/rpc-service/chains/chains-api/aptos/accounts/#get-ledger-info) - [`Get table item`](/rpc-service/chains/chains-api/aptos/accounts/#get-table-item) - [`Get raw table item`](/rpc-service/chains/chains-api/aptos/accounts/#get-raw-table-item) - [`Get transactions`](/rpc-service/chains/chains-api/aptos/accounts-p2/#get-transactions) - [`Submit transaction`](/rpc-service/chains/chains-api/aptos/accounts-p2/#submit-transaction) - [`Get transaction by hash`](/rpc-service/chains/chains-api/aptos/accounts-p2/#get-transaction-by-hash) - [`Get transaction by version`](/rpc-service/chains/chains-api/aptos/accounts-p2/#get-transaction-by-version) - [`Get account transactions`](/rpc-service/chains/chains-api/aptos/accounts-p2/#get-account-transactions) ### Transactions, View - [`Submit batch transactions`](/rpc-service/chains/chains-api/aptos/transactions/#submit-batch-transactions) - [`Simulate transaction`](/rpc-service/chains/chains-api/aptos/transactions-p2/#simulate-transaction) - [`Encode submission`](/rpc-service/chains/chains-api/aptos/transactions-p2/#encode-submission) - [`Estimate gas price`](/rpc-service/chains/chains-api/aptos/transactions-p3/#estimate-gas-price) - [`Execute view function of a module`](/rpc-service/chains/chains-api/aptos/transactions-p3/#execute-view-function-of-a-module) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/aptos/transactions-p2/ title: Aptos — Transactions, View (2/3) source: docs/rpc-service/chains/chains-api/aptos/transactions-p2.mdx --- # Aptos — Transactions, View (2/3) > API reference for [Aptos](/rpc-service/chains/chains-api/aptos/). [All methods ->](/rpc-service/chains/chains-api/aptos/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/aptos/transactions/) · 2 · [3](/rpc-service/chains/chains-api/aptos/transactions-p3/) ### Simulate transaction > **POST `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/transactions/simulate`** Simulates a transaction. The output of the transaction will have the exact transaction outputs and events that running an actual signed transaction would have. However, it will not have the associated state hashes, as they are not updated in storage. This can be used to estimate the maximum gas units for a submitted transaction. To use this, you must: * Create a SignedTransaction with a zero-padded signature. * Submit a SubmitTransactionRequest containing a UserTransactionRequest containing that signature. To use this endpoint with BCS, you must submit a SignedTransaction encoded as BCS. #### Parameters * `estimate_gas_unit_price` (boolean, query): if set to true, the gas unit price in the transaction will be ignored and the estimated value will be used. * `estimate_max_gas_amount` (boolean; query): if set to true, the max gas value in the transaction will be ignored and the maximum possible gas will be used. * `estimate_prioritized_gas_unit_price` (boolean; query): if set to true, the transaction will use a higher price than the original estimate. **Body** A request body is represented by an array of the following parameters: * `sender` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `sequence_number` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `max_gas_amount` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `gas_unit_price` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `expiration_timestamp_secs` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `payload` (object; required): a payload is one of the following objects: 1. A payload which runs a single entry function: * `type` (string; required): a payload type. Example: `entry_function_payload`. * `function` (string; required): an entry function ID is a string representation of an entry function defined on-chain.
Format: `{address}::{module name}::{function name}`
Both `module name` and `function name` are case-sensitive.
Example: `0x1::aptos_coin::transfer` * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 2. A payload which runs a script that can run multiple functions: * `type` (string; required): a payload type. Example: `script_payload`. * `code` (object; required): a Move script bytecode: * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move function: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]: required): a return type of the function. * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 3. An enum of possible transaction payloads: * `type` (string; required): a payload type. Example: `module_bundle_payload`. * `modules` (array[object]; required): * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move module: * `address` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `name` (string; required): a name of the module. * `friends` (array[string]: required): friends of the module. * `exposed_functions` (array[object]; required): public functions of the module: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]; required): a return type of the function. * `structs` (array[object]; required): structs of the module: * `name` (string; required): a name of the struct. * `is_native` (boolean; required): whether the struct is a native struct of Move. * `abilities` (array[string]; required): abilities associated with the struct. * `generic_type_params` (array[object]; required): generic types associated with the struct: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the type that uses it. * `fields` (array[object]; required): fields associated with the struct: * `name` (string; required): a name of the field. * `type` (string; required): a string representation of an on-chain Move type tag that is exposed in transaction payload.
Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` ``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match pattern: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `signature` (object; required): a signature is one of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a signature type. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 3. A multi-agent signature for multi-agent transactions (allows you to have transactions across multiple accounts): * `type` (string; required): a type of signature. Example: `multi_agent_signature`. * `sender` (object; required): a sender is on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of sender signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of sender signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `secondary_signer_addresses` (array[string]; hex; required): the other involved parties' addresses. * `secondary_signers` (array of objects): an array of on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of secondary signers' signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of secondary signers' signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/aptos/YOUR_ANKR_API_KEY/v1/transactions/simulate \ -H 'Content-Type: application/json' \ -d '{ "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } }' ``` #### Response example ```json [ { "version": "32425224034", "hash": "string", "state_change_hash": "string", "event_root_hash": "string", "state_checkpoint_hash": "string", "gas_used": "32425224034", "success": true, "vm_status": "string", "accumulator_root_hash": "string", "changes": [ { "type": "delete_module", "address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "state_key_hash": "string", "module": "0x1::aptos_coin" } ], "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " }, "events": [ { "guid": { "creation_number": "32425224034", "account_address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " }, "sequence_number": "32425224034", "type": "string", "data": null } ], "timestamp": "32425224034" } ] ``` --- ### Encode submission > **POST `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/transactions/encode_submission`** This endpoint accepts an EncodeSubmissionRequest, which internally is a UserTransactionRequestInner (and optionally secondary signers) encoded as JSON, validates the request format, and then returns that request encoded in BCS. The client can then use this to create a transaction signature to be used in a SubmitTransactionRequest, which it then passes to the [Submit transaction](/rpc-service/chains/chains-api/aptos/accounts-p2/#submit-transaction) POST endpoint. To be clear, this endpoint makes it possible to submit transaction requests to the API from languages that do not have library support for BCS. If you are using an SDK that has BCS support, such as the official Rust, TypeScript, or Python SDKs, you do not need to use this endpoint. To sign a message using the response from this endpoint: * Decode the hex encoded string in the response to bytes. * Sign the bytes to create the signature. * Use that as the signature field in something like Ed25519Signature, which you then use to build a TransactionSignature. #### Parameters Submission encoding request body contains the following parameters: * `sender` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `sequence_number` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `max_gas_amount` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `gas_unit_price` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `expiration_timestamp_secs` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `payload` (object; required): a payload is one of the following objects: 1. A payload which runs a single entry function: * `type` (string; required): a payload type. Example: `entry_function_payload`. * `function` (string; required): an entry function ID is a string representation of an entry function defined on-chain.
Format: `{address}::{module name}::{function name}`
Both `module name` and `function name` are case-sensitive.
Example: `0x1::aptos_coin::transfer` * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 2. A payload which runs a script that can run multiple functions: * `type` (string; required): a payload type. Example: `script_payload`. * `code` (object; required): a Move script bytecode: * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move function: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]: required): a return type of the function. * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 3. An enum of possible transaction payloads: * `type` (string; required): a payload type. Example: `module_bundle_payload`. * `modules` (array[object]; required): * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move module: * `address` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `name` (string; required): a name of the module. * `friends` (array[string]: required): friends of the module. * `exposed_functions` (array[object]; required): public functions of the module: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]; required): a return type of the function. * `structs` (array[object]; required): structs of the module: * `name` (string; required): a name of the struct. * `is_native` (boolean; required): whether the struct is a native struct of Move. * `abilities` (array[string]; required): abilities associated with the struct. * `generic_type_params` (array[object]; required): generic types associated with the struct: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the type that uses it. * `fields` (array[object]; required): fields associated with the struct: * `name` (string; required): a name of the field. * `type` (string; required): a string representation of an on-chain Move type tag that is exposed in transaction payload.
Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` ``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match pattern: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `secondary_signers` (array[string]; hex): secondary signer accounts of the request for Multi-agent. #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/aptos/YOUR_ANKR_API_KEY/v1/transactions/encode_submission \ -H 'Content-Type: application/json' \ -d '{ "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "secondary_signers": [ "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " ] }' ``` --- #### Response example ```json 0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/aptos/transactions-p3/ title: Aptos — Transactions, View (3/3) source: docs/rpc-service/chains/chains-api/aptos/transactions-p3.mdx --- # Aptos — Transactions, View (3/3) > API reference for [Aptos](/rpc-service/chains/chains-api/aptos/). [All methods ->](/rpc-service/chains/chains-api/aptos/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/aptos/transactions/) · [2](/rpc-service/chains/chains-api/aptos/transactions-p2/) · 3 ### Estimate gas price > **GET `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/estimate_gas_price`** Currently, the gas estimation is handled by taking the median of the last 100,000 transactions If a user wants to prioritize their transaction and is willing to pay, they can pay more than the gas price. If they're willing to wait longer, they can pay less. Note that the gas price moves with the fee market, and should only increase when demand outweighs supply. If there have been no transactions in the last 100,000 transactions, the price will be 1. #### Parameters None. #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/estimate_gas_price \ -H 'Content-Type: application/json' ``` #### Response example ```json { "deprioritized_gas_estimate": 0, "gas_estimate": 0, "prioritized_gas_estimate": 0 } ``` --- ## View ### Execute view function of a module > **POST `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/view`** Executes the Move function with the given parameters and return its execution result. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` **Body** The Move view function request body contains the following parameters: * `function` (string; required): an entry function ID is a string representation of an entry function defined on-chain.
Format: `{address}::{module name}::{function name}`
Both the module name and function name are case-sensitive.
Example: `0x1::aptos_coin::transfer` * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/aptos/YOUR_ANKR_API_KEY/v1/view \ -H 'Content-Type: application/json' \ -d '{ "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }' ``` #### Response example ```json [ 0 ] ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/aptos/transactions/ title: Aptos — Transactions, View (1/3) source: docs/rpc-service/chains/chains-api/aptos/transactions.mdx --- # Aptos — Transactions, View (1/3) > API reference for [Aptos](/rpc-service/chains/chains-api/aptos/). [All methods ->](/rpc-service/chains/chains-api/aptos/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/aptos/transactions-p2/) · [3](/rpc-service/chains/chains-api/aptos/transactions-p3/) ### Submit batch transactions > **POST `https://rpc.ankr.com/premium-http/aptos/YOUR_ANKR_API_KEY/v1/transactions/batch`** Submits multiple transactions. The response has three outcomes: 1. All transactions succeed, and it will return a 202. 2. Some transactions succeed, and it will return the failed transactions and a 206. 3. No transactions succeed, and it will also return the failed transactions and a 206. To submit a transaction as JSON, you must submit a SubmitTransactionRequest. To build this request, do the following: 1. Encode the transaction as BCS. If you are using a language that has native BCS support, make sure to use that library. If not, you may take advantage of [Encode submission](/rpc-service/chains/chains-api/aptos/transactions-p2/#encode-submission). When using this endpoint, make sure you trust the node you're talking to, as it is possible they could manipulate your request. 2. Sign the encoded transaction and use it to create a TransactionSignature. 3. Submit the request. Make sure to use the "application/json" Content-Type. To submit a transaction as BCS, you must submit a SignedTransaction encoded as BCS. Make sure to use the application/x.aptos.signed_transaction+bcs Content-Type. #### Parameters A request body is represented by an array of the following parameters: * `sender` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `sequence_number` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `max_gas_amount` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `gas_unit_price` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `expiration_timestamp_secs` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `payload` (object; required): a payload is one of the following objects: 1. A payload which runs a single entry function: * `type` (string; required): a payload type. Example: `entry_function_payload`. * `function` (string; required): an entry function ID is a string representation of an entry function defined on-chain.
Format: `{address}::{module name}::{function name}`
Both `module name` and `function name` are case-sensitive.
Example: `0x1::aptos_coin::transfer` * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 2. A payload which runs a script that can run multiple functions: * `type` (string; required): a payload type. Example: `script_payload`. * `code` (object; required): a Move script bytecode: * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move function: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]: required): a return type of the function. * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 3. An enum of possible transaction payloads: * `type` (string; required): a payload type. Example: `module_bundle_payload`. * `modules` (array[object]; required): * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move module: * `address` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `name` (string; required): a name of the module. * `friends` (array[string]: required): friends of the module. * `exposed_functions` (array[object]; required): public functions of the module: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]; required): a return type of the function. * `structs` (array[object]; required): structs of the module: * `name` (string; required): a name of the struct. * `is_native` (boolean; required): whether the struct is a native struct of Move. * `abilities` (array[string]; required): abilities associated with the struct. * `generic_type_params` (array[object]; required): generic types associated with the struct: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the type that uses it. * `fields` (array[object]; required): fields associated with the struct: * `name` (string; required): a name of the field. * `type` (string; required): a string representation of an on-chain Move type tag that is exposed in transaction payload.
Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` ``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match pattern: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `signature` (object; required): a signature is one of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a signature type. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 3. A multi-agent signature for multi-agent transactions (allows you to have transactions across multiple accounts): * `type` (string; required): a type of signature. Example: `multi_agent_signature`. * `sender` (object; required): a sender is on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of sender signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of sender signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `secondary_signer_addresses` (array[string]; hex; required): the other involved parties' addresses. * `secondary_signers` (array of objects): an array of on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of secondary signers' signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of secondary signers' signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/aptos/YOUR_ANKR_API_KEY/v1/transactions/batch \ -H 'Content-Type: application/json' -d '[ { "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ]' ``` #### Response example ```json { "transaction_failures": [ { "error": { "message": "string", "error_code": "account_not_found", "vm_error_code": 0 }, "transaction_index": 0 } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/arbitrum-nova/ title: Arbitrum Nova description: Arbitrum Nova offers an ultra-low transaction costs with high security. 27 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/arbitrum-nova/index.mdx --- # Arbitrum Nova
> Arbitrum Nova API is available on [Web3 API platform](https://www.ankr.com/rpc/arbitrumnova). *Arbitrum Nova* offers an ultra-low transaction costs with high security. Nova powers dapps with high transaction volumes that seek to drive costs even lower. In order for your Web3 application to interact with Arbitrum Nova — either by reading blockchain data or sending transactions to the network — it must connect to an Arbitrum Nova node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/arbitrum-nova/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/ title: Arbitrum Nova — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/arbitrum-nova/web3-p2.mdx --- # Arbitrum Nova — web3, net, eth (2/3) > API reference for [Arbitrum Nova](/rpc-service/chains/chains-api/arbitrum-nova/). [All methods ->](/rpc-service/chains/chains-api/arbitrum-nova/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/arbitrum-nova/web3/) · 2 · [3](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":"0x07f327929A3A3131EB4BE83f784DBD3E5C2698f8"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xfb79" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes; required): a block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x01851296020b91cb47ac6bd926da14fb24c24eb3512a979136d9446b82f5f819", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x989680", "difficulty": "0x1", "extraData": "0x1182fdff4a2945d6ab76bc47a4a3366e644b97bf4136b6418d0a613182a643b7", "gasLimit": "0x4000000000000", "gasUsed": "0x7909", "hash": "0x01851296020b91cb47ac6bd926da14fb24c24eb3512a979136d9446b82f5f819", "l1BlockNumber": "0xfe78a9", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xa4b000000000000000000073657175656e636572", "mixHash": "0x0000000000003bf10000000000fe78a9000000000000000a0000000000000000", "nonce": "0x0000000000021e99", "number": "0x2586fc", "parentHash": "0xe3fb34fa71fc5c293937abb64b98060f1934fb371673ee1b205ca3d5b61ba7da", "receiptsRoot": "0x7ced3427a01d1dd989376f5b813e9c9a1253344905d0e7cbcc0a687827f92f9c", "sendCount": "0x3bf1", "sendRoot": "0x1182fdff4a2945d6ab76bc47a4a3366e644b97bf4136b6418d0a613182a643b7", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x32c", "stateRoot": "0xd23d3f92d74a6435238f719981dd0e2b1ddfe535b737fa507396d0ecc7e070e6", "timestamp": "0x63f4c05c", "totalDifficulty": "0x2586fd", "transactions": [ "0xd9bce4bd8bf9daaa8f00c91d85b78a4ca6583ddd092ea1e128c7c6d11b314a20", "0x8586de57de4896b97ff97ec96a2b01b8b05798a09e4fe4e5403c99e0fea67e49" ], "transactionsRoot": "0x8f62bc998fb30c85671182064494701b0df155f46fc69c2e62ee11987fdf05b2", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag; required): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x3C962", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5f5e100", "difficulty": "0x1", "extraData": "0x64d4a7abaa7fc93f447254c02b05b20b0ecb02b9ff5201f7bb24dc7faf781954", "gasLimit": "0x4000000000000", "gasUsed": "0x3a899", "hash": "0x19d53ccf46e19a5097495d619fc191ed8fcbcfbb6f15a3cdb9e8d702fe7f3af3", "l1BlockNumber": "0xec021b", "logsBloom": "0x00000000000000000000001010000040000000000001000000000000000000000040000000000010000000084002000000000000000000000000000000000800000000000008040000800008000000000000000008000000000000000000000000000000020000000000000000000800000000000000000000000010000000000000400000000000000000010000000000000008000000000000000040000000000000000000000000000000401000000a00000000000000000000000000000000001402040000000400000000000000000002400000000000000000000020000000000008000000000000000040008000000001004000000000000000000000", "miner": "0xa4b000000000000000000073657175656e636572", "mixHash": "0x00000000000006170000000000ec021b00000000000000050000000000000000", "nonce": "0x000000000000633f", "number": "0x3c962", "parentHash": "0xd8c8730646435745391753b96bab79b8b0c6b1159556f8916c1136bf3606c50f", "receiptsRoot": "0x8520e430daf00bedbcf1de7327cf003468e435e0b9c4c36a157ed7ab94bedb93", "sendCount": "0x617", "sendRoot": "0x64d4a7abaa7fc93f447254c02b05b20b0ecb02b9ff5201f7bb24dc7faf781954", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x433", "stateRoot": "0x2c23077018de41f5ce90ccca8363fed3b99465b674c055b4f378d023cc09c67b", "timestamp": "0x6313a16f", "totalDifficulty": "0x3c963", "transactions": [ "0x1b54ecdb00015fa4d402880c07f8c8c823091f0ec08555b6d8877846f68f5ba9", "0x891f6f0436a33b36fff9760a433be9963d6eee1ec1a6c3d187871e42e74cfd46" ], "transactionsRoot": "0xa7ff40e60c8bee96add8493bf034ac340625ab189d62314115a7e4a27d3a9e75", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes; required): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x162e65b69d5afeba2ddecff3df893fb90413cda0e198a8797bc5d02ff327e2e7"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x07460b2f6ee380d7ab3488e30c1ee90352db1dcb1de711e6c6896e2149ac58d2", "blockNumber": "0x2586f8", "from": "0x6d809d5399ddf9bb2261bb2d8ec242c162f38923", "gas": "0xd884", "gasPrice": "0x989680", "maxFeePerGas": "0xcdfe60", "maxPriorityFeePerGas": "0x0", "hash": "0x162e65b69d5afeba2ddecff3df893fb90413cda0e198a8797bc5d02ff327e2e7", "input": "0xd0e30db0", "nonce": "0x50", "to": "0x722e8bdd2ce80a4422e880164f2079488e115365", "transactionIndex": "0x1", "value": "0x11c37937e08000", "type": "0x2", "accessList": [], "chainId": "0xa4ba", "v": "0x1", "r": "0x159d1e1a92b2153f70c7d2d99b6571dd2f1acba71c9c65f74a75c409aa66c034", "s": "0x2bac0216abf06b2c12c8b2c09dcbc1b437e54717b324897f9babcf6a2b56772" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes; required): a block hash. 2. `` (quantity; required): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "blockNumber": "0x3c962", "from": "0x0639556f03714a74a5feeaf5736a4a64ff70d206", "gas": "0x5208", "gasPrice": "0x165a0bc00", "maxFeePerGas": "0x165a0bc00", "maxPriorityFeePerGas": "0x165a0bc00", "hash": "0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342", "input": "0x", "nonce": "0x188", "to": "0x279bc70bc870f55546639924a00e1b1e02f3b61d", "transactionIndex": "0x0", "value": "0x2a06487cbac738000", "type": "0x2", "accessList": [], "chainId": "0x39", "v": "0x1", "r": "0x4271c455b615ce98d036030b30cdfdc5e1c79420caaf3907cd65bbaa49b1889e", "s": "0x1c360f303a21b8df3dbb3b970925f07ba707046593015d30c820f617485d7683" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity; required): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x3C962", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "blockNumber": "0x3c962", "from": "0x0639556f03714a74a5feeaf5736a4a64ff70d206", "gas": "0x5208", "gasPrice": "0x165a0bc00", "maxFeePerGas": "0x165a0bc00", "maxPriorityFeePerGas": "0x165a0bc00", "hash": "0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342", "input": "0x", "nonce": "0x188", "to": "0x279bc70bc870f55546639924a00e1b1e02f3b61d", "transactionIndex": "0x0", "value": "0x2a06487cbac738000", "type": "0x2", "accessList": [], "chainId": "0x39", "v": "0x1", "r": "0x4271c455b615ce98d036030b30cdfdc5e1c79420caaf3907cd65bbaa49b1889e", "s": "0x1c360f303a21b8df3dbb3b970925f07ba707046593015d30c820f617485d7683" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/ title: Arbitrum Nova — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/arbitrum-nova/web3-p3.mdx --- # Arbitrum Nova — web3, net, eth (3/3) > API reference for [Arbitrum Nova](/rpc-service/chains/chains-api/arbitrum-nova/). [All methods ->](/rpc-service/chains/chains-api/arbitrum-nova/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/arbitrum-nova/web3/) · [2](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes; required): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "blockNumber": "0x3c962", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x165a0bc00", "from": "0x0639556f03714a74a5feeaf5736a4a64ff70d206", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x279bc70bc870f55546639924a00e1b1e02f3b61d", "transactionHash": "0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342", "transactionIndex": "0x0", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes; required): the hash of a block. 2. `` (quantity; required): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity; required): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x3C962", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either a hex of the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x1D220215ddBd0A9F525b56A400C24487Ed696000"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/arbitrum-nova/web3/ title: Arbitrum Nova — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/arbitrum-nova/web3.mdx --- # Arbitrum Nova — web3, net, eth (1/3) > API reference for [Arbitrum Nova](/rpc-service/chains/chains-api/arbitrum-nova/). [All methods ->](/rpc-service/chains/chains-api/arbitrum-nova/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/arbitrum-nova/web3-p2/) · [3](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "nitro/vv2.0.11-8e786ec/linux-amd64/go1.19.5", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data; required): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "42170" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x989680" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x258290" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address to check for balance. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xDe01a19B76b31040860eD061827c73d91B07947a", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1229ca8a77520" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address of the storage (hex encoded). 2. `` (quantity; required): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xDe01a19B76b31040860eD061827c73d91B07947a", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x475a82B8CA56740C6C965625bA06BBe7bB33D88d", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x8" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes; required): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x185dbc690d43d1c8fed6f5df6d28538250953453f3fc174d208229390a1a3226"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x258704"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes; required): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xd84165bd25576bec1013a95918996d48fc3d4253925236f7303a4ba28a9d8e51"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x2586FC"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address to get the code from. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xb1398c4D958B97c181Df60148678f04eCEc62c69", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data; required): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/arbitrum-nova/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded; required): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/arbitrum/eth-p2/ title: Arbitrum — eth, debug (2/2) source: docs/rpc-service/chains/chains-api/arbitrum/eth-p2.mdx --- # Arbitrum — eth, debug (2/2) > API reference for [Arbitrum](/rpc-service/chains/chains-api/arbitrum/). [All methods ->](/rpc-service/chains/chains-api/arbitrum/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/arbitrum/eth/) · 2 ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Arbitrum blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/arbitrum/eth/ title: Arbitrum — eth, debug (1/2) source: docs/rpc-service/chains/chains-api/arbitrum/eth.mdx --- # Arbitrum — eth, debug (1/2) > API reference for [Arbitrum](/rpc-service/chains/chains-api/arbitrum/). [All methods ->](/rpc-service/chains/chains-api/arbitrum/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/arbitrum/eth-p2/) ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0xA00000", "toBlock": "0xA00010", "address": "0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe", "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"] }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Arbitrum blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0x00ce359860d877197c27559e19900a2021644dc1979017364e409e25411b8799", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0xd2a3cf11f26051b63d8493a31e46973fd0f53a49f7d2797262b346a1efc1da19", "result": { "beforeEVMTransfers": [], "afterEVMTransfers": [], "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasUsed": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "input": "0x6bf6a42d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000631152000000000000000000000000000000000000000000000000000000000438ce1d0000000000000000000000000000000000000000000000000000000000000000", "value": "0x0", "type": "CALL" } } ] } ``` --- ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Arbitrum blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0x438CE1D", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0xd2a3cf11f26051b63d8493a31e46973fd0f53a49f7d2797262b346a1efc1da19", "result": { "beforeEVMTransfers": [], "afterEVMTransfers": [], "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasUsed": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "input": "0x6bf6a42d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000631152000000000000000000000000000000000000000000000000000000000438ce1d0000000000000000000000000000000000000000000000000000000000000000", "value": "0x0", "type": "CALL" } } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/arbitrum/ title: Arbitrum description: Arbitrum is designed to be as compatible and consistent with Ethereum as possible, from its high-level RPCs to… 30 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/arbitrum/index.mdx --- # Arbitrum
> Arbitrum API is available on [Web3 API platform](https://www.ankr.com/rpc/arbitrum). *Arbitrum* is designed to be as compatible and consistent with Ethereum as possible, from its high-level RPCs to its low-level bytecode and everything in between. Dapp developers with experience building on Ethereum will likely find that little-to-no new L2-specific knowledge is required to build on Arbitrum. In order for your Web3 application to interact with the Arbitrum blockchain — either by reading blockchain data or sending transactions to the network — it must connect to an Arbitrum node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format. ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/arbitrum/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/arbitrum/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/arbitrum/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/arbitrum/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/arbitrum/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/arbitrum/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/arbitrum/eth/#eth_getlogs) — returns logs matching the parameters specified. **Premium-only methods (Arbitrum Sepolia Testnet)**: * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/arbitrum/eth/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/arbitrum/eth/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/arbitrum/eth-p2/#debug_traceblock) — traces the execution of all transactions within a block. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/arbitrum/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/arbitrum/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/arbitrum/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/arbitrum/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/arbitrum/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/arbitrum/web3-p3/#eth_gettransactionreceipt) ### eth, debug - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/arbitrum/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/arbitrum/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/arbitrum/eth/#eth_getlogs) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/arbitrum/eth/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/arbitrum/eth/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/arbitrum/eth-p2/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/arbitrum/web3-p2/ title: Arbitrum — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/arbitrum/web3-p2.mdx --- # Arbitrum — web3, net, eth (2/3) > API reference for [Arbitrum](/rpc-service/chains/chains-api/arbitrum/). [All methods ->](/rpc-service/chains/chains-api/arbitrum/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/arbitrum/web3/) · 2 · [3](/rpc-service/chains/chains-api/arbitrum/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x48204" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xc5043f", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa917fcc721a5465a484e9be17cda0cc5493933dd3bc70c9adbee192cb419c9d7", "blockNumber": "0xc5043f", "from": "0x829bd824b016326a401d083b33d092293333a830", "gas": "0x33450", "gasPrice": "0x0", "hash": "0xdf8d8677c9cd5f81d8ee3663a4a64ce7fe93d35fcb46004529e77394630f8e11", "input": "0x", "nonce": "0xa16562", "to": "0x6e2edc2af25cd5704d99ba73ac7ece701f50192d", "transactionIndex": "0x2", "value": "0x20b9632b7dc0a3e", "type": "0x0", "v": "0x26", "r": "0x6fd8d85d440c87e894898ce7c12725eb994d416b0843ae5ddb0f188bc21ac9a2", "s": "0x47fe6bc7bb3ddc8d579509fed960934ab8ed6004152e62b2abca6639393b8e77" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/arbitrum/web3-p3/ title: Arbitrum — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/arbitrum/web3-p3.mdx --- # Arbitrum — web3, net, eth (3/3) > API reference for [Arbitrum](/rpc-service/chains/chains-api/arbitrum/). [All methods ->](/rpc-service/chains/chains-api/arbitrum/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/arbitrum/web3/) · [2](/rpc-service/chains/chains-api/arbitrum/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3c9329b765d88c03d18f87dc1f2b5138c89d9a415d5c73dc7827b87aca176c8e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/arbitrum/web3/ title: Arbitrum — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/arbitrum/web3.mdx --- # Arbitrum — web3, net, eth (1/3) > API reference for [Arbitrum](/rpc-service/chains/chains-api/arbitrum/). [All methods ->](/rpc-service/chains/chains-api/arbitrum/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/arbitrum/web3-p2/) · [3](/rpc-service/chains/chains-api/arbitrum/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "nitro/vv2.0.9-51f9452/linux-amd64/go1.19.4" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "42161" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* ``|``: an object with sync status data or FALSE, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5f5e100" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3681baf" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2c85c3ecfcb5fb" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x36c1d18"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xb6" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 32 bytes): a block's hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0xc5043f"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/arbitrum/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/atleta/ title: Atleta description: Atleta is a modular, multi-layer, EVM-compatible, smart contract platform with native cross-chain… 29 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/atleta/index.mdx --- # Atleta
> Atleta API is available on [Web3 API platform](https://www.ankr.com/rpc/atleta). *Atleta* is a modular, multi-layer, EVM-compatible, smart contract platform with native cross-chain interoperability, dedicated to servicing the sports industry. In order for your Web3 application to interact with Atleta — either by reading blockchain data or sending transactions to the network — it must connect to an Atleta node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/atleta/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/atleta/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/atleta/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/atleta/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_protocolVersion`](/rpc-service/chains/chains-api/atleta/web3/#eth_protocolversion) — returns the current protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/atleta/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/atleta/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/atleta/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/atleta/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/atleta/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/atleta/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/atleta/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/atleta/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/atleta/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/atleta/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/atleta/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/atleta/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/atleta/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/atleta/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/atleta/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/atleta/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/atleta/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/atleta/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/atleta/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/atleta/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/atleta/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/atleta/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/atleta/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/atleta/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/atleta/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/atleta/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/atleta/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/atleta/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/atleta/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/atleta/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/atleta/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/atleta/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/atleta/web3-p2/ title: Atleta — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/atleta/web3-p2.mdx --- # Atleta — web3, net, eth (2/3) > API reference for [Atleta](/rpc-service/chains/chains-api/atleta/). [All methods ->](/rpc-service/chains/chains-api/atleta/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/atleta/web3/) · 2 · [3](/rpc-service/chains/chains-api/atleta/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "data": "0x70a082310000000000000000000000005a93a3f8c5e3eae603b36e3e0805a2e2290b1e82" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "to": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "data": "0xa9059cbb0000000000000000000000005a93a3f8c5e3eae603b36e3e0805a2e2290b1e820000000000000000000000000000000000000000000000000000000000000003e8" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x575f" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xe01796432573b7895f847e042eb6d924776068cc5e7f5a3f2096f71006ced9a0", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "author": "0xa99e38bcf899411fac369257bd8971eddc167e71", "baseFeePerGas": "0x1dcd6500", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x47868c0", "gasUsed": "0x12e5fc", "hash": "0xe01796432573b7895f847e042eb6d924776068cc5e7f5a3f2096f71006ced9a0", "logsBloom": "0x00200000000000000000000080000000000000800000000000800000000400000000000000000000000100100000000000000000000000000000000000000000000000000000000000000008000000200000000000000000000000000000000000000004020000000000040000000800000000000000000000000010000000000400000000100000020000000500000000000000000000080000004000000200000000000000000000000000000200000000000000000000000100000200800000000002000000000000008200000040000000000000001000008000000020000000010000000020000008000000000000000000000000000000000001000000", "miner": "0xa99e38bcf899411fac369257bd8971eddc167e71", "nonce": "0x0000000000000000", "number": "0x282e8e", "parentHash": "0xdaba959bdfcd83404f775f5b1942224b61f426e8a20950fa91b0b403ac2c8da5", "receiptsRoot": "0x676af341605971218e46e9638c5898d479eead4f5fa9d778e8c4b6377984194c", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x4ce", "stateRoot": "0x9bf8ca03c4cc588d5087ede981aaad92a0407498dc84afe9bc1b2b383ca9d7b7", "timestamp": "0x6751a148", "totalDifficulty": "0x0", "transactions": [ "0x2867c9de7f388bfffa93340e147602c78091e4fcf39bece0e7025b476ca6f8eb", "0xdfc7d9c1de3bbee0f3f5fa18205a2dedd5a7fa041bfdba7f77fffc052b5a0a07" ], "transactionsRoot": "0xe619025cf67c585c53a2b4fd612e95eae0cd667e444438faf79bfc1366141739", "uncles": [] }, "id": 1 } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", true], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "author": "0x0c00ec3a3a031f5c9885978dd03a3a4fdb27bcf1", "baseFeePerGas": "0x1dcd6500", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x47868c0", "gasUsed": "0x0", "hash": "0xd2c14a163cee5db0a041f9db15643cf3042108095c5fb756e82581b38aa92a7c", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x0c00ec3a3a031f5c9885978dd03a3a4fdb27bcf1", "nonce": "0x0000000000000000", "number": "0x7b389", "parentHash": "0xef65775f9d84f201b06415ef8c816ff78c1edbe164c308217fa40a5d654c01a7", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x202", "stateRoot": "0x39c114288f38e34c0c3f73279e80ab7099d786d69511fe071ba5e7c33960e01a", "timestamp": "0x6751aacc", "totalDifficulty": "0x0", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x2867c9de7f388bfffa93340e147602c78091e4fcf39bece0e7025b476ca6f8eb"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "type": "0x2", "hash": "0x2867c9de7f388bfffa93340e147602c78091e4fcf39bece0e7025b476ca6f8eb", "nonce": "0x0", "blockHash": "0xe01796432573b7895f847e042eb6d924776068cc5e7f5a3f2096f71006ced9a0", "blockNumber": "0x282e8e", "transactionIndex": "0x0", "from": "0x6245581b9e13143269404ea6f2efa7b99eca53ee", "to": "0x31cac5c91c483a637116934d21565361950e6b7f", "value": "0x8ac7230489e80000", "gas": "0x118f90", "gasPrice": "0x77359400", "maxFeePerGas": "0x7d2b7500", "maxPriorityFeePerGas": "0x59682f00", "input": "0x5ae401dc000000000000000000000000000000000000000000000000000000006751a83f0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000104472b43f30000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000000005f70c277b9dd00000000000000000000000000000000000000000000000000000000000000800000000000000000000000006245581b9e13143269404ea6f2efa7b99eca53ee0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000e26fea44c00802b9cae594974c0a6cbcad5fd8630000000000000000000000009f294c5d5da451e1fa5c2a654cb6d6e394efe2cd000000000000000000000000cda75276918a66d609a55b04570d7b4015a974a000000000000000000000000000000000000000000000000000000000", "creates": null, "chainId": "0x924", "accessList": [], "yParity": "0x0", "v": "0x0", "r": "0xf92ae479d4df56a637835816455621c023aa34a9257928fe4a035ce8a602603a", "s": "0x33f34f08a51a17f5e3e8cff9fc4fe5bdb9956e6b5c34ad44d10e9be250869119" }, "id": 1 } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xe01796432573b7895f847e042eb6d924776068cc5e7f5a3f2096f71006ced9a0", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "type": "0x2", "hash": "0x2867c9de7f388bfffa93340e147602c78091e4fcf39bece0e7025b476ca6f8eb", "nonce": "0x0", "blockHash": "0xe01796432573b7895f847e042eb6d924776068cc5e7f5a3f2096f71006ced9a0", "blockNumber": "0x282e8e", "transactionIndex": "0x0", "from": "0x6245581b9e13143269404ea6f2efa7b99eca53ee", "to": "0x31cac5c91c483a637116934d21565361950e6b7f", "value": "0x8ac7230489e80000", "gas": "0x118f90", "gasPrice": "0x77359400", "maxFeePerGas": "0x7d2b7500", "maxPriorityFeePerGas": "0x59682f00", "input": "0x5ae401dc000000000000000000000000000000000000000000000000000000006751a83f0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000104472b43f30000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000000005f70c277b9dd00000000000000000000000000000000000000000000000000000000000000800000000000000000000000006245581b9e13143269404ea6f2efa7b99eca53ee0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000e26fea44c00802b9cae594974c0a6cbcad5fd8630000000000000000000000009f294c5d5da451e1fa5c2a654cb6d6e394efe2cd000000000000000000000000cda75276918a66d609a55b04570d7b4015a974a000000000000000000000000000000000000000000000000000000000", "creates": null, "chainId": "0x924", "accessList": [], "yParity": "0x0", "v": "0x0", "r": "0xf92ae479d4df56a637835816455621c023aa34a9257928fe4a035ce8a602603a", "s": "0x33f34f08a51a17f5e3e8cff9fc4fe5bdb9956e6b5c34ad44d10e9be250869119" }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/atleta/web3-p3/ title: Atleta — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/atleta/web3-p3.mdx --- # Atleta — web3, net, eth (3/3) > API reference for [Atleta](/rpc-service/chains/chains-api/atleta/). [All methods ->](/rpc-service/chains/chains-api/atleta/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/atleta/web3/) · [2](/rpc-service/chains/chains-api/atleta/web3-p2/) · 3 ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x282E8E", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "type": "0x2", "hash": "0x2867c9de7f388bfffa93340e147602c78091e4fcf39bece0e7025b476ca6f8eb", "nonce": "0x0", "blockHash": "0xe01796432573b7895f847e042eb6d924776068cc5e7f5a3f2096f71006ced9a0", "blockNumber": "0x282e8e", "transactionIndex": "0x0", "from": "0x6245581b9e13143269404ea6f2efa7b99eca53ee", "to": "0x31cac5c91c483a637116934d21565361950e6b7f", "value": "0x8ac7230489e80000", "gas": "0x118f90", "gasPrice": "0x77359400", "maxFeePerGas": "0x7d2b7500", "maxPriorityFeePerGas": "0x59682f00", "input": "0x5ae401dc000000000000000000000000000000000000000000000000000000006751a83f0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000104472b43f30000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000000005f70c277b9dd00000000000000000000000000000000000000000000000000000000000000800000000000000000000000006245581b9e13143269404ea6f2efa7b99eca53ee0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000e26fea44c00802b9cae594974c0a6cbcad5fd8630000000000000000000000009f294c5d5da451e1fa5c2a654cb6d6e394efe2cd000000000000000000000000cda75276918a66d609a55b04570d7b4015a974a000000000000000000000000000000000000000000000000000000000", "creates": null, "chainId": "0x924", "accessList": [], "yParity": "0x0", "v": "0x0", "r": "0xf92ae479d4df56a637835816455621c023aa34a9257928fe4a035ce8a602603a", "s": "0x33f34f08a51a17f5e3e8cff9fc4fe5bdb9956e6b5c34ad44d10e9be250869119" }, "id": 1 } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x2867c9de7f388bfffa93340e147602c78091e4fcf39bece0e7025b476ca6f8eb"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "transactionHash": "0x2867c9de7f388bfffa93340e147602c78091e4fcf39bece0e7025b476ca6f8eb", "transactionIndex": "0x0", "blockHash": "0xe01796432573b7895f847e042eb6d924776068cc5e7f5a3f2096f71006ced9a0", "from": "0x6245581b9e13143269404ea6f2efa7b99eca53ee", "to": "0x31cac5c91c483a637116934d21565361950e6b7f", "blockNumber": "0x282e8e", "cumulativeGasUsed": "0x10e192", "gasUsed": "0x10e192", "contractAddress": null, "logs": [ { "address": "0xe26fea44c00802b9cae594974c0a6cbcad5fd863", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x00000000000000000000000031cac5c91c483a637116934d21565361950e6b7f" ], "data": "0x0000000000000000000000000000000000000000000000008ac7230489e80000", "blockHash": "0xe01796432573b7895f847e042eb6d924776068cc5e7f5a3f2096f71006ced9a0", "blockNumber": "0x282e8e", "transactionHash": "0x2867c9de7f388bfffa93340e147602c78091e4fcf39bece0e7025b476ca6f8eb", "transactionIndex": "0x0", "logIndex": "0x0", "transactionLogIndex": "0x0", "removed": false } ], "logsBloom": "0x00200000000000000000000080000000000000800000000000800000000400000000000000000000000100100000000000000000000000000000000000000000000000000000000000000008000000200000000000000000000000000000000000000004020000000000040000000800000000000000000000000010000000000400000000100000020000000500000000000000000000080000004000000200000000000000000000000000000200000000000000000000000100000200800000000002000000000000008200000040000000000000001000008000000020000000010000000020000008000000000000000000000000000000000001000000", "status": "0x1", "effectiveGasPrice": "0x77359400", "type": "0x2" }, "id": 1 } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x5b827b4e810d61d986706cac9118a93b0de1a588e39cb6f24ca141694b4fc86a", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x956Bdd9606EcFB0c247Ec85C2a2b82104483759c"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": [], "id": 1 } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/atleta/web3/ title: Atleta — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/atleta/web3.mdx --- # Atleta — web3, net, eth (1/3) > API reference for [Atleta](/rpc-service/chains/chains-api/atleta/). [All methods ->](/rpc-service/chains/chains-api/atleta/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/atleta/web3-p2/) · [3](/rpc-service/chains/chains-api/atleta/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "atleta/v8.1/fc-rpc-2.0.0-dev", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "2340" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1dcd6500" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b182" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xA99E38BCf899411FaC369257bD8971EDdC167e71", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xe1a944018c24f" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xA99E38BCf899411FaC369257bD8971EDdC167e71", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x7a7fe466Ce0b09517E8A8B81AfC27e50b259a1Ed", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xe9b008a3de1a934eddbadf9930c4aebb59a809c49b146f23096f91dd85fe6f37"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x3", "id": 1 } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xe9b008a3de1a934eddbadf9930c4aebb59a809c49b146f23096f91dd85fe6f37"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x282EA1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x7BFa2D90De2d8a06a63F335543c9967588339d23", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/atleta/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x9f8d8f6d5c2baf89407bcd97b7b3d763de98146f5762eae39f18b88b15f1f5da" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/avail/ title: Avail description: Avail is a Web3 infrastructure layer that allows modular execution layers to scale and interoperate in a… Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/avail/index.mdx --- # Avail
> Avail API is available on [Web3 API platform](https://www.ankr.com/rpc/avail). *Avail* is a Web3 infrastructure layer that allows modular execution layers to scale and interoperate in a trust-minimized way. Avail's mission is to streamline the rollup experience, offering a unified, efficient platform for both users and developers from any ecosystem. This vertically integrated stack aims to dissolve the growing pains and user fragmentation experienced today, enabling Rollups to seamlessly access users and liquidity across the entire blockchain landscape. The Turing Testnet is live and marks Avail's final and definitive pre-Mainnet testing environment, aimed at vetting Mainnet deployments, executing extensive stress tests, and assessing network topologies for scalability and resilience. In order for your Web3 application to interact with Avail — either by reading blockchain data or sending transactions to the network — it must connect to an Avail node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods ### Methods supported - [`chain_getBlock`](/rpc-service/chains/chains-api/avail/methods-supported/#chain_getblock) - [`chain_getBlockHash`](/rpc-service/chains/chains-api/avail/methods-supported/#chain_getblockhash) - [`chain_getHeader`](/rpc-service/chains/chains-api/avail/methods-supported/#chain_getheader) - [`chain_getFinalizedHead`](/rpc-service/chains/chains-api/avail/methods-supported/#chain_getfinalizedhead) - [`state_getStorage`](/rpc-service/chains/chains-api/avail/methods-supported/#state_getstorage) - [`state_getStorageHash`](/rpc-service/chains/chains-api/avail/methods-supported/#state_getstoragehash) - [`state_getStorageSize`](/rpc-service/chains/chains-api/avail/methods-supported/#state_getstoragesize) - [`grandpa_proveFinality`](/rpc-service/chains/chains-api/avail/methods-supported/#grandpa_provefinality) - [`grandpa_roundState`](/rpc-service/chains/chains-api/avail/methods-supported/#grandpa_roundstate) - [`system_chain`](/rpc-service/chains/chains-api/avail/methods-supported/#system_chain) - [`system_chainType`](/rpc-service/chains/chains-api/avail/methods-supported/#system_chaintype) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/avail/methods-supported/ title: Avail — Methods supported source: docs/rpc-service/chains/chains-api/avail/methods-supported.mdx --- # Avail — Methods supported > API reference for [Avail](/rpc-service/chains/chains-api/avail/). [All methods ->](/rpc-service/chains/chains-api/avail/#methods) ## Methods supported * [`chain_getBlock`](#chain_getblock) — retrieves the header and body of a relay chain block. * [`chain_getBlockHash`](#chain_getblockhash) — retrieves the block hash for a specific block. * [`chain_getHeader`](#chain_getheader) — retrieves the header for a specific block. * [`chain_getFinalizedHead`](#chain_getfinalizedhead) — retrieves the hash of the last finalized block in the canon chain. * [`state_getStorage`](#state_getstorage) — retrieves the storage for a key. * [`state_getStorageHash`](#state_getstoragehash) — retrieves the storage hash. * [`state_getStorageSize`](#state_getstoragesize) — retrieves the storage size. * [`grandpa_proveFinality`](#grandpa_provefinality) — proves finality for the given block number, returning the Justification for the last block in the set. * [`grandpa_roundState`](#grandpa_roundstate) — returns the state of the current best round state as well as the ongoing background rounds. * [`system_chain`](#system_chain) — retrieves the chain. * [`system_chainType`](#system_chaintype) — retrieves the chain type. --- ### `chain_getBlock` > Retrieves the header and body of a relay chain block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data; 32 byte; optional): a hash of the block to retrieve; if omitted, retrieves the latest finalized block. #### Returns * `SignedBlock`: the header and body data of a relay chain block. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlock", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block": { "header": { "parentHash": "0x32d67a9e5843dd8527bf0e2ec1f4c6d2f8642ef264348ef7d610575619a5b6e8", "number": "0x49993", "stateRoot": "0x7d0860d48e20e42886aeac479dd339d1f75387d3be844a490ca1734efd430213", "extrinsicsRoot": "0x07d2cb3154a4bc3ff485d0101bb1cba8045bf1bd74a34a977cc2672a41e76596", "digest": { "logs": [ "0x0642414245b5010359000000757a1e0500000000841bf8fb61a548ec94caba8ddedcf85e02de0110990ffe3c4216277ee0b9734a9b966b69d9025691e82043d9a647ce917871b1b2d2082afc3ce3b195c96e1c039b2e312d9028cf976284d61c41f1069b1df154b5e6b6bef9ad4455dd24ea160d", "0x05424142450101c2be2a753a256b1261e00d5d31a20befa735767d5debe27edfff52149e4ce53398135479d97a0e594a2160cf78b3743ca42899138b0c5b58334bc7c4d0217080" ] }, "extension": { "V3": { "appLookup": { "size": 114, "index": [ { "appId": 36, "start": 0 } ] }, "commitment": { "rows": 1, "cols": 128, "commitment": [ 128, 27, 216, 161 ], "dataRoot": "0x67e432157400275ba4e6e7c9d61312afa5cbbea68d8b718fa8be3038980a9970" } } } }, "extrinsics": [ "0x280403000ba0f41eed8f01", "0xc90384007ce8ccf46bbdf7561f0d1419857dab91bfbda9866d564c2c5cfe43210a75db310122850737c933478016ee92ddcbd1eda470ead30b6a7938adba396b9e51922949b1bba1bf56ca8bd67f2241b1240fa1f2bd18f07b42111fe70f9f386b78f66f87040162760100000001020c0603004e558a63713b227cb661a5cb639c5bea499bd00039d7dabe16cb891e8fc2025213000064a7b3b6e00d06030006aa84733a1b39c3cc83586e589fd6bb82228321e1f75d4e2bc3af8d4957785213000064a7b3b6e00d0603003a1e5289c81ff9dfd53cf55e64aaaee9aeb31e5ae43c9679de15a841b406521d13000064a7b3b6e00d" ] }, "justifications": null }, "id": 1 } ``` --- ### `chain_getBlockHash` > Retrieves the block hash for a specific block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): `` (string; hex; optional): the number of a block to retrieve the hash for; if omitted, retrieves the latest finalized block. #### Returns * ``: the block hash of the block specified. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlockHash", "params": ["0x499A4"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0xfe9e859407f0ceb39140690d34a12e2ff34fef0e38fda83ecf3474d31a1a3526", "id": 1 } ``` --- ### `chain_getHeader` > Retrieves the header for a specific block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data; 32 byte; optional): a hash of the block to retrieve the header for; if omitted, shows the result for the latest finalized block. #### Returns * `
`: the header of the block specified. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getHeader", "params": ["0x1d8ec46e226db5453ab546efb873e7a2bf611aded65818b68206747c646bd478"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "parentHash": "0x23c72818d0462766e69f90895ce47b6251eca7112ca2be56e2efe56c9546f5b9", "number": "0x499b7", "stateRoot": "0xa31b41414cba3ecd32dbf23cf1541c9105de308d396b76e840635076c5dedd95", "extrinsicsRoot": "0xb3fea001c50633dcbcb8304486061c433e5e33d32f3d21759368228e58defadd", "digest": { "logs": [ "0x0642414245b5010337000000997a1e050000000078c42af8d5e7733c9aff7cd090c873a89892c101276b7dc96e1610ceca285a3d35133d72233df237ac7aa399c25c4d88b2a58835d93dc903919722ac312e4900ab66b214730d7280a9b9dbb4ef020efa785ef444d6477f9e34b7d295ddd6fb0a", "0x05424142450101ea438e2f3314fc10aba33b53aa79b4a75ba89131d9a847b96eb70c0bf70bbb6bc4720a57f973833c02f8dd3f0f7596ca83e76af9f9933b3ea33f14c2e84e8781" ] }, "extension": { "V3": { "appLookup": { "size": 0, "index": [] }, "commitment": { "rows": 0, "cols": 0, "commitment": [], "dataRoot": "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5" } } } }, "id": 1 } ``` --- ### `chain_getFinalizedHead` > Retrieves the hash of the last finalized block in the canon chain. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: the hash of the last finalized block in the canon chain. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getFinalizedHead", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0x7021a6a7aa0d6db341684d0969b1a31248d7568596a7028f0d7f490d9b7990ed", "id": 1 } ``` --- ### `state_getStorage` > Retrieves the storage for a key. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex ; required): the key to retrieve the storage for. * `` (data; 32 byte; optional): a hash of the block. #### Returns * ``: the storage data. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorage", "params": ["0xf0c365c3cf59d671eb72da0e7a4113c49f1f0515f462cdcf84e0f1d6045dfcbb"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0xc1772bed8f010000", "id": 1 } ``` --- ### `state_getStorageHash` > Retrieves the storage hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): a storage key. * `` (data; 32 byte; optional): a hash of the block. #### Returns * ``: the storage hash. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageHash", "params": ["0xf0c365c3cf59d671eb72da0e7a4113c49f1f0515f462cdcf84e0f1d6045dfcbb"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0xd63ffee954d00ba81f68297f8f7d866ca2ed141fea270c994cca8bab47fb580d", "id": 1 } ``` --- ### `state_getStorageSize` > Retrieves the storage size. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the storage key. * `` (data; 32 byte; optional): a hash of the block. #### Returns * ``: the storage size. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageSize", "params": ["0xf0c365c3cf59d671eb72da0e7a4113c49f1f0515f462cdcf84e0f1d6045dfcbb"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": 8, "id": 1 } ``` --- ### `grandpa_proveFinality` > Proves finality for the given block number, returning the Justification for the last block in the set. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (integer; required): the number of a block to prove finality for. #### Returns * `Option`: the Justification for the last block in the set. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "grandpa_proveFinality", "params": [301495] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0x3c59e6bc2b424b11686ab978fae65eff7f2fb689d710b188eec62a0325fc8cadcda769030000000000003c59e6bc2b424b11686ab978fae65eff7f2fb689d710b188eec62a0325fc8cadbf99040045013c59e6bc2b424b11686ab978fae65eff7f2fb689d710b188eec62a0325fc8cadbf99040094841d8cb36056bc3d0da86f09cb1a71294ddbc3284207f7f820f0f2cbe6aa029e91db5a755e5a7f892b918fa3ee89af090dbc4ffedf95813e9f47d56f65cb0a00ea76...", "id": 1 } ``` --- ### `grandpa_roundState` > Returns the state of the current best round state as well as the ongoing background rounds. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: the states of reported rounds. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "grandpa_roundState", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "setId": 93, "best": { "round": 899, "totalWeight": 120, "thresholdWeight": 81, "prevotes": { "currentWeight": 0, "missing": [ "5C5uWLcr4Sjb6bFeJpqev1sEdBehiTAMuj1dftYVR9NkBnjS", "5C65142vucMnMu8baXL5qi7qfNzTd9sRtBqvksdwwW3BPHYN", "5C9DSoURqitE1WQKgztnHnX8BARFtpTRwtFio5Kkq1pQv96E", "5C9tvEcZF4Zx7TAnywwu9ZmFGQSjT5WNW44p8PuGb9wEodX4" ] }, "precommits": { "currentWeight": 0, "missing": [ "5C5uWLcr4Sjb6bFeJpqev1sEdBehiTAMuj1dftYVR9NkBnjS", "5C65142vucMnMu8baXL5qi7qfNzTd9sRtBqvksdwwW3BPHYN", "5C9DSoURqitE1WQKgztnHnX8BARFtpTRwtFio5Kkq1pQv96E", "5C9tvEcZF4Zx7TAnywwu9ZmFGQSjT5WNW44p8PuGb9wEodX4" ] } }, "background": [] }, "id": 1 } ``` --- ### `system_chain` > Retrieves the chain. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: a chain name. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_chain", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "Avail Turing Network", "id": 1 } ``` --- ### `system_chainType` > Retrieves the chain type. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: a chain type. #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_chainType", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "Live", "id": 1 } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/ title: Avalanche — EVM methods, P-Chain methods (2/2) source: docs/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2.mdx --- # Avalanche — EVM methods, P-Chain methods (2/2) > API reference for [Avalanche](/rpc-service/chains/chains-api/avalanche/). [All methods ->](/rpc-service/chains/chains-api/avalanche/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/avalanche/evm-methods-2/) · 2 ## P-Chain methods ### `platform.getPendingValidators` > Retrieves the list of validators in the pending validator set of the specified Subnet. Each validator is not currently validating the Subnet but will be doing so in the future. #### Parameters **Signature**: ``` platform.getPendingValidators({ subnetID: string, // optional nodeIDs: string[], // optional }) -> { validators: []{ txID: string, startTime: string, endTime: string, stakeAmount: string, nodeID: string, delegationFee: string, connected: bool, signer: { publicKey: string, proofOfPosession: string }, weight: string, }, delegators: []{ txID: string, startTime: string, endTime: string, stakeAmount: string, nodeID: string } } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `subnetID`: the Subnet whose current validators are returned; if omitted, returns the current validators of the Primary Network. * `nodeIDs`: a list of the NodeIDs of pending validators to request; if omitted, all pending validators are returned; if a specified NodeID is not in the set of pending validators, it will not be included in the response. **Response parameters**: * `validators`: * `txID`: the validator transaction. * `startTime`: the Unix time when the validator starts validating the Subnet. * `endTime`: the Unix time when the validator stops validating the Subnet. * `stakeAmount`: the amount of tokens this validator staked. Omitted if subnetID is not a PoS Subnet. * `nodeID`: the validator’s node ID. * `connected`: shows if the node is connected and tracks the Subnet. * `signer`: the node's BLS public key and proof of possession. Omitted if the validator doesn't have a BLS public key. * `weight` the validator’s weight when sampling validators. Omitted if subnetID is a PoS Subnet. * `delegators`: * `txID`: the delegator transaction. * `startTime`: the Unix time when the delegator starts. * `endTime`: the Unix time when the delegator stops. * `stakeAmount`: the amount of tokens this delegator staked. * `nodeID` the validating node’s node ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getPendingValidators", "params" :{} }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "validators": [ { "txID": "2NNkpYTGfTFLSGXJcHtVv6drwVU2cczhmjK2uhvwDyxwsjzZMm", "startTime": "1600368632", "endTime": "1602960455", "stakeAmount": "200000000000", "nodeID": "NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD", "delegationFee": "10.0000", "connected": false } ], "delegators": [ { "txID": "Bbai8nzGVcyn2VmeYcbS74zfjJLjDacGNVuzuvAQkHn1uWfoV", "startTime": "1600368523", "endTime": "1602960342", "stakeAmount": "20000000000", "nodeID": "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg" } ] }, "id": 1 } ``` --- ### `platform.getRewardUTXOs` > Retrieves the UTXOs rewarded after the provided transaction's staking or delegation period has ended. #### Parameters **Signature**: ``` platform.getRewardUTXOs({ txID: string, encoding: string // optional }) -> { numFetched: integer, utxos: []string, encoding: string } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `txID`: the ID of the staking or delegating transaction. **Response parameters**: * `numFetched`: the number of returned UTXOs. * `utxos`: an array of encoded reward UTXOs. * `encoding` specifies the format for the returned UTXOs; can only be `hex` when a value is provided. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getRewardUTXOs", "params" :{ "txID":"2nmH8LithVbdjaXsxVQCQfXtzN9hBbmebrsaEYnLM9T32Uy2Y5", "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "numFetched": "2", "utxos": [ "0x0000a195046108a85e60f7a864bb567745a37f50c6af282103e47cc62f036cee404700000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216c1f01765", "0x0000ae8b1b94444eed8de9a81b1222f00f1b4133330add23d8ac288bffa98b85271100000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216473d042a" ], "encoding": "hex" }, "id": 1 } ``` --- ### `platform.getStake` > Retrieves the amount of nAVAX staked by a set of addresses. The amount returned does not include staking rewards. #### Parameters **Signature**: ``` platform.getStake({ addresses: []string, validatorsOnly: true or false }) -> { stakeds: string -> int, stakedOutputs: []string, encoding: string } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `addresses`: the addresses to get information about. * `validatorsOnly`: can be either `true` or `false`. If `true`, will skip checking delegators for stake. **Response parameters**: * `stakeds`: a map from assetID to the amount staked by addresses provided. * `stakedOutputs`: the string representation of staked outputs. * `encoding`: specifies the format for the returned outputs. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getStake", "params" :{ "addresses": [ "P-avax1pmgmagjcljjzuz2ve339dx82khm7q8getlegte" ], "validatorsOnly": true }, }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "staked": "6500000000000", "stakeds": { "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z": "6500000000000" }, "stakedOutputs": [ "0x000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000007000005e96630e800000000000000000000000001000000011f1c933f38da6ba0ba46f8c1b0a7040a9a991a80dd338ed1" ], "encoding": "hex" }, "id": 1 } ``` --- ### `platform.getStakingAssetID` > Retrieves an assetID for a Subnet’s staking asset. #### Parameters **Signature**: ``` platform.getStakingAssetID({ subnetID: string // optional }) -> { assetID: string } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `subnetID`: the Subnet whose assetID is requested. **Response parameters**: * `assetID`: the assetID for a Subnet’s staking asset. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getStakingAssetID", "params" :{ "subnetID": "11111111111111111111111111111111LpoYY" }, }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "assetID": "2fombhL7aGPwj3KH4bfrmJwW6PVnMobf9Y2fn9GwxiAAJyFDbe" }, "id": 1 } ``` --- ### `platform.getSubnets` > Retrieves info about the Subnets. #### Parameters **Signature**: ``` platform.getSubnets({ ids: []string }) -> { subnets: []{ id: string, controlKeys: []string, threshold: string } } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `ids`: the IDs of the Subnets to get information about. If omitted, gets information about all Subnets. **Response parameters**: * `subnets`: * `id`: the Subnet’s ID. * `threshold`: signatures from addresses in `controlKeys` are needed to add a validator to the Subnet; if the Subnet is a PoS Subnet, then `threshold` will be `0` and `controlKeys` will be empty. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getSubnets", "params" :{ "ids":[ "hW8Ma7dLMA7o4xmJf3AXBbo17bXzE7xnThUd3ypM4VAWo1sNJ" ] } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "subnets": [ { "id": "hW8Ma7dLMA7o4xmJf3AXBbo17bXzE7xnThUd3ypM4VAWo1sNJ", "controlKeys": [ "KNjXsaA1sZsaKCD1cd85YXauDuxshTes2", "Aiz4eEt5xv9t4NCnAWaQJFNz5ABqLtJkR" ], "threshold": "2" } ] }, "id": 1 } ``` --- ### `platform.getTimestamp` > Retrieves the current P-Chain timestamp. #### Parameters **Signature**: ``` platform.getTimestamp() -> {time: string} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): None. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getTimestamp", "params" :{} }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "timestamp": "2021-09-07T00:00:00-04:00" }, "id": 1 } ``` --- ### `platform.getTotalStake` > Retrieves the total amount of tokens staked on the requested Subnet. #### Parameters **Signature**: ``` platform.getTotalStake({ subnetID: string }) -> { stake: int weight: int } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `subnetID`: a string of a Subnet. #### Request example (Primary network) ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getTotalStake", "params" :{ "subnetID": "11111111111111111111111111111111LpoYY" } }' ``` #### Response example (Primary network) ```json { "jsonrpc": "2.0", "result": { "stake": "279825917679866811", "weight": "279825917679866811" }, "id": 1 } ``` #### Request example (Subnet) ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getTotalStake", "params" :{ "subnetID": "2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r" } }' ``` #### Response example (Subnet) ```json { "jsonrpc": "2.0", "result": { "weight": "100000" }, "id": 1 } ``` --- ### `platform.getTx` > Retrieves a transaction by its ID. Optional `encoding` parameter to specify the format for the returned transaction. Can be either `hex` or `json`. Defaults to `hex`. #### Parameters **Signature**: ``` platform.getTx({ txID: string, encoding: string // optional }) -> { tx: string, encoding: string, } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `txID`: a string of a transaction ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getTx", "params" :{ "txID": "28KVjSw5h3XKGuNpJXWY74EdnGq4TUWvCgEtJPymgQTvudiugb", "encoding": "json" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "tx": { "unsignedTx": { "networkID": 1, "blockchainID": "11111111111111111111111111111111LpoYY", "outputs": [], "inputs": [ { "txID": "NXNJHKeaJyjjWVSq341t6LGQP5UNz796o1crpHPByv1TKp9ZP", "outputIndex": 0, "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", "input": { "amount": 20824279595, "signatureIndices": [ 0 ] } }, { "txID": "2ahK5SzD8iqi5KBqpKfxrnWtrEoVwQCqJsMoB9kvChCaHgAQC9", "outputIndex": 1, "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", "input": { "amount": 28119890783, "signatureIndices": [ 0 ] } } ], "memo": "0x", "validator": { "nodeID": "NodeID-VT3YhgFaWEzy4Ap937qMeNEDscCammzG", "start": 1682945406, "end": 1684155006, "weight": 48944170378 }, "stake": [ { "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", "output": { "addresses": [ "P-avax1tnuesf6cqwnjw7fxjyk7lhch0vhf0v95wj5jvy" ], "amount": 48944170378, "locktime": 0, "threshold": 1 } } ], "rewardsOwner": { "addresses": [ "P-avax19zfygxaf59stehzedhxjesads0p5jdvfeedal0" ], "locktime": 0, "threshold": 1 } }, "credentials": [ { "signatures": [ "0x6954e90b98437646fde0c1d54c12190fc23ae5e319c4d95dda56b53b4a23e43825251289cdc3728f1f1e0d48eac20e5c8f097baa9b49ea8a3cb6a41bb272d16601" ] }, { "signatures": [ "0x6954e90b98437646fde0c1d54c12190fc23ae5e319c4d95dda56b53b4a23e43825251289cdc3728f1f1e0d48eac20e5c8f097baa9b49ea8a3cb6a41bb272d16601" ] } ], "id": "28KVjSw5h3XKGuNpJXWY74EdnGq4TUWvCgEtJPymgQTvudiugb" }, "encoding": "json" }, "id": 1 } ``` --- ### `platform.getTxStatus` > Retrieves a transaction’s status by its ID. If the transaction was dropped, response will include a `reason` field with more information why the transaction was dropped. #### Parameters **Signature**: ``` platform.getTxStatus({ txID: string }) -> {status: string} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `txID`: a string of a transaction ID. **Response parameters**: * `status`: either of the following: * `Committed`: the transaction is (or will be) accepted by every node. * `Processing`: the transaction is being voted on by this node. * `Dropped`: the transaction will never be accepted by any node in the network, check reason field for more information. * `Unknown`: the transaction hasn’t been seen by this node. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getTxStatus", "params" :{ "txID":"TAG9Ns1sa723mZy1GSoGqWipK6Mvpaj7CAswVJGM6MkVJDF9Q" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "status": "Committed" }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/avalanche/evm-methods-2/ title: Avalanche — EVM methods, P-Chain methods (1/2) source: docs/rpc-service/chains/chains-api/avalanche/evm-methods-2.mdx --- # Avalanche — EVM methods, P-Chain methods (1/2) > API reference for [Avalanche](/rpc-service/chains/chains-api/avalanche/). [All methods ->](/rpc-service/chains/chains-api/avalanche/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/) ### `eth_getAssetBalance` > Retrieves the balance of first class Avalanche Native Tokens on the C-Chain. In addition to the standard Ethereum APIs, Avalanche offers `eth_getAssetBalance` to retrieve the balance of first class Avalanche Native Tokens on the C-Chain (excluding AVAX, which must be fetched with eth_getBalance). #### Parameters **Signature**: ``` eth_getAssetBalance({ address: string, blk: BlkNrOrHash, assetID: string, }) -> {balance: int} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `address`: owner of the asset. * `blk`: the block number or hash at which to retrieve the balance. * `assetID`: an ID of the asset for which the balance is requested. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"eth_getAssetBalance", "params" : [ "0x8723e5773847A4Eb5FeEDabD9320802c5c812F46", "latest", "3RvKBAmQnfYionFXMfW5P8TDZgZiogKbHjM8cjpu16LKAgF5T" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1388" } ``` --- ### `eth_baseFee` > Retrieves the base fee for the next block. #### Parameters **Signature**: ``` eth_baseFee() -> {} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"eth_baseFee", "params" : [] }' ``` #### Request example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x34630b8a00" } ``` --- ### `eth_maxPriorityFeePerGas` > Retrieves the priority fee needed to be included in a block. #### Parameters **Signature**: ``` eth_maxPriorityFeePerGas() -> {} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"eth_maxPriorityFeePerGas", "params" : [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2540be400" } ``` --- ### `eth_getChainConfig` > Retrieves chain config. #### Parameters **Signature**: ``` eth_getChainConfig({}) -> {chainConfig: json} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"eth_getChainConfig", "params" : [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "chainId": 43112, "homesteadBlock": 0, "daoForkBlock": 0, "daoForkSupport": true, "eip150Block": 0, "eip150Hash": "0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0", "eip155Block": 0, "eip158Block": 0, "byzantiumBlock": 0, "constantinopleBlock": 0, "petersburgBlock": 0, "istanbulBlock": 0, "muirGlacierBlock": 0, "apricotPhase1BlockTimestamp": 0, "apricotPhase2BlockTimestamp": 0, "apricotPhase3BlockTimestamp": 0, "apricotPhase4BlockTimestamp": 0, "apricotPhase5BlockTimestamp": 0 } } ``` --- ## P-Chain methods * [`platform.getBalance`](#platformgetbalance) — retrieves the balance of AVAX for a given address. * [`platform.getBlock`](#platformgetblock) — retrieves a block by its ID. * [`platform.getBlockchains`](#platformgetblockchains) — retrieves all the blockchains that exist (excluding the P-Chain). * [`platform.getBlockchainStatus`](#platformgetblockchainstatus) — retrieves the status of a blockchain. * [`platform.getCurrentSupply`](#platformgetcurrentsupply) — retrieves an upper bound on the amount of existing tokens that can stake the requested Subnet. * [`platform.getCurrentValidators`](#platformgetcurrentvalidators) — retrieves the list of current validators of the given Subnet. * [`platform.getHeight`](#platformgetheight) — retrieves the height of the latest accepted block. * [`platform.getMaxStakeAmount`](#platformgetmaxstakeamount) — retrieves the maximum amount of nAVAX staking to the named node during a particular time period. * [`platform.getMinStake`](#platformgetminstake) — retrieves the minimum amount of tokens required to validate the requested Subnet and the minimum amount of tokens that can be delegated. * [`platform.getPendingValidators`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgetpendingvalidators) — retrieves the list of validators in the pending validator set of the specified Subnet. * [`platform.getRewardUTXOs`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgetrewardutxos) — retrieves the UTXOs rewarded after the provided transaction's staking or delegation period has ended. * [`platform.getStake`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgetstake) — retrieves the amount of nAVAX staked by a set of addresses. * [`platform.getStakingAssetID`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgetstakingassetid) — retrieves an assetID for a Subnet’s staking asset. * [`platform.getSubnets`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgetsubnets) — retrieves info about the Subnets. * [`platform.getTimestamp`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgettimestamp) — retrieves the current P-Chain timestamp. * [`platform.getTotalStake`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgettotalstake) — retrieves the total amount of tokens staked on the requested Subnet. * [`platform.getTx`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgettx) — retrieves a transaction by its ID. * [`platform.getTxStatus`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgettxstatus) — retrieves a transaction’s status by its ID. * [`platform.getUTXOs`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformgetutxos) — retrieves the UTXOs that reference a given set of addresses. * [`platform.getValidatorsAt`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformgetvalidatorsat) — retrieves the validators and their weights of a Subnet or the Primary Network at a given P-Chain height. * [`platform.issueTx`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformissuetx) — issues a transaction to the Platform Chain. * [`platform.listAddresses`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformsamplevalidators) — retrieves the list of addresses controlled by the given user. * [`platform.sampleValidators`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformvalidatedby) — retrieves the validators from the specified Subnet. * [`platform.validatedBy`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformvalidatedby) — retrieves the Subnet that validates a given blockchain. * [`platform.validates`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformvalidates) — retrieves the IDs of the blockchains a Subnet validates. --- ### `platform.getBalance` > Retrieves the balance of AVAX for a given address. #### Parameters **Signature**: ``` platform.getBalance({ addresses: []string }) -> { balances: string -> int, unlockeds: string -> int, lockedStakeables: string -> int, lockedNotStakeables: string -> int, utxoIDs: []{ txID: string, outputIndex: int } } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `addresses`: the addresses to get the balance for. **Response parameters**: * `balances`: a map from assetID to the total balance. * `unlockeds`: a map from assetID to the unlocked balance. * `lockedStakeables`: a map from assetID to the locked stakeable balance. * `lockedNotStakeables`: a map from assetID to the locked and not stakeable balance. * `utxoIDs`: the IDs of the UTXOs that reference `address`. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getBalance", "params" :{ "address":"P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "balance": "30000000000000000", "unlocked": "20000000000000000", "lockedStakeable": "10000000000000000", "lockedNotStakeable": "0", "balances": { "BUuypiq2wyuLMvyhzFXcPyxPMCgSp7eeDohhQRqTChoBjKziC": "30000000000000000" }, "unlockeds": { "BUuypiq2wyuLMvyhzFXcPyxPMCgSp7eeDohhQRqTChoBjKziC": "20000000000000000" }, "lockedStakeables": { "BUuypiq2wyuLMvyhzFXcPyxPMCgSp7eeDohhQRqTChoBjKziC": "10000000000000000" }, "lockedNotStakeables": {}, "utxoIDs": [ { "txID": "11111111111111111111111111111111LpoYY", "outputIndex": 1 }, { "txID": "11111111111111111111111111111111LpoYY", "outputIndex": 0 } ] }, "id": 1 } ``` --- ## P-Chain methods ### `platform.getBlock` > Retrieves a block by its ID. #### Parameters **Signature**: ``` platform.getBlock({ blockID: string encoding: string // optional }) -> { block: string, encoding: string } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `blockID`: a block ID in cb58 format. * `encoding`: the encoding format to use; can be either hex or json; defaults to hex. #### Request example (hex) ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getBlock", "params" :{ "blockID": "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG", "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block": "0x00000000000309473dc99a0851a29174d84e522da8ccb1a56ac23f7b0ba79f80acce34cf576900000000000f4241000000010000001200000001000000000000000000000000000000000000000000000000000000000000000000000000000000011c4c57e1bcb3c567f9f03caa75563502d1a21393173c06d9d79ea247b20e24800000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000050000000338e0465f0000000100000000000000000427d4b22a2a78bcddd456742caf91b56badbff985ee19aef14573e7343fd6520000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000000338d1041f0000000000000000000000010000000195a4467dd8f939554ea4e6501c08294386938cbf000000010000000900000001c79711c4b48dcde205b63603efef7c61773a0eb47efb503fcebe40d21962b7c25ebd734057400a12cce9cf99aceec8462923d5d91fffe1cb908372281ed738580119286dde", "encoding": "hex" }, "id": 1 } ``` #### Request example (JSON) ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getBlock", "params" :{ "blockID": "d7WYmb8VeZNHsny3EJCwMm6QA37s1EHwMxw1Y71V3FqPZ5EFG", "encoding": "json" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block": { "parentID": "5615di9ytxujackzaXNrVuWQy5y8Yrt8chPCscMr5Ku9YxJ1S", "height": 1000001, "txs": [ { "unsignedTx": { "inputs": { "networkID": 1, "blockchainID": "11111111111111111111111111111111LpoYY", "outputs": [], "inputs": [ { "txID": "DTqiagiMFdqbNQ62V2Gt1GddTVLkKUk2caGr4pyza9hTtsfta", "outputIndex": 0, "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", "input": { "amount": 13839124063, "signatureIndices": [0] } } ], "memo": "0x" }, "destinationChain": "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5", "exportedOutputs": [ { "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", "output": { "addresses": [ "P-avax1jkjyvlwclyu42n4yuegpczpfgwrf8r9lyj0d3c" ], "amount": 13838124063, "locktime": 0, "threshold": 1 } } ] }, "credentials": [ { "signatures": [ "0xc79711c4b48dcde205b63603efef7c61773a0eb47efb503fcebe40d21962b7c25ebd734057400a12cce9cf99aceec8462923d5d91fffe1cb908372281ed7385801" ] } ] } ] }, "encoding": "json" }, "id": 1 } ``` --- ### `platform.getBlockchains` > Retrieves all the blockchains that exist (excluding the P-Chain). #### Parameters **Signature**: ``` platform.getBlockchains() -> { blockchains: []{ id: string, name:string, subnetID: string, vmID: string } } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): None. **Response parameters**: * `blockchains`: all of the blockchains that exists on the Avalanche network. * `name`: the human-readable name of this blockchain. * `id`: the blockchain ID. * `subnetID`: the ID of the Subnet that validates this blockchain. * `vmID`: the ID of the Virtual Machine the blockchain runs. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getBlockchains", "params" :{} }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "blockchains": [ { "id": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", "name": "X-Chain", "subnetID": "11111111111111111111111111111111LpoYY", "vmID": "jvYyfQTxGMJLuGWa55kdP2p2zSUYsQ5Raupu4TW34ZAUBAbtq" }, { "id": "2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5", "name": "C-Chain", "subnetID": "11111111111111111111111111111111LpoYY", "vmID": "mgj786NP7uDwBCcq6YwThhaN8FLyybkCa4zBWTQbNgmK6k9A6" }, { "id": "CqhF97NNugqYLiGaQJ2xckfmkEr8uNeGG5TQbyGcgnZ5ahQwa", "name": "Simple DAG Payments", "subnetID": "11111111111111111111111111111111LpoYY", "vmID": "sqjdyTKUSrQs1YmKDTUbdUhdstSdtRTGRbUn8sqK8B6pkZkz1" }, { "id": "VcqKNBJsYanhVFxGyQE5CyNVYxL3ZFD7cnKptKWeVikJKQkjv", "name": "Simple Chain Payments", "subnetID": "11111111111111111111111111111111LpoYY", "vmID": "sqjchUjzDqDfBPGjfQq2tXW1UCwZTyvzAWHsNzF2cb1eVHt6w" }, { "id": "2SMYrx4Dj6QqCEA3WjnUTYEFSnpqVTwyV3GPNgQqQZbBbFgoJX", "name": "Simple Timestamp Server", "subnetID": "11111111111111111111111111111111LpoYY", "vmID": "tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH" }, { "id": "KDYHHKjM4yTJTT8H8qPs5KXzE6gQH5TZrmP1qVr1P6qECj3XN", "name": "My new timestamp", "subnetID": "2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r", "vmID": "tGas3T58KzdjLHhBDMnH2TvrddhqTji5iZAMZ3RXs2NLpSnhH" }, { "id": "2TtHFqEAAJ6b33dromYMqfgavGPF3iCpdG3hwNMiart2aB5QHi", "name": "My new AVM", "subnetID": "2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r", "vmID": "jvYyfQTxGMJLuGWa55kdP2p2zSUYsQ5Raupu4TW34ZAUBAbtq" } ] }, "id": 1 } ``` --- ### `platform.getBlockchainStatus` > Retrieves the status of a blockchain. #### Parameters **Signature**: ``` platform.getBlockchainStatus( { blockchainID: string } ) -> {status: string} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `blockchainID`: a blockchain ID to return the status for. **Response parameters**: * `status`: either of the following: * `Validating`: the blockchain is being validated by this node. * `Created`: the blockchain exists but isn’t being validated by this node. * `Preferred`: the blockchain was proposed to be created and is likely to be created but the transaction isn’t yet accepted. * `Syncing`: the node is participating in this blockchain as a non-validating node. * `Unknown`: the blockchain either wasn’t proposed or the proposal to create it isn’t preferred. The proposal may be resubmitted. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getBlockchainStatus", "params" :{ "blockchainID":"2NbS4dwGaf2p1MaXb65PrkZdXRwmSX4ZzGnUu7jm3aykgThuZE"} }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "status": "Created" }, "id": 1 } ``` --- ### `platform.getCurrentSupply` > Retrieves an upper bound on the amount of existing tokens that can stake the requested Subnet. This is an upper bound because it does not account for burnt tokens, including transaction fees. #### Parameters **Signature**: ``` platform.getCurrentSupply({ subnetID: string // optional }) -> {supply: int} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `subnetID`: a Subnet ID. **Response parameters**: * `supply`: an upper bound on the number of tokens that exist. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getCurrentSupply", "params" :{ "subnetID":"11111111111111111111111111111111LpoYY"} }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "supply": "365865167637779183" }, "id": 1 } ``` --- ### `platform.getCurrentValidators` > Retrieves the list of current validators of the given Subnet. #### Parameters **Signature**: ``` platform.getCurrentValidators({ subnetID: string, // optional nodeIDs: string[], // optional }) -> { validators: []{ txID: string, startTime: string, endTime: string, stakeAmount: string, nodeID: string, weight: string, validationRewardOwner: { locktime: string, threshold: string, addresses: string[] }, delegationRewardOwner: { locktime: string, threshold: string, addresses: string[] }, potentialReward: string, delegationFee: string, uptime: string, connected: bool, signer: { publicKey: string, proofOfPosession: string }, delegatorCount: string, delegatorWeight: string, delegators: []{ txID: string, startTime: string, endTime: string, stakeAmount: string, nodeID: string, rewardOwner: { locktime: string, threshold: string, addresses: string[] }, potentialReward: string, } } } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `subnetID`: the Subnet whose current validators are returned; if omitted, returns the current validators of the Primary Network. * `nodeIDs`: a list of the NodeIDs of current validators to request; if omitted, all current validators are returned; if a specified NodeID is not in the set of current validators, it will not be included in the response. **Response parameters**: * `validators`: * `txID`: the validator transaction. * `startTime`: the Unix time when the validator starts validating the Subnet. * `endTime`: the Unix time when the validator stops validating the Subnet. * `stakeAmount`: the amount of tokens this validator staked. Omitted if `subnetID` is not a PoS Subnet. * `nodeID`: the validator’s node ID. * `weight`: the validator’s weight when sampling validators. Omitted if `subnetID` is a PoS Subnet. * `validationRewardOwner`: an `OutputOwners` output which includes `locktime`, `threshold`, and array of `addresses`. Specifies the owner of the potential reward earned from staking. Omitted if `subnetID` is not a PoS Subnet. * `delegationRewardOwner`: an `OutputOwners` output which includes `locktime`, `threshold`, and array of `addresses`. Specifies the owner of the potential reward earned from delegations. Omitted if `subnetID` is not a PoS Subnet. * `potentialReward`: the potential reward earned from staking. Omitted if `subnetID` is not a PoS Subnet. * `delegationFeeRate`: the percentage fee this validator charges when others delegate stake to them. Omitted if `subnetID` is not a PoS Subnet. * `uptime`: the % of time the queried node has reported the peer as online and validating the Subnet. * `connected`: if the node is connected and tracks the Subnet. * `signer`: the node's BLS public key and proof of possession. Omitted if the validator doesn't have a BLS public key. * `delegatorCount`: the number of delegators on this validator. Omitted if `subnetID` is not a PoS Subnet. * `delegatorWeight`: total weight of delegators on this validator. Omitted if `subnetID` is not a PoS Subnet. * `delegators`: the list of delegators to this validator. Omitted if `subnetID` is not a PoS Subnet. Omitted unless `nodeIDs` specifies a single NodeID. * `txID`: the delegator transaction. * `startTime`: the Unix time when the delegator started. * `endTime`: the Unix time when the delegator stops. * `stakeAmount`: the amount of nAVAX this delegator staked. * `nodeID`: the validating node’s node ID. * `rewardOwner`: an `OutputOwners` output which includes `locktime`, `threshold`, and array of `addresses`. * `potentialReward`: the potential reward earned from staking. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getCurrentValidators", "params" :{ "nodeIDs": ["NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD"] } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "validators": [ { "txID": "2NNkpYTGfTFLSGXJcHtVv6drwVU2cczhmjK2uhvwDyxwsjzZMm", "startTime": "1600368632", "endTime": "1602960455", "stakeAmount": "2000000000000", "nodeID": "NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD", "validationRewardOwner": { "locktime": "0", "threshold": "1", "addresses": ["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"] }, "delegationRewardOwner": { "locktime": "0", "threshold": "1", "addresses": ["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"] }, "potentialReward": "117431493426", "delegationFee": "10.0000", "uptime": "0.0000", "connected": false, "delegatorCount": "1", "delegatorWeight": "25000000000", "delegators": [ { "txID": "Bbai8nzGVcyn2VmeYcbS74zfjJLjDacGNVuzuvAQkHn1uWfoV", "startTime": "1600368523", "endTime": "1602960342", "stakeAmount": "25000000000", "nodeID": "NodeID-5mb46qkSBj81k9g9e4VFjGGSbaaSLFRzD", "rewardOwner": { "locktime": "0", "threshold": "1", "addresses": ["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"] }, "potentialReward": "11743144774" } ] } ] }, "id": 1 } ``` --- ### `platform.getHeight` > Retrieves the height of the latest accepted block. #### Parameters **Signature**: ``` platform.getHeight() -> { height: int, } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): None. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getHeight", "params" :{} }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "height": "56" }, "id": 1 } ``` --- ### `platform.getMaxStakeAmount` > Retrieves the maximum amount of nAVAX staking to the named node during a particular time period. #### Parameters **Signature**: ``` platform.getMaxStakeAmount( { subnetID: string, nodeID: string, startTime: int, endTime: int } ) -> { amount: uint64 } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `subnetID`: a Buffer or cb58 string representing Subnet. * `nodeID`: a string representing ID of the node whose stake amount is required during the given duration. * `startTime`: a big number denoting start time of the duration during which stake amount of the node is required. * `endTime`: a big number denoting end time of the duration during which stake amount of the node is required. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getMaxStakeAmount", "params" :{ "subnetID":"11111111111111111111111111111111LpoYY", "nodeID":"NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg", "startTime": 1644240334, "endTime": 1644240634 } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "amount": "2000000000000000" }, "id": 1 } ``` --- ### `platform.getMinStake` > Retrieves the minimum amount of tokens required to validate the requested Subnet and the minimum amount of tokens that can be delegated. #### Parameters **Signature**: ``` platform.getMinStake({ subnetID: string // optional }) -> { minValidatorStake : uint64, minDelegatorStake : uint64 } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `subnetID`: a string representing Subnet. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getMinStake", "params" :{ "subnetID":"11111111111111111111111111111111LpoYY" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "minValidatorStake": "2000000000000", "minDelegatorStake": "25000000000" }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/avalanche/evm-methods-p2/ title: Avalanche — EVM methods (2/3) source: docs/rpc-service/chains/chains-api/avalanche/evm-methods-p2.mdx --- # Avalanche — EVM methods (2/3) > API reference for [Avalanche](/rpc-service/chains/chains-api/avalanche/). [All methods ->](/rpc-service/chains/chains-api/avalanche/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/avalanche/evm-methods/) · 2 · [3](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/) ## EVM methods ### `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (quantity): the amount of gas used. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53b8" } ``` --- ### `eth_getBlockByHash` > Returns information for the block specified by block hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. #### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x82b30326beea757ea54b4dbe480c16240ea9c16036437d3883582b691fa3e84d", false], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5d21dba00", "blockExtraData": "0x", "blockGasCost": "0x30d40", "difficulty": "0x1", "extDataGasUsed": "0x0", "extDataHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "extraData": "0x00000000000ba6a9000000000000000000000000000e06c40000000000000000000000000007ca7d000000000009371400000000001fde2d000000000000000000000000000000000000000000000000", "gasLimit": "0x7a1200", "gasUsed": "0xc2b38", "hash": "0x82b30326beea757ea54b4dbe480c16240ea9c16036437d3883582b691fa3e84d", "logsBloom": "0x0020000400000404000c02008000020100000004000800002008008000000002201000010882000000400000000000000800000000002000001002000021080010008140000800080000000800000020000000000000000000000000000000000000000000400c00000000000000000000000041000000000000001802081000000000000000000400000000000020000000041c00100008000010400000000002008000080000000030000000800000000000080000100000010000000000000100000a001000040002000000000000000000000000081810000080000000000030040000040008001020008080000824000000000000320000000040020800", "miner": "0x0100000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x192827a", "parentHash": "0x81d55baa2713a31da700334403a06a88b0e02d36b269246755ac3d82cf9c546e", "receiptsRoot": "0x14407d5ac1d0305088382f37f6c0d52aa388fdf860d702938b86ae2491c39a7b", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0xbc5", "stateRoot": "0xb047c2c608cccbebd87d137d087f2776d7544fa0a95c6f4534e897c28a9ec423", "timestamp": "0x63ef96c3", "totalDifficulty": "0x192827a", "transactions": [ "0x043dd87fdfffe716db6247913eb8b77e2e32752513b3524d7b145093e1c6205f", "0x7b2b70b7aca8c17991fb4ae7d211fe8282ed1060119387888d908dcd56c8b614", "0xecff8a6ce26c3c81ec4210fb659f001569f4a87b20e1fc84d20014f207d57ee8", "0x9f8aada5f06daea7ba0911844e3a91d5390a3ef3d00e74925799fce596986ef2", "0xb1bc5b122da09e38bc6e4350b3266abe1320039e7f933013cb0d82a6b26a5f5a", "0x7612688f0fa35e8cceb52938e84635a9f0062265100647d8553109fa05c95ea3", "0x65eac930d352f956042fc01948fe8c5bed40baabd03b42c26fd0ef602ea6f85c", "0x9cbfe15787b9270d243274c94c54308e7a2e2feac733aa3d1b2f650c4e0ab8f2", "0xe1a4dfaafc9546e67e14ba28a61a711089386b1c2d4753fe426711c0b9a94d13" ], "transactionsRoot": "0x5c1625a27e7a562a06790775346a0133f2e5d269b930950262ac96e1ade36806", "uncles": [] } } ``` --- ### `eth_getBlockByNumber` > Returns information for the block specified by block number. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. #### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x192827A", false], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5d21dba00", "blockExtraData": "0x", "blockGasCost": "0x30d40", "difficulty": "0x1", "extDataGasUsed": "0x0", "extDataHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "extraData": "0x00000000000ba6a9000000000000000000000000000e06c40000000000000000000000000007ca7d000000000009371400000000001fde2d000000000000000000000000000000000000000000000000", "gasLimit": "0x7a1200", "gasUsed": "0xc2b38", "hash": "0x82b30326beea757ea54b4dbe480c16240ea9c16036437d3883582b691fa3e84d", "logsBloom": "0x0020000400000404000c02008000020100000004000800002008008000000002201000010882000000400000000000000800000000002000001002000021080010008140000800080000000800000020000000000000000000000000000000000000000000400c00000000000000000000000041000000000000001802081000000000000000000400000000000020000000041c00100008000010400000000002008000080000000030000000800000000000080000100000010000000000000100000a001000040002000000000000000000000000081810000080000000000030040000040008001020008080000824000000000000320000000040020800", "miner": "0x0100000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x192827a", "parentHash": "0x81d55baa2713a31da700334403a06a88b0e02d36b269246755ac3d82cf9c546e", "receiptsRoot": "0x14407d5ac1d0305088382f37f6c0d52aa388fdf860d702938b86ae2491c39a7b", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0xbc5", "stateRoot": "0xb047c2c608cccbebd87d137d087f2776d7544fa0a95c6f4534e897c28a9ec423", "timestamp": "0x63ef96c3", "totalDifficulty": "0x192827a", "transactions": [ "0x043dd87fdfffe716db6247913eb8b77e2e32752513b3524d7b145093e1c6205f", "0x7b2b70b7aca8c17991fb4ae7d211fe8282ed1060119387888d908dcd56c8b614", "0xecff8a6ce26c3c81ec4210fb659f001569f4a87b20e1fc84d20014f207d57ee8", "0x9f8aada5f06daea7ba0911844e3a91d5390a3ef3d00e74925799fce596986ef2", "0xb1bc5b122da09e38bc6e4350b3266abe1320039e7f933013cb0d82a6b26a5f5a", "0x7612688f0fa35e8cceb52938e84635a9f0062265100647d8553109fa05c95ea3", "0x65eac930d352f956042fc01948fe8c5bed40baabd03b42c26fd0ef602ea6f85c", "0x9cbfe15787b9270d243274c94c54308e7a2e2feac733aa3d1b2f650c4e0ab8f2", "0xe1a4dfaafc9546e67e14ba28a61a711089386b1c2d4753fe426711c0b9a94d13" ], "transactionsRoot": "0x5c1625a27e7a562a06790775346a0133f2e5d269b930950262ac96e1ade36806", "uncles": [] } } ``` --- ### `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. #### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xd68c1586fffef9bb63046131c05adfc999eef32e659cc49d348708507655e58e"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xab63a9e94ddf139cac37b78bf436f8ea9371693e980ca40fadfc5ff86163c212", "blockNumber": "0x192827b", "from": "0x1fd29a653e1636e67b5fe15b1a9f7fda9862fe0e", "gas": "0xb714", "gasPrice": "0x65e523690", "maxFeePerGas": "0x867dc9e10", "maxPriorityFeePerGas": "0x8c347c90", "hash": "0xd68c1586fffef9bb63046131c05adfc999eef32e659cc49d348708507655e58e", "input": "0x095ea7b3000000000000000000000000e3ffc583dc176575eea7fd9df2a7c65f7e23f4c3000000000000000000000000000000000000000000000000000000000002dfff", "nonce": "0x6", "to": "0x152b9d0fdc40c096757f570a51e494bd4b943e50", "transactionIndex": "0x6", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0xa86a", "v": "0x0", "r": "0xc4d5fc8b9d7d3d2c76ef68b270a3e55adc4223983c17e51745178eeaea80769b", "s": "0x69ac776c337db7e1ca8ed69795225f774ddcc77c32988f27c1e71c30cbff16e4" } } ``` --- ### `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. #### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xab63a9e94ddf139cac37b78bf436f8ea9371693e980ca40fadfc5ff86163c212", "0x0"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xab63a9e94ddf139cac37b78bf436f8ea9371693e980ca40fadfc5ff86163c212", "blockNumber": "0x192827b", "from": "0x1ab954d8561429c406e9d12ac41d30732e0e070e", "gas": "0x5208", "gasPrice": "0x174876e800", "hash": "0xef652807f23fa33087bff7298df81faefb782ffd47e6941ff83ea8a5d8660fab", "input": "0x", "nonce": "0x6e2", "to": "0xa16f524a804beaed0d791de0aa0b5836295a2a84", "transactionIndex": "0x0", "value": "0x17da328ed759d8c000", "type": "0x0", "chainId": "0xa86a", "v": "0x150f7", "r": "0x65ed623c6d97860e56774f7f243d5515def1be0dea5dccf4864d34cc4cabeb2d", "s": "0xbd78ba332b68588b8d22d814e1002aabfbbf559584b8d2d90e8272ac8272ea1" } } ``` --- ### `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. #### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x192827B", "0x0"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xab63a9e94ddf139cac37b78bf436f8ea9371693e980ca40fadfc5ff86163c212", "blockNumber": "0x192827b", "from": "0x1ab954d8561429c406e9d12ac41d30732e0e070e", "gas": "0x5208", "gasPrice": "0x174876e800", "hash": "0xef652807f23fa33087bff7298df81faefb782ffd47e6941ff83ea8a5d8660fab", "input": "0x", "nonce": "0x6e2", "to": "0xa16f524a804beaed0d791de0aa0b5836295a2a84", "transactionIndex": "0x0", "value": "0x17da328ed759d8c000", "type": "0x0", "chainId": "0xa86a", "v": "0x150f7", "r": "0x65ed623c6d97860e56774f7f243d5515def1be0dea5dccf4864d34cc4cabeb2d", "s": "0xbd78ba332b68588b8d22d814e1002aabfbbf559584b8d2d90e8272ac8272ea1" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/avalanche/evm-methods-p3/ title: Avalanche — EVM methods (3/3) source: docs/rpc-service/chains/chains-api/avalanche/evm-methods-p3.mdx --- # Avalanche — EVM methods (3/3) > API reference for [Avalanche](/rpc-service/chains/chains-api/avalanche/). [All methods ->](/rpc-service/chains/chains-api/avalanche/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/avalanche/evm-methods/) · [2](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/) · 3 ## EVM methods ### `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. #### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xd68c1586fffef9bb63046131c05adfc999eef32e659cc49d348708507655e58e"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xab63a9e94ddf139cac37b78bf436f8ea9371693e980ca40fadfc5ff86163c212", "blockNumber": "0x192827b", "contractAddress": null, "cumulativeGasUsed": "0xaf54d", "effectiveGasPrice": "0x65e523690", "from": "0x1fd29a653e1636e67b5fe15b1a9f7fda9862fe0e", "gasUsed": "0xb714", "logs": [ { "address": "0x152b9d0fdc40c096757f570a51e494bd4b943e50", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000001fd29a653e1636e67b5fe15b1a9f7fda9862fe0e", "0x000000000000000000000000e3ffc583dc176575eea7fd9df2a7c65f7e23f4c3" ], "data": "0x000000000000000000000000000000000000000000000000000000000002dfff", "blockNumber": "0x192827b", "transactionHash": "0xd68c1586fffef9bb63046131c05adfc999eef32e659cc49d348708507655e58e", "transactionIndex": "0x6", "blockHash": "0xab63a9e94ddf139cac37b78bf436f8ea9371693e980ca40fadfc5ff86163c212", "logIndex": "0x15", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000400000000000001000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000002000000000000000010000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010000000000000000000000000000000000000001000000000000000000000", "status": "0x1", "to": "0x152b9d0fdc40c096757f570a51e494bd4b943e50", "transactionHash": "0xd68c1586fffef9bb63046131c05adfc999eef32e659cc49d348708507655e58e", "transactionIndex": "0x6", "type": "0x2" } } ``` --- ### `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. #### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xab63a9e94ddf139cac37b78bf436f8ea9371693e980ca40fadfc5ff86163c212", "0x0"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ### `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. #### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1 }' ``` #### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ### `eth_getLogs` > Returns an array of all logs matching a given filter object. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. #### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/avalanche/evm-methods/ title: Avalanche — EVM methods (1/3) source: docs/rpc-service/chains/chains-api/avalanche/evm-methods.mdx --- # Avalanche — EVM methods (1/3) > API reference for [Avalanche](/rpc-service/chains/chains-api/avalanche/). [All methods ->](/rpc-service/chains/chains-api/avalanche/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/) · [3](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/) ## EVM methods * [`web3_clientVersion`](#web3_clientversion) — returns the current client version. * [`web3_sha3`](#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](#net_version) — returns the current network ID. * [`net_listening`](#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/#eth_getlogs) — returns logs matching the parameters specified. * [`eth_getAssetBalance`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#eth_getassetbalance) — retrieves the balance of first class Avalanche Native Tokens on the C-Chain (excluding AVAX, which must be fetched with eth_getBalance). * [`eth_baseFee`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#eth_basefee) — retrieves the base fee for the next block. * [`eth_maxPriorityFeePerGas`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#eth_maxpriorityfeepergas) — retrieves the priority fee needed to be included in a block. * [`eth_getChainConfig`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#eth_getchainconfig) — retrieves chain config. --- ### `web3_clientVersion` > Returns the current client version. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * ``: the current client version. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "v0.11.5" } ``` --- ## EVM methods ### `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. #### Returns * `` (data): the SHA3 result of the given string. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ### `net_version` > Returns the current network ID. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * ``: the current network ID. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "43114" } ``` --- ### `net_listening` > Returns `true` if client is actively listening for network connections. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * ``: `true` when listening, otherwise `false`. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ### `eth_syncing` > Returns an object with data about the sync status or false. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * ``|``: an object with sync status data or FALSE, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` #### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` #### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ### `eth_gasPrice` > Returns the current price per gas in wei. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * `` (quantity): the current gas price in wei. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5d21dba00" } ``` --- ### `eth_accounts` > Returns a list of addresses owned by client. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * `` (string; data, 20 bytes): addresses owned by the client. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ### `eth_blockNumber` > Returns the number of most recent block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * `` (quantity): the current block number the client is on. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1928257" } ``` --- ### `eth_getBalance` > Returns the balance of the account specified by address. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address to check for balance. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (quantity): the current balance in wei. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xE4E853Ca02a90efEA7574638085D79A89fc3Da18", "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xf249f35d9960e28" } ``` --- ### `eth_getStorageAt` > Returns the value from a storage position at an address specified. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (data): the value at this storage position. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ### `eth_getTransactionCount` > Returns the number of transactions sent from an address. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (quantity): the number of transactions send from this address. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x6d9A4c3f415A4470BA94018d1DCd32c2EFC461C0", "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2293" } ``` --- ### `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes; required): a block hash. #### Returns * `` (quantity): the number of transactions in this block. #### Request example: ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xc953ab39022fd2afc22817cfe297df7d17945cccce35f24e4a5e7d3d4864c10d"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6" } ``` --- ### `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (quantity): the number of transactions in this block. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4" } ``` --- ### `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. #### Returns * `` (quantity): the number of uncles in this block. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xc953ab39022fd2afc22817cfe297df7d17945cccce35f24e4a5e7d3d4864c10d"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ### `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (quantity): the number of uncles in this block. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x192827C"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ### `eth_getCode` > Returns code at a given address. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (data): the code from the given address. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ### `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. #### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ### `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (hex encoded bytes): the return value of executed contract. #### Request example ```shell curl -X POST https://rpc.ankr.com/avalanche/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/avalanche/ title: Avalanche description: Avalanche is an ecosystem made up of three core Blockchains optimized for specific tasks within the network. Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/avalanche/index.mdx --- # Avalanche
> Avalanche API is available on [Web3 API platform](https://www.ankr.com/rpc/avalanche). *Avalanche* is an ecosystem made up of three core Blockchains optimized for specific tasks within the network. The **Exchange Chain** (X-Chain), **Platform Chain** (P-Chain), and **Contract Chain** (C-Chain). We also support Standard EVM API for Avalanche. Avalanche was built specifically with Defi dApps and protocols in mind, focusing on security, low latency, and high throughput. Avalanche uses a novel consensus protocol by utilizing two different consensus mechanisms. The consensus protocol ensures a high degree of security and fast finality even with multiple chains running simultaneously. For Avalanche, we support the following APIs: * [Standard EVM API](/rpc-service/chains/chains-api/avalanche/#evm-methods) * [P-Chain API](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#p-chain-methods) * [C-Chain API](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#c-chain-methods) * [X-Chain API](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#x-chain-methods) In order for your Web3 application to interact with the Avalanche blockchain — either by reading blockchain data or sending transactions to the network — it must connect to an Avalanche node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format. ## Methods ### EVM methods - [`web3_clientVersion`](/rpc-service/chains/chains-api/avalanche/evm-methods/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/avalanche/evm-methods/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/avalanche/evm-methods/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/avalanche/evm-methods/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/avalanche/evm-methods/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/avalanche/evm-methods-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/avalanche/evm-methods-p3/#eth_getlogs) ### EVM methods, P-Chain methods - [`eth_getAssetBalance`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#eth_getassetbalance) - [`eth_baseFee`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#eth_basefee) - [`eth_maxPriorityFeePerGas`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#eth_maxpriorityfeepergas) - [`eth_getChainConfig`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#eth_getchainconfig) - [`platform.getBalance`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#platformgetbalance) - [`platform.getBlock`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#platformgetblock) - [`platform.getBlockchains`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#platformgetblockchains) - [`platform.getBlockchainStatus`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#platformgetblockchainstatus) - [`platform.getCurrentSupply`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#platformgetcurrentsupply) - [`platform.getCurrentValidators`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#platformgetcurrentvalidators) - [`platform.getHeight`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#platformgetheight) - [`platform.getMaxStakeAmount`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#platformgetmaxstakeamount) - [`platform.getMinStake`](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#platformgetminstake) - [`platform.getPendingValidators`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgetpendingvalidators) - [`platform.getRewardUTXOs`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgetrewardutxos) - [`platform.getStake`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgetstake) - [`platform.getStakingAssetID`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgetstakingassetid) - [`platform.getSubnets`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgetsubnets) - [`platform.getTimestamp`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgettimestamp) - [`platform.getTotalStake`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgettotalstake) - [`platform.getTx`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgettx) - [`platform.getTxStatus`](/rpc-service/chains/chains-api/avalanche/evm-methods-2-p2/#platformgettxstatus) ### P-Chain methods, C-Chain methods, X-Chain methods - [`platform.getUTXOs`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformgetutxos) - [`platform.getValidatorsAt`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformgetvalidatorsat) - [`platform.issueTx`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformissuetx) - [`platform.sampleValidators`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformsamplevalidators) - [`platform.validatedBy`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformvalidatedby) - [`platform.validates`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#platformvalidates) - [`avax.getAtomicTx`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#avaxgetatomictx) - [`avax.getAtomicTxStatus`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#avaxgetatomictxstatus) - [`avax.getUTXOs`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#avaxgetutxos) - [`avax.issueTx`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#avaxissuetx) - [`avm.buildGenesis`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#avmbuildgenesis) - [`avm.getAddressTxs`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#avmgetaddresstxs) - [`avm.getAllBalances`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#avmgetallbalances) - [`avm.getAssetDescription`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#avmgetassetdescription) - [`avm.getBalance`](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#avmgetbalance) - [`avm.getBlock`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgetblock) - [`avm.getBlockByHeight`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgetblockbyheight) - [`avm.getHeight`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgetheight) - [`avm.getTx`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgettx) - [`avm.getTxStatus`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgettxstatus) - [`avm.getUTXOs`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgetutxos) - [`avm.issueTx`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmissuetx) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/ title: Avalanche — P-Chain methods, C-Chain methods, X-Chain methods (2/2) source: docs/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2.mdx --- # Avalanche — P-Chain methods, C-Chain methods, X-Chain methods (2/2) > API reference for [Avalanche](/rpc-service/chains/chains-api/avalanche/). [All methods ->](/rpc-service/chains/chains-api/avalanche/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/avalanche/p-chain-methods/) · 2 ## X-Chain methods ### `avm.getBlock` > Retrieves the block with the given ID. #### Parameters **Signature**: ``` avm.getBlock({ blockID: string encoding: string // optional }) -> { block: string, encoding: string } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `blockID`: the block ID. It should be in cb58 format. * `encoding`: the encoding format to use; can be either `hex` or `json`; defaults to `hex`. **Response parameters**: * `block`: the transaction encoded to `encoding`. * `encoding`: the encoding. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getBlock", "params" : { "blockID": "295FiDpgy35WZmzQbXVdCTQccQ1JTPAdBV7FYHtwgM7YLcFyV6", "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block": "0x00000000002000000000641ad33ede17f652512193721df87994f783ec806bb5640c39ee73676caffcc3215e0651000000000049a80a000000010000000e0000000100000000000000000000000000000000000000000000000000000000000000000000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000002e1a2a3910000000000000000000000001000000015cf998275803a7277926912defdf177b2e97b0b400000001e0d825c5069a7336671dd27eaa5c7851d2cf449e7e1cdc469c5c9e5a953955950000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000050000008908223b680000000100000000000000005e45d02fcc9e585544008f1df7ae5c94bf7f0f2600000000641ad3b600000000642d48b60000005aedf802580000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000005aedf80258000000000000000000000001000000015cf998275803a7277926912defdf177b2e97b0b40000000b000000000000000000000001000000012892441ba9a160bcdc596dcd2cc3ad83c3493589000000010000000900000001adf2237a5fe2dfd906265e8e14274aa7a7b2ee60c66213110598ba34fb4824d74f7760321c0c8fb1e8d3c5e86909248e48a7ae02e641da5559351693a8a1939800286d4fa2", "encoding": "hex" }, "id": 1 } ``` --- ### `avm.getBlockByHeight` > Retrieves a block at the given height. #### Parameters **Signature**: ``` avm.getBlockByHeight({ height: string encoding: string // optional }) -> { block: string, encoding: string } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `blockHeight`: the block height. * `encoding`: the encoding format to use; can be either `hex` or `json`; defaults to `hex`. **Response parameters**: * `block`: the transaction encoded to `encoding`. * `encoding`: the encoding. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "avm.getBlockByHeight", "params": { “height”: “275686313486”, "encoding": “hex” } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block": "0x00000000002000000000642f6739d4efcdd07e4d4919a7fc2020b8a0f081dd64c262aaace5a6dad22be0b55fec0700000000004db9e100000001000000110000000100000000000000000000000000000000000000000000000000000000000000000000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000070000005c6ece390000000000000000000000000100000001930ab7bf5018bfc6f9435c8b15ba2fe1e619c0230000000000000000ed5f38341e436e5d46e2bb00b45d62ae97d1b050c64bc634ae10626739e35c4b00000001c6dda861341665c3b555b46227fb5e56dc0a870c5482809349f04b00348af2a80000000021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000050000005c6edd7b40000000010000000000000001000000090000000178688f4d5055bd8733801f9b52793da885bef424c90526c18e4dd97f7514bf6f0c3d2a0e9a5ea8b761bc41902eb4902c34ef034c4d18c3db7c83c64ffeadd93600731676de", "encoding": "hex" }, "id": 1 } ``` --- ### `avm.getHeight` > Retrieves the height of the last accepted block. #### Parameters **Signature**: ``` avm.getHeight() -> { height: uint64, } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): none. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "avm.getHeight", "params": {} }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "height": "5094088" }, "id": 1 } ``` --- ### `avm.getTx` > Retrieves the specified transaction. The `encoding` parameter sets the format of the returned transaction. Can be either `hex` or `json`. Defaults to `hex`. #### Parameters **Signature**: ``` avm.getTx({ txID: string, encoding: string, //optional }) -> { tx: string, encoding: string, } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `txID`: a transaction ID. * `encoding`: the encoding format to use; can be either `hex` or `json`; defaults to `hex`. **Response parameters**: * `credentials`: a list of this transaction's credentials. Each credential proves that this transaction's creator is allowed to consume one of this transaction's inputs. Each credential is a list of signatures. * `unsignedTx`: the non-signature portion of the transaction. * `networkID`: the ID of the network this transaction happened on. (Avalanche Mainnet is 1.) * `blockchainID`: the ID of the blockchain this transaction happened on. (Avalanche Mainnet X-Chain is 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM.) * Each element of `outputs` is an output (UTXO) of this transaction that is not being exported to another chain. * Each element of `inputs` is an input of this transaction which has not been imported from another chain. * Import Transactions have additional fields `sourceChain` and `importedInputs`, which specify the blockchain ID that assets are being imported from, and the inputs that are being imported. * Export Transactions have additional fields `destinationChain` and `exportedOutputs`, which specify the blockchain ID that assets are being exported to, and the UTXOs that are being exported. An output contains: * `assetID`: the ID of the asset being transferred. (The Mainnet Avax ID is `FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z`.) * `fxID`: the ID of the FX this output uses. * `output`: the FX-specific contents of this output. Most outputs use the secp256k1 FX, look like this: ```json { "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", "output": { "addresses": ["X-avax126rd3w35xwkmj8670zvf7y5r8k36qa9z9803wm"], "amount": 1530084210, "locktime": 0, "threshold": 1 } } ``` #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getTx", "params" :{ "txID":"2oJCbb8pfdxEHAf9A8CdN4Afj9VSR3xzyzNkf8tDv7aM1sfNFL", "encoding": "json" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "tx": { "unsignedTx": { "networkID": 1, "blockchainID": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM", "outputs": [], "inputs": [ { "txID": "2jbZUvi6nHy3Pgmk8xcMpSg5cW6epkPqdKkHSCweb4eRXtq4k9", "outputIndex": 1, "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", "input": { "amount": 2570382395, "signatureIndices": [ 0 ] } } ], "memo": "0x", "destinationChain": "11111111111111111111111111111111LpoYY", "exportedOutputs": [ { "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", "output": { "addresses": [ "X-avax1tnuesf6cqwnjw7fxjyk7lhch0vhf0v95wj5jvy" ], "amount": 2569382395, "locktime": 0, "threshold": 1 } } ] }, "credentials": [ { "fxID": "spdxUxVJQbX85MGxMHbKw1sHxMnSqJ3QBzDyDYEP3h6TLuxqQ", "credential": { "signatures": [ "0x46ebcbcfbee3ece1fd15015204045cf3cb77f42c48d0201fc150341f91f086f177cfca8894ca9b4a0c55d6950218e4ea8c01d5c4aefb85cd7264b47bd57d224400" ] } } ], "id": "2oJCbb8pfdxEHAf9A8CdN4Afj9VSR3xzyzNkf8tDv7aM1sfNFL" }, "encoding": "json" }, "id": 1 } ``` --- ### `avm.getTxStatus` > Retrieves the status of a transaction sent to the network. #### Parameters **Signature**: ``` avm.getTxStatus({txID: string}) -> {status: string} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `txID`: a transaction ID. **Response example**: * `status`: either of the following items: * `Accepted`: the transaction is (or will be) accepted by every node. * `Processing`: the transaction is being voted on by this node. * `Rejected`: the transaction will never be accepted by any node in the network. * `Unknown`: the transaction hasn’t been seen by this node. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getTxStatus", "params" :{ "txID":"2QouvFWUbjuySRxeX5xMbNCuAaKWfbk5FeEa2JmoF85RKLk2dD" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "status": "Accepted" } } ``` --- ### `avm.getUTXOs` > Retrieves the UTXOs that reference a given address. If `sourceChain` is specified, then it will retrieve the atomic UTXOs exported from that chain to the X Chain. #### Parameters **Signature**: ``` avm.getUTXOs({ addresses: []string, limit: int, //optional startIndex: { //optional address: string, utxo: string }, sourceChain: string, //optional encoding: string //optional }) -> { numFetched: int, utxos: []string, endIndex: { address: string, utxo: string }, sourceChain: string, //optional encoding: string } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `utxos`: a list of UTXOs such that each UTXO references at least one address in addresses. * `limit`: the max number of UTXOs to be returned; if limit is omitted or greater than 1024, it is set to 1024. * This method supports pagination. endIndex denotes the last UTXO returned. To get the next set of UTXOs, use the value of endIndex as startIndex in the next call. * If `startIndex` is omitted, will fetch all UTXOs up to limit. * When using pagination (when startIndex is provided), UTXOs are not guaranteed to be unique across multiple calls. That is, a UTXO may appear in the result of the first call, and then again in the second call. * When using pagination, consistency is not guaranteed across multiple calls. That is, the UTXO set of the addresses may have changed between calls. * `encoding`: sets the format for the returned UTXOs. Can only be hex when a value is provided. #### Request example Suppose we want all UTXOs that reference at least one of `X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5` and `X-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6`. ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getUTXOs", "params" :{ "addresses":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "X-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6"], "limit":5, "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "numFetched": "5", "utxos": [ "0x0000a195046108a85e60f7a864bb567745a37f50c6af282103e47cc62f036cee404700000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216c1f01765", "0x0000ae8b1b94444eed8de9a81b1222f00f1b4133330add23d8ac288bffa98b85271100000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216473d042a", "0x0000731ce04b1feefa9f4291d869adc30a33463f315491e164d89be7d6d2d7890cfc00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21600dd3047", "0x0000b462030cc4734f24c0bc224cf0d16ee452ea6b67615517caffead123ab4fbf1500000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216c71b387e", "0x000054f6826c39bc957c0c6d44b70f961a994898999179cc32d21eb09c1908d7167b00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f2166290e79d" ], "endIndex": { "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "utxo": "kbUThAUfmBXUmRgTpgD6r3nLj7rJUGho6xyht5nouNNypH45j" }, "encoding": "hex" }, "id": 1 } ``` #### Request example Since `numFetched` is the same as `limit`, we can tell that there may be more UTXOs that were not fetched. We call the method again, this time with `startIndex`: ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getUTXOs", "params" :{ "addresses":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], "limit":5, "startIndex": { "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "utxo": "kbUThAUfmBXUmRgTpgD6r3nLj7rJUGho6xyht5nouNNypH45j" }, "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "numFetched": "4", "utxos": [ "0x000020e182dd51ee4dcd31909fddd75bb3438d9431f8e4efce86a88a684f5c7fa09300000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21662861d59", "0x0000a71ba36c475c18eb65dc90f6e85c4fd4a462d51c5de3ac2cbddf47db4d99284e00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21665f6f83f", "0x0000925424f61cb13e0fbdecc66e1270de68de9667b85baa3fdc84741d048daa69fa00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216afecf76a", "0x000082f30327514f819da6009fad92b5dba24d27db01e29ad7541aa8e6b6b554615c00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216779c2d59" ], "endIndex": { "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "utxo": "21jG2RfqyHUUgkTLe2tUp6ETGLriSDTW3th8JXFbPRNiSZ11jK" }, "encoding": "hex" }, "id": 1 } ``` #### Request example Since `numFetched` is less than `limit`, we know that we are done fetching UTXOs and don’t need to call this method again. Suppose we want to fetch the UTXOs exported from the P Chain to the X Chain in order to build an ImportTx. Then we need to call GetUTXOs with the `sourceChain` argument in order to retrieve the atomic UTXOs: ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getUTXOs", "params" :{ "addresses":["X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "X-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6"], "limit":5, "sourceChain": "P", "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "numFetched": "1", "utxos": [ "0x00001f989ffaf18a18a59bdfbf209342aa61c6a62a67e8639d02bb3c8ddab315c6fa0000000039c33a499ce4c33a3b09cdd2cfa01ae70dbf2d18b2d7d168524440e55d550088000000070011c304cd7eb5c0000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c83497819" ], "endIndex": { "address": "X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "utxo": "2Sz2XwRYqUHwPeiKoRnZ6ht88YqzAF1SQjMYZQQaB5wBFkAqST" }, "encoding": "hex" }, "id": 1 } ``` --- ### `avm.issueTx` > Sends a signed transaction to the network. #### Parameters **Signature**: ``` avm.issueTx({ tx: string, encoding: string, //optional }) -> { txID: string } ``` **Request parameters** * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `tx`: a transaction. * `encoding`: the encoding format to use; can be either `hex` or `json`; defaults to `hex`. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.issueTx", "params" :{ "tx": "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730", "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "txID": "NUPLwbt2hsYxpQg4H2o451hmTWQ4JZx2zMzM4SinwtHgAdX1JLPHXvWSXEnpecStLj" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/avalanche/p-chain-methods/ title: Avalanche — P-Chain methods, C-Chain methods, X-Chain methods (1/2) source: docs/rpc-service/chains/chains-api/avalanche/p-chain-methods.mdx --- # Avalanche — P-Chain methods, C-Chain methods, X-Chain methods (1/2) > API reference for [Avalanche](/rpc-service/chains/chains-api/avalanche/). [All methods ->](/rpc-service/chains/chains-api/avalanche/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/) ### `platform.getUTXOs` > Retrieves the UTXOs that reference a given set of addresses. #### Parameters **Signature**: ``` platform.getUTXOs( { addresses: []string, limit: int, // optional startIndex: { // optional address: string, utxo: string }, sourceChain: string, // optional encoding: string, // optional }, ) -> { numFetched: int, utxos: []string, endIndex: { address: string, utxo: string }, encoding: string, } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `addresses`: a list of addresses to retrieve the info for. * `limit`: the max number of UTXOs to be returned; if limit is omitted or greater than 1024, it is set to 1024. * `encoding` specifies the format for the returned UTXOs; can only be `hex` when a value is provided. **Response parameters**: * `utxos` is a list of UTXOs such that each UTXO references at least one address in addresses. * At most limit UTXOs are returned. If limit is omitted or greater than 1024, it is set to 1024. * This method supports pagination. endIndex denotes the last UTXO returned. To get the next set of UTXOs, use the value of `endIndex` as `startIndex` in the next call. * If `startIndex` is omitted, will fetch all UTXOs up to `limit`. * When using pagination (that is when `startIndex` is provided), UTXOs are not guaranteed to be unique across multiple calls. That is, a UTXO may appear in the result of the first call, and then again in the second call. * When using pagination, consistency is not guaranteed across multiple calls. That is, the UTXO set of the addresses may have changed between calls. * `encoding` specifies the format for the returned UTXOs; can only be `hex` when a value is provided. #### Request example Suppose we want all UTXOs that reference at least one of `P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5` and `P-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6`. ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getUTXOs", "params" :{ "addresses":["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "P-avax1d09qn852zcy03sfc9hay2llmn9hsgnw4tp3dv6"], "limit":5, "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "numFetched": "5", "utxos": [ "0x0000a195046108a85e60f7a864bb567745a37f50c6af282103e47cc62f036cee404700000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216c1f01765", "0x0000ae8b1b94444eed8de9a81b1222f00f1b4133330add23d8ac288bffa98b85271100000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216473d042a", "0x0000731ce04b1feefa9f4291d869adc30a33463f315491e164d89be7d6d2d7890cfc00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21600dd3047", "0x0000b462030cc4734f24c0bc224cf0d16ee452ea6b67615517caffead123ab4fbf1500000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216c71b387e", "0x000054f6826c39bc957c0c6d44b70f961a994898999179cc32d21eb09c1908d7167b00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f2166290e79d" ], "endIndex": { "address": "P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "utxo": "kbUThAUfmBXUmRgTpgD6r3nLj7rJUGho6xyht5nouNNypH45j" }, "encoding": "hex" }, "id": 1 } ``` #### Request example Since numFetched is the same as limit, we can tell that there may be more UTXOs that were not fetched. We call the method again, this time with `startIndex`: ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getUTXOs", "params" :{ "addresses":["P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], "limit":5, "startIndex": { "address": "P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "utxo": "0x62fc816bb209857923770c286192ab1f9e3f11e4a7d4ba0943111c3bbfeb9e4a5ea72fae" }, "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "numFetched": "4", "utxos": [ "0x000020e182dd51ee4dcd31909fddd75bb3438d9431f8e4efce86a88a684f5c7fa09300000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21662861d59", "0x0000a71ba36c475c18eb65dc90f6e85c4fd4a462d51c5de3ac2cbddf47db4d99284e00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f21665f6f83f", "0x0000925424f61cb13e0fbdecc66e1270de68de9667b85baa3fdc84741d048daa69fa00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216afecf76a", "0x000082f30327514f819da6009fad92b5dba24d27db01e29ad7541aa8e6b6b554615c00000000345aa98e8a990f4101e2268fab4c4e1f731c8dfbcffa3a77978686e6390d624f000000070000000000000001000000000000000000000001000000018ba98dabaebcd83056799841cfbc567d8b10f216779c2d59" ], "endIndex": { "address": "P-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "utxo": "21jG2RfqyHUUgkTLe2tUp6ETGLriSDTW3th8JXFbPRNiSZ11jK" }, "encoding": "hex" }, "id": 1 } ``` --- ### `platform.getValidatorsAt` > Retrieves the validators and their weights of a Subnet or the Primary Network at a given P-Chain height. #### Parameters **Signature**: ``` platform.getValidatorsAt( { height: int, subnetID: string, // optional } ) ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `height`: the P-Chain height to get the validator set at. * `subnetID`: the Subnet ID to get the validator set of; if not given, gets validator set of the Primary Network. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getValidatorsAt", "params" :{ "height": 1, "subnetID": "11111111111111111111111111111111LpoYY" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "validators": { "NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg": 2000000000000000, "NodeID-GWPcbFJZFfZreETSoWjPimr846mXEKCtu": 2000000000000000, "NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ": 2000000000000000, "NodeID-NFBbbJ4qCmNaCzeW7sxErhvWqvEQMnYcN": 2000000000000000, "NodeID-P7oB2McjBGgW2NXXWVYjV8JEDFoW9xDE5": 2000000000000000 } }, "id": 1 } ``` --- ### `platform.issueTx` > Issues a transaction to the Platform Chain. #### Parameters **Signature**: ``` platform.issueTx({ tx: string, encoding: string, // optional }) -> {txID: string} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `tx`: the byte representation of a transaction. * `encoding`: specifies the encoding format for the transaction bytes; can only be hex when a value is provided. **Response parameters**: * `txID`: the transaction’s ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.issueTx", "params" :{ "tx": "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730", "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "txID": "G3BuH6ytQ2averrLxJJugjWZHTRubzCrUZEXoheG5JMqL5ccY" }, "id": 1 } ``` --- ### `platform.sampleValidators` > Retrieves the validators from the specified Subnet. #### Parameters **Signature**: ``` platform.sampleValidators( { size: int, subnetID: string, // optional } ) -> { validators: []string } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `size`: the number of validators to sample. * `subnetID`: the Subnet to sampled from; if omitted, defaults to the Primary Network. **Response parameters**: * `validators`: each element of validators is the ID of a validator. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.sampleValidators", "params" :{ "size":2 } }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "validators": [ "NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ", "NodeID-NFBbbJ4qCmNaCzeW7sxErhvWqvEQMnYcN" ] } } ``` --- ### `platform.validatedBy` > Retrieves the Subnet that validates a given blockchain. #### Parameters **Signature**: ``` platform.validatedBy( { blockchainID: string } ) -> {subnetID: string} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `blockchainID`: the blockchain’s ID. **Response parameters**: * `subnetID` the ID of the Subnet that validates the blockchain. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.validatedBy", "params" : { "blockchainID": "DKtd96mRjG1fgfL1Bcr9gppJaPxi9345iLR3W9ZZwq8ZChY9A" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "subnetID": "2bRCr6B4MiEfSjidDwxDpdCyviwnfUVqB2HGwhm947w9YYqb7r" }, "id": 1 } ``` --- ### `platform.validates` > Retrieves the IDs of the blockchains a Subnet validates. #### Parameters **Signature**: ``` platform.validates( { subnetID: string } ) -> {blockchainIDs: []string} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `subnetID`: the Subnet’s ID. **Response parameters**: * `blockchainIDs`: each element of blockchainIDs is the ID of a blockchain the Subnet validates. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.validates", "params" : { "subnetID":"4vczxAbLhSpzypadHFEfY8Kn2kibhcZLQgoX9A34rAnADyXnp" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "blockchainIDs": [ "KDYHHKjM4yTJTT8H8qPs5KXzE6gQH5TZrmP1qVr1P6qECj3XN", "2TtHFqEAAJ6b33dromYMqfgavGPF3iCpdG3hwNMiart2aB5QHi" ] }, "id": 1 } ``` --- ## C-Chain methods * [`avax.getAtomicTx`](#avaxgetatomictx) — retrieves a transaction by its ID. * [`avax.getAtomicTxStatus`](#avaxgetatomictxstatus) — retrieves the status of an atomic transaction sent to the network. * [`avax.getUTXOs`](#avaxgetutxos) — retrieves the UTXOs that reference a given address. * [`avax.issueTx`](#avaxissuetx) — sends a signed transaction to the network. --- ### `avax.getAtomicTx` > Retrieves a transaction by its ID. Optional encoding parameter to specify the format for the returned transaction. Can only be `hex` when a value is provided. #### Parameters **Signature**: ``` avax.getAtomicTx({ txID: string, encoding: string, //optional }) -> { tx: string, encoding: string, blockHeight: string } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `txID`: the transaction ID in cb58 format. * `encoding`: the encoding format to use; can only be `hex` when a value is provided. **Response parameters**: * `tx`: the transaction encoded to encoding. * `encoding`: the encoding. * `blockHeight`: the height of the block at which the transaction was included in. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-c/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avax.getAtomicTx", "params" : { "txID":"2GD5SRYJQr2kw5jE73trBFiAgVQyrCaeg223TaTyJFYXf2kPty", "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "tx": "0x000000000000000030399d0775f450604bd2fbc49ce0c5c1c6dfeb2dc2acb8c92c26eeae6e6df4502b19d891ad56056d9c01f18f43f58b5c784ad07a4a49cf3d1f11623804b5cba2c6bf000000018212d6807a0ec9c1b26321418fe7a548180b5be728ce53fe7e98ab5755ed316100000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000005000003a352a382400000000100000000000000018db97c7cece249c2b98bdc0226cc4c2a57bf52fc000003a3529edd17dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000010000000900000001ead19377f015422fbb8731204fcf6d6879dd05146c2d5b5594e2fea2cb420b2f40bd457b71e279e547790b28fe5482f278c76cf39b2dce5c2e6c53352fe6827d002cc7d20d", "encoding": "hex", "blockHeight": "1" }, "id": 1 } ``` --- ### `avax.getAtomicTxStatus` > Retrieves the status of an atomic transaction sent to the network. #### Parameters **Signature**: ``` avax.getAtomicTxStatus({txID: string}) -> { status: string, blockHeight: string // returned when status is Accepted } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `txID`: the transaction ID in cb58 format. **Response parameters**: * `status`: either of the following items: * `Accepted`: the transaction is (or will be) accepted by every node. Check the `blockHeight` property. * `Processing`: the transaction is being voted on by this node. * `Dropped`: the transaction was dropped by this node because it thought the transaction invalid. * `Unknown`: the transaction hasn’t been seen by this node. #### Response example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-c/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avax.getAtomicTxStatus", "params" : { "txID":"2QouvFWUbjuySRxeX5xMbNCuAaKWfbk5FeEa2JmoF85RKLk2dD" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "status": "Accepted", "blockHeight": "1" } } ``` --- ### `avax.getUTXOs` > Retrieves the UTXOs that reference a given address. #### Parameters **Signature**: ``` avax.getUTXOs( { addresses: string, limit: int, //optional startIndex: { //optional address: string, utxo: string }, sourceChain: string, encoding: string, //optional }, ) -> { numFetched: int, utxos: []string, endIndex: { address: string, utxo: string } } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `utxos`: a list of UTXOs such that each UTXO references at least one address in addresses. * `limit`: the max number of UTXOs to be returned; if limit is omitted or greater than 1024, it is set to 1024. * This method supports pagination. `endIndex` denotes the last UTXO returned. To get the next set of UTXOs, use the value of `endIndex` as `startIndex` in the next call. * If `startIndex` is omitted, will fetch all UTXOs up to limit. * When using pagination (that is when `startIndex` is provided), UTXOs are not guaranteed to be unique across multiple calls. That is, a UTXO may appear in the result of the first call, and then again in the second call. * When using pagination, consistency is not guaranteed across multiple calls. That is, the UTXO set of the addresses may have changed between calls. * `encoding` sets the format for the returned UTXOs; can only be `hex` when a value is provided. #### Request example Suppose we want all UTXOs that reference at least one of `C-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5`. ```shell curl -X POST 'https://rpc.ankr.com/avalanche-c/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avax.getUTXOs", "params" : { "addresses":["C-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5"], "sourceChain": "X", "startIndex": { "address": "C-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "utxo": "22RXW7SWjBrrxu2vzDkd8uza7fuEmNpgbj58CxBob9UbP37HSB" }, "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "numFetched": "3", "utxos": [ "0x0000a799e7448acf74ca9223159a04f93b948f99cf28509f908839532b2f85baffc300000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007000003a352a38240000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c22d23171", "0x00006385c683d43bdbe754c224be36c5004ea7ce49c0849cadeaea6af93dae18cc7700000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007000003a352a38240000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29cb81cc877", "0x000038137283c94582351b86c3e90808312636769e3f5c14fbf1152d6634f770695c00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007000003a352a38240000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c7412490e" ], "endIndex": { "address": "C-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "utxo": "0x9333ef8a05f26acf2d8766f94723f749870fa2ca80c19c33cc945d79013d7c50fd023beb" }, "encoding": "hex" }, "id": 1 } ``` --- ### `avax.issueTx` > Sends a signed transaction to the network. `encoding` specifies the format of the signed transaction. Can only be hex when a value is provided. #### Parameters **Signature**: ``` avax.issueTx({ tx: string, encoding: string, //optional }) -> { txID: string } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `tx`: a transaction. * `encoding`: the encoding format to use; can only be `hex` when a value is provided. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-c/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avax.issueTx", "params" : { "tx": "0x00000009de31b4d8b22991d51aa6aa1fc733f23a851a8c9400000000000186a0000000005f041280000000005f9ca900000030390000000000000001fceda8f90fcb5d30614b99d79fc4baa29307762668f16eb0259a57c2d3b78c875c86ec2045792d4df2d926c40f829196e0bb97ee697af71f5b0a966dabff749634c8b729855e937715b0e44303fd1014daedc752006011b730", "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "txID": "NUPLwbt2hsYxpQg4H2o451hmTWQ4JZx2zMzM4SinwtHgAdX1JLPHXvWSXEnpecStLj" } } ``` --- ## X-Chain methods * [`avm.buildGenesis`](#avmbuildgenesis) — creates the byte representation of the given JSON representation of the Virtual Machine's genesis state. * [`avm.getAddressTxs`](#avmgetaddresstxs) — retrieves all transactions that change the balance of the given address. * [`avm.getAllBalances`](#avmgetallbalances) — retrieves the balances of all assets controlled by a given address. * [`avm.getAssetDescription`](#avmgetassetdescription) — retrieves information about an asset. * [`avm.getBalance`](#avmgetbalance) — retrieves the balance of an asset controlled by a given address. * [`avm.getBlock`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgetblock) — retrieves the block with the given ID. * [`avm.getBlockByHeight`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgetblockbyheight) — retrieves a block at the given height. * [`avm.getHeight`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgetheight) — retrieves the height of the last accepted block. * [`avm.getTx`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgettx) — retrieves the specified transaction. * [`avm.getTxStatus`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgettxstatus) — retrieves the status of a transaction sent to the network. * [`avm.getUTXOs`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmgetutxos) — retrieves the UTXOs that reference a given address. * [`avm.issueTx`](/rpc-service/chains/chains-api/avalanche/p-chain-methods-p2/#avmissuetx) — sends a signed transaction to the network. --- ### `avm.buildGenesis` > Creates the byte representation of the given JSON representation of the Virtual Machine's genesis state. #### Parameters **Signature**: ``` avm.buildGenesis({ networkID: int, genesisData: JSON, encoding: string, //optional }) -> { bytes: string, encoding: string, } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `networkID`: a network ID. * `encoding`: the encoding format to use for arbitrary bytes, that is the genesis bytes that are returned; can only be `hex` when a value is provided. * `genesisData`: has the following structure: ```json { "genesisData" : { "assetAlias1": { // Each object defines an asset "name": "human readable name", "symbol":"AVAL", // Symbol is between 0 and 4 characters "initialState": { "fixedCap" : [ // Choose the asset type. { // Can be "fixedCap", "variableCap", "limitedTransfer", "nonFungible" "amount":1000, // At genesis, address A has "address":"A" // 1000 units of asset }, { "amount":5000, // At genesis, address B has "address":"B" // 1000 units of asset }, ... // Can have many initial holders ] } }, "assetAliasCanBeAnythingUnique": { // Asset alias can be used in place of assetID in calls "name": "human readable name", // names need not be unique "symbol": "AVAL", // symbols need not be unique "initialState": { "variableCap" : [ // No units of the asset exist at genesis { "minters": [ // The signature of A or B can mint more of "A", // the asset. "B" ], "threshold":1 }, { "minters": [ // The signatures of 2 of A, B and C can mint "A", // more of the asset "B", "C" ], "threshold":2 }, ... // Can have many minter sets ] } }, ... // Can list more assets } } ``` #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.buildGenesis", "params" : { "networkId": 16, "genesisData": { "asset1": { "name": "myFixedCapAsset", "symbol":"MFCA", "initialState": { "fixedCap" : [ { "amount":100000, "address": "avax13ery2kvdrkd2nkquvs892gl8hg7mq4a6ufnrn6" }, { "amount":100000, "address": "avax1rvks3vpe4cm9yc0rrk8d5855nd6yxxutfc2h2r" }, { "amount":50000, "address": "avax1ntj922dj4crc4pre4e0xt3dyj0t5rsw9uw0tus" }, { "amount":50000, "address": "avax1yk0xzmqyyaxn26sqceuky2tc2fh2q327vcwvda" } ] } }, "asset2": { "name": "myVarCapAsset", "symbol":"MVCA", "initialState": { "variableCap" : [ { "minters": [ "avax1kcfg6avc94ct3qh2mtdg47thsk8nrflnrgwjqr", "avax14e2s22wxvf3c7309txxpqs0qe9tjwwtk0dme8e" ], "threshold":1 }, { "minters": [ "avax1y8pveyn82gjyqr7kqzp72pqym6xlch9gt5grck", "avax1c5cmm0gem70rd8dcnpel63apzfnfxye9kd4wwe", "avax12euam2lwtwa8apvfdl700ckhg86euag2hlhmyw" ], "threshold":2 } ] } } }, "encoding": "hex" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "bytes": "0x0000000000010006617373657431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f6d794669786564436170417373657400044d464341000000000100000000000000010000000700000000000186a10000000000000000000000010000000152b219bc1b9ab0a9f2e3f9216e4460bd5db8d153bfa57c3c", "encoding": "hex" }, "id": 1 } ``` --- ## X-Chain methods ### `avm.getAddressTxs` > Retrieves all transactions that change the balance of the given address. A transaction is said to change an address's balance if either is true: * A UTXO that the transaction consumes was at least partially owned by the address. * A UTXO that the transaction produces is at least partially owned by the address. #### Parameters **Signature**: ``` avm.getAddressTxs({ address: string, cursor: uint64, // optional, leave empty to get the first page assetID: string, pageSize: uint64 // optional, defaults to 1024 }) -> { txIDs: []string, cursor: uint64, } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `address`: the address for which we're fetching related transactions. * `assetID`: only return transactions that changed the balance of this asset. Must be an ID or an alias for an asset. * `pageSize`: number of items to return per page. Optional. Defaults to 1024. **Response parameters**: * `txIDs`: a list of transaction IDs that affected the balance of this address. * `cursor`: a page number or offset; use this in request to get the next page. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getAddressTxs", "params" : { "address":"X-avax1dp6707ka34puejwg7ntnenxry98h37yvsqsm7f", "assetID":"AVAX", "pageSize":20 } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "txIDs": ["SsJF7KKwxiUJkczygwmgLqo3XVRotmpKP8rMp74cpLuNLfwf6"], "cursor": "1" }, "id": 1 } ``` --- ### `avm.getAllBalances` > Retrieves the balances of all assets controlled by a given address. #### Parameters **Signature**: ``` avm.getAllBalances({address:string}) -> { balances: []{ asset: string, balance: int } } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `address`: an address to retrieves the balances for. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getAllBalances", "params" : { "address":"X-avax1dp6707ka34puejwg7ntnenxry98h37yvsqsm7f" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "balances": [ { "asset": "AVAX", "balance": "102" }, { "asset": "2sdnziCz37Jov3QSNMXcFRGFJ1tgauaj6L7qfk7yUcRPfQMC79", "balance": "10000" } ] }, "id": 1 } ``` --- ### `avm.getAssetDescription` > Retrieves information about an asset. #### Parameters **Signature**: ``` avm.getAssetDescription({assetID: string}) -> { assetId: string, name: string, symbol: string, denomination: int } ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `assetID`: the id of the asset for which the information is requested. **Response parameters**: * `name`: the asset’s human-readable, not necessarily unique name. * `symbol`: the asset’s symbol. * `denomination`: determines how balances of this asset are displayed by user interfaces. If denomination is 0, 100 units of this asset are displayed as 100. If denomination is 1, 100 units of this asset are displayed as 10.0. If denomination is 2, 100 units of this asset are displays as .100, etc. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getAssetDescription", "params" : { "assetID" :"FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z", "name": "Avalanche", "symbol": "AVAX", "denomination": "9" }, "id": 1 }` ``` --- ### `avm.getBalance` > Retrieves the balance of an asset controlled by a given address. #### Parameters **Signature**: ``` avm.getBalance({ address: string, assetID: string }) -> {balance: int} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `address`: an owner of the asset. * `assetID`: an ID of the asset for which the balance is requested. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/YOUR_ANKR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getBalance", "params" : { "address":"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5", "assetID": "2pYGetDWyKdHxpFxh2LHeoLNCH6H5vxxCxHQtFnnFaYxLsqtHC" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "balance": "299999999999900", "utxoIDs": [ { "txID": "WPQdyLNqHfiEKp4zcCpayRHYDVYuh1hqs9c1RqgZXS4VPgdvo", "outputIndex": 1 } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/b2-network/ title: B2 Network description: B2 Network — The B² Network is an advanced Layer-2 solution designed to enhance transaction speed, reduce costs, and broaden… 27 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/b2-network/index.mdx --- # B2 Network
> B² Network API is available on [Web3 API platform](https://www.ankr.com/rpc/b2). The B² Network is an advanced Layer-2 solution designed to enhance transaction speed, reduce costs, and broaden application diversity without compromising security. It is notable for being the first zero-knowledge proof verification commitment rollup on Bitcoin. Key Features: * **Zero-Knowledge Proof Verification**: Utilizes zero-knowledge proof technology to ensure transactional privacy and security, allowing for the verification of transactions without revealing the underlying data. * **Rollup Technology**: Processes multiple off-chain transactions and rolls them into a single on-chain transaction, significantly increasing efficiency and reducing costs. * **Turing-Complete Smart Contracts**: Supports Turing-complete smart contracts, enabling complex computations and a wide range of decentralized applications (dApps) to run off-chain with enhanced performance. * **Gate Commitment and Challenge-Response Mechanism**: Integrates gate commitment and challenge-response mechanisms, leveraging Taproot on Bitcoin to ensure secure and private transaction confirmations. * **EVM-Compatibility**: The B² Network is compatible with the Ethereum Virtual Machine (EVM), allowing it to run Ethereum-based smart contracts and dApps. This compatibility enables developers to use existing Ethereum tools, libraries, and standards while benefiting from the B² Network's enhanced features. In order for your Web3 application to interact with B² Network — either by reading blockchain data or sending transactions to the network — it must connect to a B² Network node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/b2-network/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/b2-network/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/b2-network/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/b2-network/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/b2-network/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/b2-network/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/b2-network/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/b2-network/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/b2-network/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/b2-network/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/b2-network/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/b2-network/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/b2-network/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/b2-network/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/b2-network/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/b2-network/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/b2-network/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/b2-network/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/b2-network/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/b2-network/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/b2-network/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/b2-network/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/b2-network/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/b2-network/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/b2-network/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/b2-network/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/b2-network/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/b2-network/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/b2-network/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/b2-network/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/b2-network/web3-p2/ title: B2 Network — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/b2-network/web3-p2.mdx --- # B2 Network — web3, net, eth (2/3) > API reference for [B2 Network](/rpc-service/chains/chains-api/b2-network/). [All methods ->](/rpc-service/chains/chains-api/b2-network/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/b2-network/web3/) · 2 · [3](/rpc-service/chains/chains-api/b2-network/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": null, "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x545e" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x25f8bb7ac8122d7587576e6aa2b78afefbde93c2e2b7ca979108a707f9917c5c", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0xfc", "blobGasUsed": "0x0", "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0x", "gasLimit": "0x1c9c380", "gasUsed": "0xaaf7", "hash": "0x25f8bb7ac8122d7587576e6aa2b78afefbde93c2e2b7ca979108a707f9917c5c", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x93c77d236c2f4c2ce5fbf69abc1aff8c6b86216adb3a124671126f86cb78b9d5", "nonce": "0x0000000000000000", "number": "0x212795", "parentBeaconBlockRoot": "0x6043e15a6cdde64923acb9693743f243a49325cc98de6d33cbd26f0440d2d35e", "parentHash": "0x99af047d13c59f2ce9d20ecad57ba3dea166b4f5b258e3defbfa1fd7a14a741d", "receiptsRoot": "0x3c81dad0b560c787b76a62404b505f1af6a8a2206ecbaf491f121c76e9ebf6fc", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x347", "stateRoot": "0x37bcc1f0582b73da6c64c56373ccd6d33e73d4e2bbeaf8c81320fdfdf7acc5ca", "timestamp": "0x665f1d34", "totalDifficulty": "0x0", "transactions": [ "0xb5d791d36244a1c27bbdae0ca04238f78670d678850fd52bab811b34df0f9f21" ], "transactionsRoot": "0xe7bf068a53281ca05dd4775c19d17068f4f27ee0493d36e416b957df156aa6e9", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0xfc", "blobGasUsed": "0x0", "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0x", "gasLimit": "0x1c9c380", "gasUsed": "0xaaf7", "hash": "0x02b622499320f9c314fcb6b993a340b1e39789bb80aad1d709dfab3dde51a203", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x07eeb3871030037427beaa9e9dae1d8e3c5dfaff2f9146ded0c7a5ef6dbeb791", "nonce": "0x0000000000000000", "number": "0x212a3f", "parentBeaconBlockRoot": "0x003bebf866fbe1a46265821f7497d4070b6dadc0526a0e5cd70f0751b96997b3", "parentHash": "0xd35418fbe61fce54fc6e3c64af11aaf016b4aa830af2547ebebe0c6860a8b19d", "receiptsRoot": "0xe1291cd769ea912233c271ab505aad09ed389d0f8451d01eecce1cbed8c3e9ce", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x347", "stateRoot": "0x1c1e13eb259f6d0cbaa59cf48be194fac42093853452325075fcbeff66980c73", "timestamp": "0x665f2288", "totalDifficulty": "0x0", "transactions": [ "0x4186a533c91231d2e22f4df8091e23f3767ad42bb0569ee5127335b01da3d95a" ], "transactionsRoot": "0x7e3dfa88438d346d8a76d16f80baef6caff31c23882f88940c723d8f760ed7fc", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbceca7e26ee25036f81e09bf5ea0c422e126a5408e995d7bee67ac2edd624357"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe6a4fda409f9954e2ce015a0a89bf4fa093f34f2f6c03edf321fc08415bad3cf", "blockNumber": "0x206d8b", "from": "0x31ec5f1659bd8ac9fcff8d74ada9cc6416090a01", "gas": "0xfd34", "gasPrice": "0xf433c", "maxFeePerGas": "0xf4438", "maxPriorityFeePerGas": "0xf4240", "hash": "0xbceca7e26ee25036f81e09bf5ea0c422e126a5408e995d7bee67ac2edd624357", "input": "0x3ccfd60b", "nonce": "0x27", "to": "0x4200000000000000000000000000000000000011", "transactionIndex": "0x1", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0xdf", "v": "0x1", "r": "0x909182fa4fc5f860ee6dce546429213dad37a36c892d5ab654a2363cdcff9ff9", "s": "0x2f1671462bfa0202361e47a0c4977271d9dd161502045dee3018903aa3eb67dc", "yParity": "0x1" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xe6a4fda409f9954e2ce015a0a89bf4fa093f34f2f6c03edf321fc08415bad3cf", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe6a4fda409f9954e2ce015a0a89bf4fa093f34f2f6c03edf321fc08415bad3cf", "blockNumber": "0x206d8b", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x0707e29317d36dc5995c648a693cef027fee63024eb90494523950e1799153f9", "input": "0x440a5e20000f424000000000000000000000000000000000665da8d6000000000005c02100000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000001e5d9926c9ce155e938b4779197ee681d061d817f926812252b5aa0ccb3da5b730000000000000000000000004d0ca19b3c317ddb3c67fcc2c033ff0c25787bee", "nonce": "0x206d8b", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x2b5d9582c6d0c8aedef5cdb199ce6c8a72616839f8e52c3f22b6363287428029", "mint": "0x0", "depositReceiptVersion": "0x1" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x11d56bbf25b8650d1990878ffa662f3295f55a7d490133ab19f478d98d0610dc", "blockNumber": "0x212ad0", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0xdf61993955c9db0429ca110184ec8f4a225ec9d4c35a39e0ed2b07fbc6e72f65", "input": "0x440a5e20000f424000000000000000000000000500000000665f235a000000000005dfac000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000018641dbd082b95aa29c093b434ae52437830c84e0fbfbbaf59d570f15f22f1aa40000000000000000000000004d0ca19b3c317ddb3c67fcc2c033ff0c25787bee", "nonce": "0x212ad0", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x0d2f5483dac2160b3bdeee6a76fdbe12578b7e42bea7e04910c00d40738ab1ac", "mint": "0x0", "depositReceiptVersion": "0x1" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/b2-network/web3-p3/ title: B2 Network — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/b2-network/web3-p3.mdx --- # B2 Network — web3, net, eth (3/3) > API reference for [B2 Network](/rpc-service/chains/chains-api/b2-network/). [All methods ->](/rpc-service/chains/chains-api/b2-network/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/b2-network/web3/) · [2](/rpc-service/chains/chains-api/b2-network/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbceca7e26ee25036f81e09bf5ea0c422e126a5408e995d7bee67ac2edd624357"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe6a4fda409f9954e2ce015a0a89bf4fa093f34f2f6c03edf321fc08415bad3cf", "blockNumber": "0x206d8b", "contractAddress": null, "cumulativeGasUsed": "0x1b10f", "effectiveGasPrice": "0xf433c", "from": "0x31ec5f1659bd8ac9fcff8d74ada9cc6416090a01", "gasUsed": "0xf044", "l1Fee": "0x2b18", "l1GasPrice": "0x7", "l1GasUsed": "0x628", "logs": [ { "address": "0x4200000000000000000000000000000000000011", "topics": [ "0xc8a211cc64b6ed1b50595a9fcb1932b6d1e5a6e8ef15b60e5b1f988ea9086bba" ], "data": "0x0000000000000000000000000000000000000000000000002ebd69550f55c109000000000000000000000000d70e480af4498858dce53ae61d47eed43c350b2a00000000000000000000000031ec5f1659bd8ac9fcff8d74ada9cc6416090a01", "blockNumber": "0x206d8b", "transactionHash": "0xbceca7e26ee25036f81e09bf5ea0c422e126a5408e995d7bee67ac2edd624357", "transactionIndex": "0x1", "blockHash": "0xe6a4fda409f9954e2ce015a0a89bf4fa093f34f2f6c03edf321fc08415bad3cf", "logIndex": "0x0", "removed": false }, { "address": "0x4200000000000000000000000000000000000011", "topics": [ "0x38e04cbeb8c10f8f568618aa75be0f10b6729b8b4237743b4de20cbcde2839ee" ], "data": "0x0000000000000000000000000000000000000000000000002ebd69550f55c109000000000000000000000000d70e480af4498858dce53ae61d47eed43c350b2a00000000000000000000000031ec5f1659bd8ac9fcff8d74ada9cc6416090a010000000000000000000000000000000000000000000000000000000000000001", "blockNumber": "0x206d8b", "transactionHash": "0xbceca7e26ee25036f81e09bf5ea0c422e126a5408e995d7bee67ac2edd624357", "transactionIndex": "0x1", "blockHash": "0xe6a4fda409f9954e2ce015a0a89bf4fa093f34f2f6c03edf321fc08415bad3cf", "logIndex": "0x1", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000010000000000000000000000000000000000000080000000000000000000200000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000100000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000", "status": "0x1", "to": "0x4200000000000000000000000000000000000011", "transactionHash": "0xbceca7e26ee25036f81e09bf5ea0c422e126a5408e995d7bee67ac2edd624357", "transactionIndex": "0x1", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xe6a4fda409f9954e2ce015a0a89bf4fa093f34f2f6c03edf321fc08415bad3cf", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0xA00000", "toBlock": "0xA00010", "address": "0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe", "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"] }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/b2-network/web3/ title: B2 Network — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/b2-network/web3.mdx --- # B2 Network — web3, net, eth (1/3) > API reference for [B2 Network](/rpc-service/chains/chains-api/b2-network/). [All methods ->](/rpc-service/chains/chains-api/b2-network/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/b2-network/web3-p2/) · [3](/rpc-service/chains/chains-api/b2-network/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v0.1.0-unstable-e9a306ba/linux-amd64/go1.21.9", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "223" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xf433c" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x21274a" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xe415ff6834ef063516d7f6a548db982a5120ea9d", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xc07bf74c6e5c0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x57024cdbef967c7d3a665b6e23f8b7210aea10e4", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x25f8bb7ac8122d7587576e6aa2b78afefbde93c2e2b7ca979108a707f9917c5c"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x25f8bb7ac8122d7587576e6aa2b78afefbde93c2e2b7ca979108a707f9917c5c"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/b2-network/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/b2/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{ "to": "0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe", "data": "0x70a08231000000000000000000000000b60e8dd61c5d32be8058bb8eb970870f07233155" }, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/base/eth-p2/ title: Base — eth (2/2) source: docs/rpc-service/chains/chains-api/base/eth-p2.mdx --- # Base — eth (2/2) > API reference for [Base](/rpc-service/chains/chains-api/base/). [All methods ->](/rpc-service/chains/chains-api/base/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/base/eth/) · 2 ## `eth_getTransactionByHash` > Retrieves preconfirmed transactions by hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the hash of the transaction to retrieve. ### Returns The transaction object if found (including when present in a Flashblock preconfirmation); null if the transaction is unknown. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x16175d34cd1f9819ded6c9e1c630d05fd0c9f67a3373bfb26c5283e0f2f1fb25"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "type": "0x7e", "sourceHash": "0x27da63a8ebe6b50bd7848cacad5b86358e86d31d34ff12023a7941bd70ecef93", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "to": "0x4200000000000000000000000000000000000015", "mint": "0x0", "value": "0x0", "gas": "0xf4240", "input": "0x098999be000008dd00101c1200000000000000020000000068af095f000000000162811000000000000000000000000000000000000000000000000000000000671d09ca0000000000000000000000000000000000000000000000000000000000000001076c7bd697aeb085221315e39c6748a7e7f1ed7e73961cf883c80452f07c30290000000000000000000000005050f69a9786f081509234f1a7f4684b5e5b76c9000000000000000000000000", "hash": "0x16175d34cd1f9819ded6c9e1c630d05fd0c9f67a3373bfb26c5283e0f2f1fb25", "r": "0x0", "s": "0x0", "yParity": "0x0", "v": "0x0", "blockHash": "0x644a1a48e50bd435aad25937b21deff4de85e2309cc985118a1e3ec793242702", "blockNumber": "0x212569b", "transactionIndex": "0x0", "depositReceiptVersion": "0x1", "gasPrice": "0x0", "nonce": "0x212569d" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/base/eth/ title: Base — eth (1/2) source: docs/rpc-service/chains/chains-api/base/eth.mdx --- # Base — eth (1/2) > API reference for [Base](/rpc-service/chains/chains-api/base/). [All methods ->](/rpc-service/chains/chains-api/base/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/base/eth-p2/) ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xf54b65b1c0ba67b2fb64add9151df5a5f2ee6366e16c3e6f01adb4c9a2e58bdf", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x647830A95A754BDFf41a75ff8786392760f17Fc4"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- ## `eth_getBlockByNumber` > Use the `pending` tag to retrieve the latest Flashblock. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (tag; required): use the `pending` tag to retrieve the latest Flashblock. 2. `` (required): if `true` — returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns Retrieves the latest Flashblock object. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["pending", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "hash": "0x644a1a48e50bd435aad25937b21deff4de85e2309cc985118a1e3ec793242702", "parentHash": "0x945900ddc4a6e02b9d3ac1ea9d888e7ad4d9e7345ed1f275974906c8ca9529cc", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x4200000000000000000000000000000000000011", "stateRoot": "0x72ac5384d9655594d36ce6ff3c855494cf13dc150321ba9d9a741c5cf7988754", "transactionsRoot": "0x717fc55e978778557c5f7ebb7ef2cd82f6402db9852e8c3420ca9ab6c875f900", "receiptsRoot": "0xfe0b80a42048813c3bf9604af7c70983ffd2f924336834ee039c6311c2d570e4", "logsBloom": "0x12a37759df470838b0ab9272ae9fabe07c748764ba519647ff4414392160efaf25edcfd878071368de52df73972e778f8dd7d8399c6165cb27b20f946cbcf1c2c5e59cdd3b751e383fb516fbe1cac5a673cef5b700fc333ce986c0a9d366a2413bc4c06c8e8f9fc42548be2b6d0f3ea99d4b5f261e343fb9dff2b5bdc1cbb6a3a531f2d9dbed5f98457bc773884fef23cd8397f95eedc07f36ba43fe0fe1911f8e481f998a98fde5b77195c350328cd33e496a1bd61a9dde85c31f3f10e0c7abea4784ab66f9acddd957fb8cf27ff2cf8f7dd0cf36fda6d6c10437a2773ae94d5cfff849074dec8b7a74aab83f5335f585839701a5fe0e762e47face29838fc2", "difficulty": "0x0", "number": "0x212569b", "gasLimit": "0x8f0d180", "gasUsed": "0x33ebb21", "timestamp": "0x68af0a19", "extraData": "0x000000003200000003", "mixHash": "0x33e69310dcf1126f078ecb8f5c53b97b12dec80b94b967553d19bf5b7fa66636", "nonce": "0x0000000000000000", "baseFeePerGas": "0x2615e00", "withdrawalsRoot": "0x1aa45fb269b554ebdb203695ad59ad99a753aa6117dafbff40c42e81b9a6f458", "blobGasUsed": "0x0", "excessBlobGas": "0x0", "parentBeaconBlockRoot": "0x3a4854cb45bcbde7a8071e87b739a300d0c3586b02ea305c0bc32ecee4f6c747", "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "size": "0x2ed2c", "uncles": [], "transactions": [ "0x16175d34cd1f9819ded6c9e1c630d05fd0c9f67a3373bfb26c5283e0f2f1fb25", "0xa557335163d512fed8926a25c0862a02b551795b5a01ff8acc337e2c7511e83b", "0xaf29ec8573ec61a9e5e9a7249576333c5a0cfa5804c57c63a7248518eeb445e5", "0xfadfd79be42e585371184be82d6b98c56231ead2da90583b87946688df843d72" ], "withdrawals": [] } } ``` --- ## `eth_getTransactionReceipt` > Retrieves the receipts for preconfirmed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the transaction hash. ### Returns Returns preconfirmation-aware receipt data if the transaction is already included in a Flashblock. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x16175d34cd1f9819ded6c9e1c630d05fd0c9f67a3373bfb26c5283e0f2f1fb25"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "type": "0x7e", "status": "0x1", "cumulativeGasUsed": "0xb44c", "logs": [], "depositNonce": "0x212569d", "depositReceiptVersion": "0x1", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "transactionHash": "0x16175d34cd1f9819ded6c9e1c630d05fd0c9f67a3373bfb26c5283e0f2f1fb25", "transactionIndex": "0x0", "blockHash": "0x644a1a48e50bd435aad25937b21deff4de85e2309cc985118a1e3ec793242702", "blockNumber": "0x212569b", "gasUsed": "0xb44c", "effectiveGasPrice": "0x0", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "to": "0x4200000000000000000000000000000000000015", "contractAddress": null, "l1GasPrice": "0x671d09ca", "l1GasUsed": "0x6da", "l1Fee": "0x0", "l1BaseFeeScalar": "0x8dd", "l1BlobBaseFee": "0x1", "l1BlobBaseFeeScalar": "0x101c12" } } ``` --- ## `eth_getBalance` > Use the `pending` tag to retrieve the address balance in the latest Flashblock. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (required): the address to check the balance for. 2. `` (tag; required): use the `pending` tag to retrieve the address balance in the latest Flashblock. ### Returns The account balance in wei (hex-encoded string). ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "pending"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x64c9dd3ba4625" } ``` --- ## `eth_getTransactionCount` > Use the `pending` tag to retrieve the address nonce in the latest Flashblock. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (required): the account address to query. 2. `` (tag; required): use `pending` to retrieve the nonce including the latest Flashblock state. ### Returns The transaction count (nonce) of the given address, returned as a hex-encoded integer. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x22d1b96d8EbA60BBd2e59573223eA650941Dd43D", "pending"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x2" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/base/ title: Base description: Base is a secure, low-cost, developer-friendly Ethereum L2 built to bring the next billion users to web3. 33 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/base/index.mdx --- # Base
> Base API is available on [Web3 API platform](https://www.ankr.com/rpc/base). *Base* is a secure, low-cost, developer-friendly Ethereum L2 built to bring the next billion users to web3. Base is built on the [Bedrock](https://stack.optimism.io/docs/releases/bedrock/explainer/) release of the [OP Stack](https://stack.optimism.io/), which is designed from the ground up to be as close to Ethereum as possible. Because of this, there are very little differences when it comes to building on Base and Ethereum. In order for your Web3 application to interact with Base — either by reading blockchain data or sending transactions to the network — it must connect to a Base node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. For Base, we support the following methods: * [EVM JSON-RPC methods](/rpc-service/chains/chains-api/base/#evm-json-rpc-methods) * [Flashblocks methods](/rpc-service/chains/chains-api/base/#flashblocks-methods) --- ## EVM JSON-RPC methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/base/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/base/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/base/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/base/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/base/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/base/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/base/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/base/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/base/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/base/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/base/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/base/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/base/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/base/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/base/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/base/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/base/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/base/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/base/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/base/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/base/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/base/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/base/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/base/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/base/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/base/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/base/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/base/eth/#eth_getlogs) — returns logs matching the parameters specified. --- ## Flashblocks methods [Flashblocks](https://docs.base.org/base-chain/flashblocks/apps) is a core Base feature that provides preconfirmation of the upcoming block's transaction ordering (~200 milliseconds) before the full block is sealed (~2 seconds). This enables ultra-fast transaction feedback, allowing applications to deliver instant and interactive user experiences. Flashblocks are particularly valuable for high-frequency trading platforms, real-time games, live dashboards, and other latency-sensitive use cases where even a brief delay feels disruptive. Flashblocks are integrated directly into Base’s block production process, therefore developers gain the advantages of low-latency feedback without compromising security or reliability. The result is a seamless foundation for applications that demand speed, responsiveness, and trust. The following RPC methods can return Flashblocks specific data: * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/base/web3-p2/#eth_getblockbynumber) — with `pending`, retrieves the latest Flashblock. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/base/web3-p3/#eth_gettransactionreceipt) — retrieves receipts for preconfirmed transactions. * [`eth_getBalance`](/rpc-service/chains/chains-api/base/web3/#eth_getbalance) — with `pending`, retrieves the address balance in the latest Flashblock. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/base/web3/#eth_gettransactioncount) — with `pending`, retrieves the address nonce in the latest Flashblock. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/base/web3-p2/#eth_gettransactionbyhash) — retrieves preconfirmed transactions by hash. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/base/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/base/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/base/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/base/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/base/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/base/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/base/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/base/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/base/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/base/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/base/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/base/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/base/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/base/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/base/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/base/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/base/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/base/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/base/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/base/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/base/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/base/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/base/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/base/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/base/web3-p3/#eth_gettransactionreceipt) ### eth - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/base/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/base/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/base/eth/#eth_getlogs) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/base/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/base/web3-p3/#eth_gettransactionreceipt) - [`eth_getBalance`](/rpc-service/chains/chains-api/base/web3/#eth_getbalance) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/base/web3/#eth_gettransactioncount) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/base/web3-p2/#eth_gettransactionbyhash) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/base/web3-p2/ title: Base — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/base/web3-p2.mdx --- # Base — web3, net, eth (2/3) > API reference for [Base](/rpc-service/chains/chains-api/base/). [All methods ->](/rpc-service/chains/chains-api/base/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/base/web3/) · 2 · [3](/rpc-service/chains/chains-api/base/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0x57b3a84E18d6302E2482841a1Bc9839Ab172b26F"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x31", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x17d7840", "gasUsed": "0x94012", "hash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "logsBloom": "0x00000000000000000000000000000000000000000400040000000000000000000000004000000000000001000000000000000000000000000100000000000000000000000000020800000008000000000000000000000000000000000000000004000000028040004000000000008800200000000000000000000110200100200008800000000040000000000000800000000000000000000002000000000000000000000000000000000000000000000000000000004000000000000000000000000002000000000000000000000008000000000000200000000000000820000001000000000000000000000000800000000000000000000008000000000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x7180a31b9dd9cee2c54b01e8f2159f8f319344a6bef98ddb2ba1c7aa7b6f7881", "nonce": "0x0000000000000000", "number": "0x3c755c", "parentHash": "0xd101d2af1b670fbe88eb0defb057cc4c0384df350edbe771a6a199e7898f9d65", "receiptsRoot": "0x70f185eb69e67c0c084b299237c1503198cc1b7b7c27f4cf1279595a16cc038b", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x7e8", "stateRoot": "0x15f9c468bc700599a24a230e60847f50e689617b033b27f371f703a91e3e5dc6", "timestamp": "0x645257c8", "totalDifficulty": "0x0", "transactions": [ "0xf14686c9327d897ab5b0754b18cea248cf08a9caa3c9d7c98e73690d46d2cb39", "0xc263dd53e1aaaabb951c49cfd4aa7a9e1251b0c5db1ad00226d72870f08c8d78", "0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b", "0x023fb744a61685e453db52bd35473c8593ecdf57e6642146c8de60a5cf642396", "0xf4c8bfb6c3e9eefa28f297bdab17954e1e74532df3bd8c71e87c257408f56bea" ], "transactionsRoot": "0x1c21ae0871abb6a8a1fc9b5e5d3b5d10b840903f628dfdf18da8b02fd16c972f", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x31", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x17d7840", "gasUsed": "0x25faa", "hash": "0x798fb0b460166fffd7d53a2058d956220f7395387bf7a0eed0f5c4453444091f", "logsBloom": "0x04200000000200000000000080000000020010000000000000200000000900000000000004000000000000000000000000000000000000000000000000008000000000000000000000280008000000200000000000000000040000008000000000000000000000000000000000000000000000040000000002000410000000000000000000000001400000000000000000200001000000080000004000000040000000000000000100000000000000000000000000000000400000000020000000800002008000000000000000000000000000000000001000000100000000000000000000000000000010000000000000000000000004400000000000000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0xc0400fc07af9edad173f52c217440a40dab619f7d138738b53f3370b1799440c", "nonce": "0x0000000000000000", "number": "0x3c75f5", "parentHash": "0xc84319dc3b967ba0484cdee4fbf2ac2897113cd836b3709ad9bfac938c5dde3b", "receiptsRoot": "0x1d04113e9ccf95a9013827132a7d0e53d703d84f2e61b97b03a238dc5c83461f", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x59e", "stateRoot": "0x086ecac7b5f5cd70fbecda366472417c2a1e9fcad0575720b6934190b1315176", "timestamp": "0x645258fa", "totalDifficulty": "0x0", "transactions": [ "0xb3b523a38b8d61fe578d83714b829c23213892d882df12ed914868c1b1e7ada6", "0x6b3f47444637df1ca316601dc870fc09298bc35ebb3995e597a91768d093d48f", "0xfb114453c2105430fc4e522171b10eb772b1ae4931b7e30cb3fef2dd31e92868" ], "transactionsRoot": "0xaaaca0a01bd4561f88176f56f0ec5706798376b147b3084cdd34eb47ddadc031", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "blockNumber": "0x3c755c", "from": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "gas": "0x186a0", "gasPrice": "0x0", "hash": "0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b", "input": "0x", "nonce": "0x0", "to": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "transactionIndex": "0x2", "value": "0x21ec894ca2f7b800", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x4b34328ff3466ddda82a19e849e6724e03cae75075709ec600c7d8bf6c7b5e9b", "mint": "0x21ec894ca2f7b800" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "blockNumber": "0x3c755c", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0x8f0d180", "gasPrice": "0x0", "hash": "0xf14686c9327d897ab5b0754b18cea248cf08a9caa3c9d7c98e73690d46d2cb39", "input": "0x015d8eb90000000000000000000000000000000000000000000000000000000000885554000000000000000000000000000000000000000000000000000000006452579400000000000000000000000000000000000000000000000000000009abdfc80badc6a92f7b910d6eb19519df02d5f553acf1916705b5c8ffc363f19eae6378bb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d679b567db6187c0c8323fa982cfb88b74dbcc7000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240", "nonce": "0x0", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x8d211d9a6c156ad43a3330c0f07904f319936ae4eadf6d57cce64c1f52a569b1", "mint": "0x0", "isSystemTx": true } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa72d3db5dc554ec1eee6be321d3d7fa5eadf68ef19e1ddba2cbdde65bd049325", "blockNumber": "0x3c764e", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0x8f0d180", "gasPrice": "0x0", "hash": "0xfa21b7302972609248949646b06703f94010c724f1565949da1e050a56672504", "input": "0x015d8eb9000000000000000000000000000000000000000000000000000000000088557000000000000000000000000000000000000000000000000000000000645259680000000000000000000000000000000000000000000000000000000d6a1b7750abf0a584e9f633edf00ea6ca61d6a845313965c3f39426e66ed959ba18f1c6d900000000000000000000000000000000000000000000000000000000000000020000000000000000000000002d679b567db6187c0c8323fa982cfb88b74dbcc7000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240", "nonce": "0x0", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x0d55c4a6698e3facccbb99f7d27a091886a9c4286c36f2789b850b70e7f83a0c", "mint": "0x0", "isSystemTx": true } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/base/web3-p3/ title: Base — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/base/web3-p3.mdx --- # Base — web3, net, eth (3/3) > API reference for [Base](/rpc-service/chains/chains-api/base/). [All methods ->](/rpc-service/chains/chains-api/base/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/base/web3/) · [2](/rpc-service/chains/chains-api/base/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "blockNumber": "0x3c755c", "contractAddress": null, "cumulativeGasUsed": "0x30d40", "effectiveGasPrice": "0x0", "from": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "gasUsed": "0x186a0", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "transactionHash": "0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b", "transactionIndex": "0x2", "type": "0x7e" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/base/web3/ title: Base — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/base/web3.mdx --- # Base — web3, net, eth (1/3) > API reference for [Base](/rpc-service/chains/chains-api/base/). [All methods ->](/rpc-service/chains/chains-api/base/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/base/web3-p2/) · [3](/rpc-service/chains/chains-api/base/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Geth/v0.1.0-unstable-11f0554a-20230321/linux-amd64/go1.19.7" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "84531" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x59682f31" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3c7362" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xf69D6767a2317172C2B049E8260af2986505177F", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3782dace9d90000" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xf69D6767a2317172C2B049E8260af2986505177F", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xf69D6767a2317172C2B049E8260af2986505177F", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x44a64e8765b4c3980711cc7bd89dae8569dcd79cad282323b33619233c8bfec1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x8" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x3C73DC"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x8" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x44a64e8765b4c3980711cc7bd89dae8569dcd79cad282323b33619233c8bfec1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x3C73DC"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xf69D6767a2317172C2B049E8260af2986505177F", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/base/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x4200000000000000000000000000000000000006","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bitlayer/eth/ title: Bitlayer — eth, debug source: docs/rpc-service/chains/chains-api/bitlayer/eth.mdx --- # Bitlayer — eth, debug > API reference for [Bitlayer](/rpc-service/chains/chains-api/bitlayer/). [All methods ->](/rpc-service/chains/chains-api/bitlayer/#methods) ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x2b979c416bf7d37920b61c4e266d2da72bd0c772"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Bitlayer blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0xbb4e21cba0a1595c3da2fba0e62c00b3e242c95bc8b3ca65f4b1836e65509133", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0x94ebe612e0b0c344888d554d43f9f5fe3d1e837136401974e6e44ce02eeec621", "result": { "from": "0xfbc99e01d6393577cb1adc20892fc08be4747684", "gas": "0xcc6db", "gasUsed": "0x4352d", "to": "0xc5b5ed4b5770eef35ea761dbe3fbdd1556911e23", "input": "0x6bc63893000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000038b000000000000000000000000fbc99e01d6393577cb1adc20892fc08be47476840000000000000000000000000000000000000000000000000000000066bb5930000000000000000000000000000000000000000000000000000000000000006043663316ee4c7722b7ae2864f35af28326aee5517c5010421acd671ef699861e04d27715695d06d5ea53d577719463e5cbb98e0c3a1dd0a91ca87674df3ed060000000000000000000000000000000000000000000000000000000000000001b", "output": "0x000000000000000000000000000000000000000000000000000000000000034b", "calls": [ { "from": "0xc5b5ed4b5770eef35ea761dbe3fbdd1556911e23", "gas": "0xc3283", "gasUsed": "0xbb8", "to": "0x0000000000000000000000000000000000000001", "input": "0x0384fd26581809a9ba0eccfe398600d385e66c07bbb98d465ef185ed5f1f9c6c000000000000000000000000000000000000000000000000000000000000001b43663316ee4c7722b7ae2864f35af28326aee5517c5010421acd671ef699861e04d27715695d06d5ea53d577719463e5cbb98e0c3a1dd0a91ca87674df3ed060", "output": "0x0000000000000000000000002c8576c6037ca58138ce8b738739a83882269ac1", "type": "STATICCALL" } ], "value": "0x0", "type": "CALL" } } ] } ``` --- ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Bitlayer blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0x395BD2", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0x94ebe612e0b0c344888d554d43f9f5fe3d1e837136401974e6e44ce02eeec621", "result": { "from": "0xfbc99e01d6393577cb1adc20892fc08be4747684", "gas": "0xcc6db", "gasUsed": "0x4352d", "to": "0xc5b5ed4b5770eef35ea761dbe3fbdd1556911e23", "input": "0x6bc63893000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000038b000000000000000000000000fbc99e01d6393577cb1adc20892fc08be47476840000000000000000000000000000000000000000000000000000000066bb5930000000000000000000000000000000000000000000000000000000000000006043663316ee4c7722b7ae2864f35af28326aee5517c5010421acd671ef699861e04d27715695d06d5ea53d577719463e5cbb98e0c3a1dd0a91ca87674df3ed060000000000000000000000000000000000000000000000000000000000000001b", "output": "0x000000000000000000000000000000000000000000000000000000000000034b", "calls": [ { "from": "0xc5b5ed4b5770eef35ea761dbe3fbdd1556911e23", "gas": "0xc3283", "gasUsed": "0xbb8", "to": "0x0000000000000000000000000000000000000001", "input": "0x0384fd26581809a9ba0eccfe398600d385e66c07bbb98d465ef185ed5f1f9c6c000000000000000000000000000000000000000000000000000000000000001b43663316ee4c7722b7ae2864f35af28326aee5517c5010421acd671ef699861e04d27715695d06d5ea53d577719463e5cbb98e0c3a1dd0a91ca87674df3ed060", "output": "0x0000000000000000000000002c8576c6037ca58138ce8b738739a83882269ac1", "type": "STATICCALL" } ], "value": "0x0", "type": "CALL" } } ] } ``` --- ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Bitlayer blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bitlayer/ title: Bitlayer description: Bitlayer is the first Bitcoin security-equivalent layer 2 based on BitVM. 31 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/bitlayer/index.mdx --- # Bitlayer
> Bitlayer API is available on [Web3 API platform](https://www.ankr.com/rpc/bitlayer). *Bitlayer* is the first Bitcoin security-equivalent layer 2 based on BitVM. It consists of an EVM compatible chain/sequencer that can map BTC ecological assets and facilitate the entry of BTC users. In order for your Web3 application to interact with Bitlayer — either by reading blockchain data or sending transactions to the network — it must connect to a Bitlayer node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/bitlayer/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/bitlayer/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/bitlayer/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/bitlayer/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/bitlayer/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/bitlayer/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/bitlayer/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/bitlayer/eth/#eth_getlogs) — returns logs matching the parameters specified. **Premium-only methods**: * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/bitlayer/eth/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/bitlayer/eth/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/bitlayer/eth/#debug_traceblock) — traces the execution of all transactions within a block. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/bitlayer/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/bitlayer/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/bitlayer/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/bitlayer/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/bitlayer/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/bitlayer/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/bitlayer/web3-p3/#eth_gettransactionreceipt) ### eth, debug - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/bitlayer/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/bitlayer/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/bitlayer/eth/#eth_getlogs) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/bitlayer/eth/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/bitlayer/eth/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/bitlayer/eth/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bitlayer/web3-p2/ title: Bitlayer — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/bitlayer/web3-p2.mdx --- # Bitlayer — web3, net, eth (2/3) > API reference for [Bitlayer](/rpc-service/chains/chains-api/bitlayer/). [All methods ->](/rpc-service/chains/chains-api/bitlayer/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/bitlayer/web3/) · 2 · [3](/rpc-service/chains/chains-api/bitlayer/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0xddaf43ef17cee4ace4237dfade1e1e807f975084","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x545e" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x7", "difficulty": "0x2", "extraData": "0x00000000000000000000000000000000000000000000000000000000000000003449d85c51e566cab1d9a4bc46f3943e52bb40efb5761b05c8f669fc5f9395b31910fa4c25a1b721a8f6b55be00e6b9b83fa1f3a21dea614f0a080fa11aa2d3100", "gasLimit": "0x2625a00", "gasUsed": "0x5208", "hash": "0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbf6dcd00e83058fc361b61bbf31c306bf81a97b2", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x1671c8", "parentHash": "0x50100bdc26fd1076ed9307faa753c74313fc95eddd3ec6243c11069bc6e5d761", "receiptsRoot": "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x2e0", "stateRoot": "0x307d9277861dfdefc65752c572983b52b83fb05362113df44306af7316bf62c3", "timestamp": "0x66042368", "totalDifficulty": "0x2ce385", "transactions": [ "0x2290878029493d4a8e52320b87a6df3c234069984987f5e0e841b226766013e9" ], "transactionsRoot": "0xec4054a4fd671f5a86eb300d53334dca4fb04cbe47a213a2d2ce20284139d2ca", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1671C8", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x7", "difficulty": "0x2", "extraData": "0x00000000000000000000000000000000000000000000000000000000000000003449d85c51e566cab1d9a4bc46f3943e52bb40efb5761b05c8f669fc5f9395b31910fa4c25a1b721a8f6b55be00e6b9b83fa1f3a21dea614f0a080fa11aa2d3100", "gasLimit": "0x2625a00", "gasUsed": "0x5208", "hash": "0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbf6dcd00e83058fc361b61bbf31c306bf81a97b2", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x1671c8", "parentHash": "0x50100bdc26fd1076ed9307faa753c74313fc95eddd3ec6243c11069bc6e5d761", "receiptsRoot": "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x2e0", "stateRoot": "0x307d9277861dfdefc65752c572983b52b83fb05362113df44306af7316bf62c3", "timestamp": "0x66042368", "totalDifficulty": "0x2ce385", "transactions": [ { "blockHash": "0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a", "blockNumber": "0x1671c8", "from": "0xddaf43ef17cee4ace4237dfade1e1e807f975084", "gas": "0x5208", "gasPrice": "0x59682f07", "maxFeePerGas": "0x59682f08", "maxPriorityFeePerGas": "0x59682f00", "hash": "0x2290878029493d4a8e52320b87a6df3c234069984987f5e0e841b226766013e9", "input": "0x", "nonce": "0x8", "to": "0xddaf43ef17cee4ace4237dfade1e1e807f975084", "transactionIndex": "0x0", "value": "0x16345785d8a0000", "type": "0x2", "accessList": [], "chainId": "0x3106a", "v": "0x0", "r": "0x872c19ca90b242d4e6ff16429046cd2a070f0d167a5db7a494c789c189a20465", "s": "0x2dff8b5f7688872b0c831e4693f748bff1afcb0048a8d35026c55f973883c4b5", "yParity": "0x0" } ], "transactionsRoot": "0xec4054a4fd671f5a86eb300d53334dca4fb04cbe47a213a2d2ce20284139d2ca", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x2290878029493d4a8e52320b87a6df3c234069984987f5e0e841b226766013e9"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a", "blockNumber": "0x1671c8", "from": "0xddaf43ef17cee4ace4237dfade1e1e807f975084", "gas": "0x5208", "gasPrice": "0x59682f07", "maxFeePerGas": "0x59682f08", "maxPriorityFeePerGas": "0x59682f00", "hash": "0x2290878029493d4a8e52320b87a6df3c234069984987f5e0e841b226766013e9", "input": "0x", "nonce": "0x8", "to": "0xddaf43ef17cee4ace4237dfade1e1e807f975084", "transactionIndex": "0x0", "value": "0x16345785d8a0000", "type": "0x2", "accessList": [], "chainId": "0x3106a", "v": "0x0", "r": "0x872c19ca90b242d4e6ff16429046cd2a070f0d167a5db7a494c789c189a20465", "s": "0x2dff8b5f7688872b0c831e4693f748bff1afcb0048a8d35026c55f973883c4b5", "yParity": "0x0" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a", "blockNumber": "0x1671c8", "from": "0xddaf43ef17cee4ace4237dfade1e1e807f975084", "gas": "0x5208", "gasPrice": "0x59682f07", "maxFeePerGas": "0x59682f08", "maxPriorityFeePerGas": "0x59682f00", "hash": "0x2290878029493d4a8e52320b87a6df3c234069984987f5e0e841b226766013e9", "input": "0x", "nonce": "0x8", "to": "0xddaf43ef17cee4ace4237dfade1e1e807f975084", "transactionIndex": "0x0", "value": "0x16345785d8a0000", "type": "0x2", "accessList": [], "chainId": "0x3106a", "v": "0x0", "r": "0x872c19ca90b242d4e6ff16429046cd2a070f0d167a5db7a494c789c189a20465", "s": "0x2dff8b5f7688872b0c831e4693f748bff1afcb0048a8d35026c55f973883c4b5", "yParity": "0x0" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x1671C8", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a", "blockNumber": "0x1671c8", "from": "0xddaf43ef17cee4ace4237dfade1e1e807f975084", "gas": "0x5208", "gasPrice": "0x59682f07", "maxFeePerGas": "0x59682f08", "maxPriorityFeePerGas": "0x59682f00", "hash": "0x2290878029493d4a8e52320b87a6df3c234069984987f5e0e841b226766013e9", "input": "0x", "nonce": "0x8", "to": "0xddaf43ef17cee4ace4237dfade1e1e807f975084", "transactionIndex": "0x0", "value": "0x16345785d8a0000", "type": "0x2", "accessList": [], "chainId": "0x3106a", "v": "0x0", "r": "0x872c19ca90b242d4e6ff16429046cd2a070f0d167a5db7a494c789c189a20465", "s": "0x2dff8b5f7688872b0c831e4693f748bff1afcb0048a8d35026c55f973883c4b5", "yParity": "0x0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bitlayer/web3-p3/ title: Bitlayer — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/bitlayer/web3-p3.mdx --- # Bitlayer — web3, net, eth (3/3) > API reference for [Bitlayer](/rpc-service/chains/chains-api/bitlayer/). [All methods ->](/rpc-service/chains/chains-api/bitlayer/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/bitlayer/web3/) · [2](/rpc-service/chains/chains-api/bitlayer/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x2290878029493d4a8e52320b87a6df3c234069984987f5e0e841b226766013e9"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a", "blockNumber": "0x1671c8", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x59682f07", "from": "0xddaf43ef17cee4ace4237dfade1e1e807f975084", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0xddaf43ef17cee4ace4237dfade1e1e807f975084", "transactionHash": "0x2290878029493d4a8e52320b87a6df3c234069984987f5e0e841b226766013e9", "transactionIndex": "0x0", "type": "0x2" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bitlayer/web3/ title: Bitlayer — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/bitlayer/web3.mdx --- # Bitlayer — web3, net, eth (1/3) > API reference for [Bitlayer](/rpc-service/chains/chains-api/bitlayer/). [All methods ->](/rpc-service/chains/chains-api/bitlayer/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/bitlayer/web3-p2/) · [3](/rpc-service/chains/chains-api/bitlayer/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v1.0.0-stable-dcf6ffe3/linux-amd64/go1.21.1", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "200901" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5f5e107" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1671ec" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xddaf43ef17cee4ace4237dfade1e1e807f975084", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x20dee0a950d51a0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xddaf43ef17cee4ace4237dfade1e1e807f975084", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xddaf43ef17cee4ace4237dfade1e1e807f975084", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x1671C8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x5942f1f261b13f7980a682edcdb7d63cc24f1160ab06d27cd381900e50bfc03a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xddaf43ef17cee4ace4237dfade1e1e807f975084", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/bitlayer/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0xddaf43ef17cee4ace4237dfade1e1e807f975084","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/blast/eth-p2/ title: Blast — eth, debug (2/2) source: docs/rpc-service/chains/chains-api/blast/eth-p2.mdx --- # Blast — eth, debug (2/2) > API reference for [Blast](/rpc-service/chains/chains-api/blast/). [All methods ->](/rpc-service/chains/chains-api/blast/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/blast/eth/) · 2 ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Blast blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/blast/eth/ title: Blast — eth, debug (1/2) source: docs/rpc-service/chains/chains-api/blast/eth.mdx --- # Blast — eth, debug (1/2) > API reference for [Blast](/rpc-service/chains/chains-api/blast/). [All methods ->](/rpc-service/chains/chains-api/blast/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/blast/eth-p2/) ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x2b41c2d5326735673cf99938a9536b28df3e1849fe6b8eee0d67d0c4c4806490", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x1E7EE9", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xD8094c27e1eC03323F43aF5605B3Bf2732566C0F"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Blast blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0xec259b9922325c2717e3aec8f5508ea2d11076ea6938924ef8fb8375c33533b9", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0xd4ed816275cf848e3108125d064906dd83b6856e02a66847e9f87a31d2dfd98a", "result": { "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasUsed": "0xab6a", "to": "0x4200000000000000000000000000000000000015", "input": "0x440a5e200000044c000c5f9400000000000000010000000066bb59bf0000000001391bc8000000000000000000000000000000000000000000000000000000008f2dc0d4000000000000000000000000000000000000000000000000000000000000000185ecbf1317ed3502008cb9916eefe130fe0393a2c4f78b204ed8a4cf33679a4c000000000000000000000000415c8893d514f9bc5211d36eeda4183226b84aa7", "calls": [ { "from": "0x4200000000000000000000000000000000000015", "gas": "0xe9b4b", "gasUsed": "0x3fac", "to": "0x07dbe8500fc591d1852b76fee44d5a05e13097ff", "input": "0x440a5e200000044c000c5f9400000000000000010000000066bb59bf0000000001391bc8000000000000000000000000000000000000000000000000000000008f2dc0d4000000000000000000000000000000000000000000000000000000000000000185ecbf1317ed3502008cb9916eefe130fe0393a2c4f78b204ed8a4cf33679a4c000000000000000000000000415c8893d514f9bc5211d36eeda4183226b84aa7", "value": "0x0", "type": "DELEGATECALL" } ], "value": "0x0", "type": "CALL" } } ] } ``` --- ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Blast blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0x707DD9", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0xd4ed816275cf848e3108125d064906dd83b6856e02a66847e9f87a31d2dfd98a", "result": { "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasUsed": "0xab6a", "to": "0x4200000000000000000000000000000000000015", "input": "0x440a5e200000044c000c5f9400000000000000010000000066bb59bf0000000001391bc8000000000000000000000000000000000000000000000000000000008f2dc0d4000000000000000000000000000000000000000000000000000000000000000185ecbf1317ed3502008cb9916eefe130fe0393a2c4f78b204ed8a4cf33679a4c000000000000000000000000415c8893d514f9bc5211d36eeda4183226b84aa7", "calls": [ { "from": "0x4200000000000000000000000000000000000015", "gas": "0xe9b4b", "gasUsed": "0x3fac", "to": "0x07dbe8500fc591d1852b76fee44d5a05e13097ff", "input": "0x440a5e200000044c000c5f9400000000000000010000000066bb59bf0000000001391bc8000000000000000000000000000000000000000000000000000000008f2dc0d4000000000000000000000000000000000000000000000000000000000000000185ecbf1317ed3502008cb9916eefe130fe0393a2c4f78b204ed8a4cf33679a4c000000000000000000000000415c8893d514f9bc5211d36eeda4183226b84aa7", "value": "0x0", "type": "DELEGATECALL" } ], "value": "0x0", "type": "CALL" } } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/blast/ title: Blast description: Blast is the only Ethereum L2 with native yield for ETH and stablecoins. 31 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/blast/index.mdx --- # Blast
> Blast API is available on [Web3 API platform](https://www.ankr.com/rpc/blast/). Blast is the only Ethereum L2 with native yield for ETH and stablecoins. Blast yield comes from ETH staking and RWA protocols. The yield from these decentralized protocols is passed back to Blast users automatically. The default interest rate on other L2s is 0%. On Blast, it’s 4% for ETH and 5% for stablecoins. In order for your Web3 application to interact with Blast — either by reading blockchain data or sending transactions to the network — it must connect to a Blast node. Developers interact with the blockchain using the methods provided by the API. ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/blast/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/blast/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/blast/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/blast/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/blast/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/blast/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/blast/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/blast/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/blast/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/blast/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/blast/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/blast/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/blast/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/blast/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/blast/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/blast/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/blast/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/blast/web3-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/blast/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/blast/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/blast/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/blast/eth/#eth_getlogs) — returns logs matching the parameters specified. **Premium-only methods**: * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/blast/eth/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/blast/eth/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/blast/eth-p2/#debug_traceblock) — traces the execution of all transactions within a block. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/blast/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/blast/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/blast/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/blast/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/blast/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/blast/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/blast/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/blast/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/blast/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/blast/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/blast/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/blast/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/blast/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/blast/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/blast/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/blast/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/blast/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/blast/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/blast/web3-p3/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/blast/web3-p3/#eth_gettransactionreceipt) ### eth, debug - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/blast/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/blast/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/blast/eth/#eth_getlogs) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/blast/eth/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/blast/eth/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/blast/eth-p2/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/blast/web3-p2/ title: Blast — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/blast/web3-p2.mdx --- # Blast — web3, net, eth (2/3) > API reference for [Blast](/rpc-service/chains/chains-api/blast/). [All methods ->](/rpc-service/chains/chains-api/blast/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/blast/web3/) · 2 · [3](/rpc-service/chains/chains-api/blast/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x4200000000000000000000000000000000000023","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0x4200000000000000000000000000000000000023"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xadaf" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x76878390e493747d58c407424f9a5a8f83bf94c161a5faaa57973ecf344cb28d", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5eb8070d", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1c9c380", "gasUsed": "0xb6db2f", "hash": "0x76878390e493747d58c407424f9a5a8f83bf94c161a5faaa57973ecf344cb28d", "logsBloom": "0x801200304c04a0d0022018108a6845d01a0e2b1082d10840003da181b03181207202c1040609002022c4004081e9002180ec0041001220a407080268a96812501c50459494372c487308230b88f008a9002069061ac4c001404386859011922518025a006b10280c088440a1415918013d500000095c2d1182000111a8088404104010a08c012d680028c8e208111ae1010180052100a28e02205900180404404384400102008093032408502842082938151180c2061009d24e1c0a000f03d972a72e4ad342500141212b861ba6881934b84808020c8210c002a60320566408a410cac2180c0260300463442534298c0406104108080f4822cc409c050c9850", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x5a469ccd37aaca1d805258a510da8e0c55822b294d98253ba4b84c421ec20529", "nonce": "0x0000000000000000", "number": "0x1e7e0c", "parentHash": "0xaef43607e53180dfafd537217a81da05f5a45eaa231ef11ac52210a8e1adefd4", "receiptsRoot": "0x05af779575e5b050fb5df54259810ebfd598b9027f9072232cbe7dfd51a53c87", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3a27", "stateRoot": "0x342f26e39750645657b3a7e9f68ca9c4cfdeb17408055f6bfdbfe637de91fdb1", "timestamp": "0x65d87078", "totalDifficulty": "0x0", "transactions": [ "0xd538e965e67b7a334b17cc6dd8208731de5ed71dbd7cb20e8be9e8d7ba525926", "0x729757723e90be17efc63ae84e6d0af5e5ce7d4c3ea8ddd685d77e9f0bb20b08", "0x0c9c93459cd8fc7571399c8f42d3e9af9ef10b07df600a1f4863e97a7d274543", "0x659851f70d816e074cdbe7190b02bb2c030d3a916723c0997e2eb16f96154fc8", "0x5ddd915af02a891379c7c0fd6008177cb7982ebf1a85c61cb0ae724d3f503f0a", "0x3a1fd0ebaf2495b28e973bb7f29cf63bc7229835ac5377789ec8a4da7fb69ab7", "0x8aeeed88319c8f608c77f8af1375c18b222fe9e7fe70f3276a9ec9163435eb12" ], "transactionsRoot": "0x78c2a467daa1e8cac5e3b5667a9a50d406083a5a7f1060563bfb1628c17d0b36", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5a3cf81c", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1c9c380", "gasUsed": "0x4b0616", "hash": "0xc857598578bc41aecb0a82e6525ad9816349de79919b9c5f900207b356e9a536", "logsBloom": "0x0822820400002084005850008600040100140100980000041c000800008063200224410000184101010d0020030c04044021980900002414054800e880284148010006a084280438e202020a05580020000200020140000004090204a044190041001800128070440a08080000040800a040340018082c080000021888088020024004400c08064408800845090007c10009020100000048002040410048041203000000020000020d8008000000006022041100200000c01800010a02040700020408420042010000420a20040200003400090802008410c000c403a01c20121410208110201088000000800201000080011131a00142604a840000e1080818", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x4d7911b4450377307e36b0c4562e93b1cbfef5fc5f5c0a3b754ed97622fedc2d", "nonce": "0x0000000000000000", "number": "0x1e7e4b", "parentHash": "0x50cdf00bf687247dde7fe5355d6d04d908dc3c420980702b0191360514cccd7e", "receiptsRoot": "0xdafd88de16ab06fbecd5632afd71cf99e8cfe4cb0a9d9a3555430923334ce2c4", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x2751", "stateRoot": "0x94ff8877ace1337009a5cece0e8c81d2aefe75ef18ee97983eb2f258f057dda5", "timestamp": "0x65d870f6", "totalDifficulty": "0x0", "transactions": [ "0x7a0c8041c662aa117d1c1427aad23a03d133df366b031629e78a53e02f5b82a5", "0x2fc61943227e7d5e0e2f70a5d675abf8f5b923698144ffa0e231b9b77aefb7e9", "0xcfbd6eadcbfdc4e868bd2889e230555f9d2c9c4be1fe9a8758a2872ec78755a9", "0x97cfcb091c915b040cce3c68b8b04b1620f1446640cf872575c3359fa27a7b6d", "0x3ec068995ed3e4ffd240857ea81917e673571ffd47d1e104abeaddd53b185e01", "0x05c84c8925e1a5aa23a77f47cfe9b9efb08955b25049f500816b70e41aec4b5e", "0x72b531dbfa842e7361ab4124ac6a9cbf6fcb9e9876f1676aacb3164ead436ddc", "0x0780c03258a3df8136d71cdd01fa7e606e24c8f736e2bb4f0cccdeacefc84af8" ], "transactionsRoot": "0xe1caf5d3024651e382976d101a38c4a13ef8d2757f69c4f741b4ae4984b75a78", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xa5883fda79455057888cfa8d120fe0f5b59d8cb2225724ca31e8a0b751dc1368"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5172be7e1452ae1b7b486094f16974153ee077d6272e2a34fe93a9952dcd0e8b", "blockNumber": "0x1e7e63", "from": "0x030a37f7505401936b0c2208659b043d62e57a8f", "gas": "0xdb47", "gasPrice": "0x587c5836", "maxFeePerGas": "0x78492042", "maxPriorityFeePerGas": "0xded21", "hash": "0xa5883fda79455057888cfa8d120fe0f5b59d8cb2225724ca31e8a0b751dc1368", "input": "0xd0e30db0", "nonce": "0xdc3", "to": "0x4200000000000000000000000000000000000023", "transactionIndex": "0xd", "value": "0x5af3107a4000", "type": "0x2", "accessList": [], "chainId": "0xa0c71fd", "v": "0x1", "r": "0x1966ba2364455f5fa7389af78214cd7b79d1452b8d770c1aa01500028b148b46", "s": "0x689d23f9ee7740c672b48d344dfcb1977ec55d0d60d1e15b6726421055960b81", "yParity": "0x1" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x5172be7e1452ae1b7b486094f16974153ee077d6272e2a34fe93a9952dcd0e8b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5172be7e1452ae1b7b486094f16974153ee077d6272e2a34fe93a9952dcd0e8b", "blockNumber": "0x1e7e63", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x7b789abb928f7b6870fb7ec8b99774097a304d65cb3a71fa1bc6c14098ca5005", "input": "0x015d8eb900000000000000000000000000000000000000000000000000000000005195680000000000000000000000000000000000000000000000000000000065d870c000000000000000000000000000000000000000000000000000000000000000617d36b3cdd42935d7127a9dea1da52fa9657f5a10541b2f3656906a6dcb99c9da0000000000000000000000000000000000000000000000000000000000000009000000000000000000000000ba26fee2fa917443e05e65de8d4350bcd2f5922200000000000000000000000000000000000000000000000000000000000000bc00000000000000000000000000000000000000000000000000000000000a6fe0", "nonce": "0x1e7e62", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x14878e8b01146ec5a99f38c28027e4ac447fdca509ccf206550f43486c882d3d", "mint": "0x0", "depositReceiptVersion": "0x1" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/blast/web3-p3/ title: Blast — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/blast/web3-p3.mdx --- # Blast — web3, net, eth (3/3) > API reference for [Blast](/rpc-service/chains/chains-api/blast/). [All methods ->](/rpc-service/chains/chains-api/blast/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/blast/web3/) · [2](/rpc-service/chains/chains-api/blast/web3-p2/) · 3 ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x1E7E63", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5172be7e1452ae1b7b486094f16974153ee077d6272e2a34fe93a9952dcd0e8b", "blockNumber": "0x1e7e63", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x7b789abb928f7b6870fb7ec8b99774097a304d65cb3a71fa1bc6c14098ca5005", "input": "0x015d8eb900000000000000000000000000000000000000000000000000000000005195680000000000000000000000000000000000000000000000000000000065d870c000000000000000000000000000000000000000000000000000000000000000617d36b3cdd42935d7127a9dea1da52fa9657f5a10541b2f3656906a6dcb99c9da0000000000000000000000000000000000000000000000000000000000000009000000000000000000000000ba26fee2fa917443e05e65de8d4350bcd2f5922200000000000000000000000000000000000000000000000000000000000000bc00000000000000000000000000000000000000000000000000000000000a6fe0", "nonce": "0x1e7e62", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x14878e8b01146ec5a99f38c28027e4ac447fdca509ccf206550f43486c882d3d", "mint": "0x0", "depositReceiptVersion": "0x1" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xa5883fda79455057888cfa8d120fe0f5b59d8cb2225724ca31e8a0b751dc1368"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5172be7e1452ae1b7b486094f16974153ee077d6272e2a34fe93a9952dcd0e8b", "blockNumber": "0x1e7e63", "contractAddress": null, "cumulativeGasUsed": "0xf0af1", "effectiveGasPrice": "0x587c5836", "from": "0x030a37f7505401936b0c2208659b043d62e57a8f", "gasUsed": "0xd994", "l1Fee": "0x1f4b8", "l1FeeScalar": "0.684", "l1GasPrice": "0x61", "l1GasUsed": "0x78c", "logs": [ { "address": "0x4200000000000000000000000000000000000023", "topics": [ "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", "0x000000000000000000000000030a37f7505401936b0c2208659b043d62e57a8f" ], "data": "0x00000000000000000000000000000000000000000000000000005af3107a4000", "blockNumber": "0x1e7e63", "transactionHash": "0xa5883fda79455057888cfa8d120fe0f5b59d8cb2225724ca31e8a0b751dc1368", "transactionIndex": "0xd", "blockHash": "0x5172be7e1452ae1b7b486094f16974153ee077d6272e2a34fe93a9952dcd0e8b", "logIndex": "0x13", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000002000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000800000000000000000000000010000000000000000000000000000000000000000000001000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000", "status": "0x1", "to": "0x4200000000000000000000000000000000000023", "transactionHash": "0xa5883fda79455057888cfa8d120fe0f5b59d8cb2225724ca31e8a0b751dc1368", "transactionIndex": "0xd", "type": "0x2" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/blast/web3/ title: Blast — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/blast/web3.mdx --- # Blast — web3, net, eth (1/3) > API reference for [Blast](/rpc-service/chains/chains-api/blast/). [All methods ->](/rpc-service/chains/chains-api/blast/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/blast/web3-p2/) · [3](/rpc-service/chains/chains-api/blast/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Geth/v0.1.0-unstable/linux-amd64/go1.21.5" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "168587773" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5f0819da" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1e7d10" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xCe292495Ac1166215eA02f1616900F90B3C20762", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xCe292495Ac1166215eA02f1616900F90B3C20762", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x3F0229F3A99323BE9FEdaAabe127F9E2B5E84AA1", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x8e" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xfcebcbde11690e2b10fd9e6148a4e8370686eab1737bce43b78a18d32d4b8e83"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x1E7D70"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xfcebcbde11690e2b10fd9e6148a4e8370686eab1737bce43b78a18d32d4b8e83"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x1E7D70"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x0273484a144329B1A6bA31ebe08124470807D723", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/blast/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/ title: BNB Smart Chain — eth, trace, debug (2/2) source: docs/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2.mdx --- # BNB Smart Chain — eth, trace, debug (2/2) > API reference for [BNB Smart Chain](/rpc-service/chains/chains-api/bnb-smart-chain/). [All methods ->](/rpc-service/chains/chains-api/bnb-smart-chain/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/bnb-smart-chain/eth/) · 2 ## `trace_replayTransaction` > Replays a transaction and returns the traces produced by its execution along with the state changes. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `transactionHash` (string): the hash of the transaction to be replayed. * `traceTypes` (array of strings): the types of traces to be included in the response. Possible value: `trace`. ### Returns The method returns an object that can include the following fields: * `trace` (array): an array of trace objects, similar to those returned by `trace_transaction` and `trace_filter`: * `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For call: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_replayTransaction", "params": ["0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e", ["trace"]], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "output": "0x", "stateDiff": null, "trace": [ { "action": { "callType": "call", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x38025", "input": "0x3161b7f60000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a50000000000000000000000000000000000000000000123a8d6d9f1c9e741075000000000000000000000000000000000000000000000000000000000017d78400000000000000000000000000000000000000000000000000000000000000010", "value": "0x0", "to": "0x2d61dcdd36f10b22176e0433b86f74567d529aaa" }, "result": { "gasUsed": "0x38025", "output": "0x" }, "subtraces": 1, "traceAddress": [], "type": "call" } ], "vmTrace": null } } ``` --- ## `trace_replayBlockTransactions` > Replays all the transactions in a given block and returns the traces produced by their execution along with the state changes. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `blockHash` (string): the hash of the block whose transactions you want to replay. * `traceTypes` (array of strings): the types of traces to be included in the response. Possible value: `trace`. ### Returns The method returns an object that can include the following fields: * `trace` (array): an array of trace objects, similar to those returned by `trace_transaction` and `trace_filter`: * `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For call: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_replayBlockTransactions", "params": ["0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e", ["trace"]], "id": 1 }' ``` --- ## `trace_block` > Retrieves a detailed trace of all the transactions in a specific block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `blockNumber` (string): the number of the block you want to trace, given as a hexadecimal string. ### Returns The method returns an array of trace objects, each of which contains detailed information about a particular operation. These trace objects include the following fields: * `action` (object): describes the action that was performed. The structure of this object varies based on the type of action. * For `call` actions: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create` actions: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward` actions: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide` actions: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): the number of the block containing the transaction. * `result` (object): describes the result of the action. * For `call` actions: * `gasUsed` (string): the amount of gas used by the call. * `output` (string): the output data from the call. * For `create` actions: * `address` (string): the address of the created contract. * `code` (string): the runtime code of the created contract. * `gasUsed` (string): the amount of gas used by the creation. * For `reward` actions: no additional fields. * For `suicide` actions: no additional fields. * `subtraces` (integer): the number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): the address within the trace hierarchy, indicating the position of the trace in the call stack. * `transactionHash` (string): the hash of the transaction containing the trace. * `transactionPosition` (integer): the index position of the transaction within the block. * `type` (string): the type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_block", "params": ["0x14869E9E"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0x33fae588909af0e48e0e70e799c366206d98e27a4b31c818324a5c95d5d9fe1b", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "result": { "type": "CALL", "from": "0x12090c459a10757e4debaa114a46c082c22bdc70", "to": "0x8018de591a0593bf856ffcff675ad87c39b8e633", "value": "0x3bcb33300e37dc0000", "gas": "0x0", "gasUsed": "0x0", "input": "0x", "output": "0x" } } ] } ``` --- ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0x2A5D33", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "result": { "type": "CALL", "from": "0x12090c459a10757e4debaa114a46c082c22bdc70", "to": "0x8018de591a0593bf856ffcff675ad87c39b8e633", "value": "0x3bcb33300e37dc0000", "gas": "0x0", "gasUsed": "0x0", "input": "0x", "output": "0x" } } ] } ``` --- ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bnb-smart-chain/eth/ title: BNB Smart Chain — eth, trace, debug (1/2) source: docs/rpc-service/chains/chains-api/bnb-smart-chain/eth.mdx --- # BNB Smart Chain — eth, trace, debug (1/2) > API reference for [BNB Smart Chain](/rpc-service/chains/chains-api/bnb-smart-chain/). [All methods ->](/rpc-service/chains/chains-api/bnb-smart-chain/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/) ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- ## `trace_filter` > Retrieve traces that match filter criteria. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `fromBlock` (string, optional): the starting block number, given as a hexadecimal string. Example: "0x1" for the first block. * `toBlock` (string, optional): the ending block number, given as a hexadecimal string. Example: "latest" for the most recent block. * `fromAddress` (array of strings, optional): an array of addresses that initiated the transactions. Example: ["0xAddress1", "0xAddress2"]. * `toAddress` (array of strings, optional): an array of addresses that received the transactions. Example: ["0xAddress1", "0xAddress2"]. * `after` (integer, optional): the offset for pagination. Example: 0. * `count` (integer, optional): the number of results to return. Example: 100. * `topics` (array of arrays of strings, optional): an array of log topics to filter by. Each inner array represents a set of possible values for that topic. Example: [["0xTopic1", "0xTopic2"], ["0xTopic3"]]. ### Returns
* `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For `call`: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_filter", "params": [{ "fromBlock": "0x3ff718", "toBlock": "0x3ff720", "fromAddress": ["0x1234567890abcdef1234567890abcdef12345678"], "toAddress": ["0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"], "topics": [["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"]] }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `trace_transaction` > Retrieves the traces created during the execution of a given transaction. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `transactionHash` (string; required): the hash of the transaction for which you want to retrieve the traces. ### Returns
* `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For call: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_transaction", "params": ["0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "action": { "callType": "call", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x38025", "input": "0x3161b7f60000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a50000000000000000000000000000000000000000000123a8d6d9f1c9e741075000000000000000000000000000000000000000000000000000000000017d78400000000000000000000000000000000000000000000000000000000000000010", "value": "0x0", "to": "0x2d61dcdd36f10b22176e0433b86f74567d529aaa" }, "result": { "gasUsed": "0x38025", "output": "0x" }, "subtraces": 1, "traceAddress": [], "type": "call", "blockHash": "0xb20d0897ac3567d603afb646238b66e455bf28d234ce96cdbbe86ddc8d27c9e9", "blockNumber": 344366750, "transactionHash": "0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e", "transactionPosition": 0 } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bnb-smart-chain/ title: BNB Smart Chain description: BNB Smart Chain is an innovative solution to bring programmability and interoperability to Beacon Chain. 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/bnb-smart-chain/index.mdx --- # BNB Smart Chain
> BNB Smart Chain API is available on [Web3 API platform](https://www.ankr.com/rpc/bsc). *BNB Smart Chain* is an innovative solution to bring programmability and interoperability to Beacon Chain. BNB Smart Chain relies on a system of 50 validators with Proof of Staked Authority (PoSA) consensus that can support short block time and lower fees. The most bonded validator candidates of staking will become validators and produce blocks. The double-sign detection and other slashing logic guarantee security, stability, and chain finality. The BNB Smart Chain also supports EVM-compatible smart contracts and protocols. Cross-chain transfer and other communication are possible due to native support of interoperability. The BNB Smart Chain highlights: * EVM-Compatible * Proof-of-Staked Authority * Cross-Chain Transfer * Block time `~3` seconds In order for your Web3 application to interact with BNB Smart Chain — either by reading blockchain data or sending transactions to the network — it must connect to a BNB Smart Chain node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/bnb-smart-chain/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/bnb-smart-chain/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/bnb-smart-chain/eth/#eth_getlogs) — returns logs matching the parameters specified. Trace and debug methods (archive nodes; Premium and Enterprise plans; priced the same as standard calls): * [`trace_filter`](/rpc-service/chains/chains-api/bnb-smart-chain/eth/#trace_filter) — retrieve traces that match filter criteria. * [`trace_transaction`](/rpc-service/chains/chains-api/bnb-smart-chain/eth/#trace_transaction) — retrieves the traces created during the execution of a given transaction. * [`trace_replayTransaction`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#trace_replaytransaction) — replays a transaction and returns the traces produced by its execution along with the state changes. * [`trace_replayBlockTransactions`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#trace_replayblocktransactions) — replays all the transactions in a given block and returns the traces produced by their execution along with the state changes. * [`trace_block`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#trace_block) — retrieves a detailed trace of all the transactions in a specific block. * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#debug_traceblock) — traces the execution of all transactions within a block. --- ## Trace and debug methods The `trace_*` and `debug_*` families are served on the BNB Smart Chain **archive** node and are available on the **Premium** and **Enterprise** plans. They are priced the same as standard calls. Each API key has a **block-range cap** for these methods. A request whose block range exceeds the cap returns error [`-32602` (invalid params)](/rpc-service/errors/overview/); narrow the block range or contact support to raise the cap for your key. See [Per-chain & method quirks](/rpc-service/errors/per-chain-quirks/#block-range-limits-on-eth_getlogs-and-trace_) for the current limits. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/bnb-smart-chain/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p3/#eth_gettransactionreceipt) ### eth, trace, debug - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/bnb-smart-chain/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/bnb-smart-chain/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/bnb-smart-chain/eth/#eth_getlogs) - [`trace_filter`](/rpc-service/chains/chains-api/bnb-smart-chain/eth/#trace_filter) - [`trace_transaction`](/rpc-service/chains/chains-api/bnb-smart-chain/eth/#trace_transaction) - [`trace_replayTransaction`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#trace_replaytransaction) - [`trace_replayBlockTransactions`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#trace_replayblocktransactions) - [`trace_block`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#trace_block) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/bnb-smart-chain/eth-p2/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/ title: BNB Smart Chain — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2.mdx --- # BNB Smart Chain — web3, net, eth (2/3) > API reference for [BNB Smart Chain](/rpc-service/chains/chains-api/bnb-smart-chain/). [All methods ->](/rpc-service/chains/chains-api/bnb-smart-chain/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/bnb-smart-chain/web3/) · 2 · [3](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (hex encoded; required): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; required): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0xf5d4405248DC3078e21438Ac0919C63eA004BA04", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53b8" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xc5043f", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa917fcc721a5465a484e9be17cda0cc5493933dd3bc70c9adbee192cb419c9d7", "blockNumber": "0xc5043f", "from": "0x829bd824b016326a401d083b33d092293333a830", "gas": "0x33450", "gasPrice": "0x0", "hash": "0xdf8d8677c9cd5f81d8ee3663a4a64ce7fe93d35fcb46004529e77394630f8e11", "input": "0x", "nonce": "0xa16562", "to": "0x6e2edc2af25cd5704d99ba73ac7ece701f50192d", "transactionIndex": "0x2", "value": "0x20b9632b7dc0a3e", "type": "0x0", "v": "0x26", "r": "0x6fd8d85d440c87e894898ce7c12725eb994d416b0843ae5ddb0f188bc21ac9a2", "s": "0x47fe6bc7bb3ddc8d579509fed960934ab8ed6004152e62b2abca6639393b8e77" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bnb-smart-chain/web3-p3/ title: BNB Smart Chain — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/bnb-smart-chain/web3-p3.mdx --- # BNB Smart Chain — web3, net, eth (3/3) > API reference for [BNB Smart Chain](/rpc-service/chains/chains-api/bnb-smart-chain/). [All methods ->](/rpc-service/chains/chains-api/bnb-smart-chain/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/bnb-smart-chain/web3/) · [2](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3c9329b765d88c03d18f87dc1f2b5138c89d9a415d5c73dc7827b87aca176c8e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/bnb-smart-chain/web3/ title: BNB Smart Chain — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/bnb-smart-chain/web3.mdx --- # BNB Smart Chain — web3, net, eth (1/3) > API reference for [BNB Smart Chain](/rpc-service/chains/chains-api/bnb-smart-chain/). [All methods ->](/rpc-service/chains/chains-api/bnb-smart-chain/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p2/) · [3](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Geth/v1.1.18-03ff2992/linux-amd64/go1.17.13" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "56" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or FALSE, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x12a05f200" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1841b06" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2c85c3ecfcb5fb" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x36c1d18"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xb6" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0xc5043f"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/bnb-smart-chain/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/botanix/eth/ title: Botanix — eth source: docs/rpc-service/chains/chains-api/botanix/eth.mdx --- # Botanix — eth > API reference for [Botanix](/rpc-service/chains/chains-api/botanix/). [All methods ->](/rpc-service/chains/chains-api/botanix/#methods) ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x660B5", "0x1"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "hash": "0x54b22ece24974af6de3bab39aa31a59708cdacc621609385c606b2bb30f8817f", "nonce": "0xac", "blockHash": "0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", "blockNumber": "0x660b5", "transactionIndex": "0x1", "from": "0x0215b4ddd4e55b1b8f4dba430fe8e415ac95ac37", "to": "0x33b1ed34c11910f767b15ebabab782d61fb2c5ea", "value": "0x0", "gasPrice": "0x189b3", "gas": "0x3a83c", "maxFeePerGas": "0x189ac", "maxPriorityFeePerGas": "0x189ac", "input": "0x6c09596000000000000000000000000044cfd6b8e7ca65002f87250bbd5e4b3af9efbcaf000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000000000070c84c980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000215b4ddd4e55b1b8f4dba430fe8e415ac95ac370000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000044cfd6b8e7ca65002f87250bbd5e4b3af9efbcaf000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000000000070c8669a10000000000000000000000000215b4ddd4e55b1b8f4dba430fe8e415ac95ac370000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a5e0ae4e5103dc71ca290aa3654830442357a4890000000000000000000000002d1306bf00468b69345bbf1a2d01aa920359535a00000000000000000000000044cfd6b8e7ca65002f87250bbd5e4b3af9efbcaf000000000000000000000000233631132fd56c8f86d1fc97f0b82420a8d20af3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000000000026f20000000000000000000000000000000000000000000000000000000000000001", "r": "0x7fd4c243e895175815e98ad5a15010ebb6194e38e029270aeda38a408d97c75a", "s": "0x57489b3f8704ee9d23bfbcc082d8c3f0b713f8e7bacce9e5b23e7511676a400c", "v": "0x1", "yParity": "0x1", "chainId": "0xe34", "accessList": [], "type": "0x2" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x73f629c2ac279ac5abf37abaab13d11549dea9f6146bb302a80d6161dc103712"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "status": "0x1", "cumulativeGasUsed": "0x170f03", "logs": [ { "address": "0x233631132fd56c8f86d1fc97f0b82420a8d20af3", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x00000000000000000000000033b1ed34c11910f767b15ebabab782d61fb2c5ea" ], "data": "0x000000000000000000000000000000000000000000000000000009184e72a000", "blockHash": "0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", "blockNumber": "0x660b5", "blockTimestamp": "0x6756e1d2", "transactionHash": "0x73f629c2ac279ac5abf37abaab13d11549dea9f6146bb302a80d6161dc103712", "transactionIndex": "0xe", "logIndex": "0x14", "removed": false } ], "logsBloom": "0x00200000020000080800000000000000000000000000044000000000000000100040000000000000000000000000000000000000000000000010004000000000000000000000010050800008010004200000000000000000000000000000000000000000020000000000000000000800000002000000000000040010000000000000800000000000100000000000020000000000000000018000004000000000400008000000000000000000400100008000008000000000000000200000000800000022040000000000000000101000000004000000800000100000000020000000004000000000002000000002000000000000000000000000000000040000", "type": "0x0", "transactionHash": "0x73f629c2ac279ac5abf37abaab13d11549dea9f6146bb302a80d6161dc103712", "transactionIndex": "0xe", "blockHash": "0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", "blockNumber": "0x660b5", "gasUsed": "0x2bf5c", "effectiveGasPrice": "0x186a0", "from": "0x401316fd6478063231f5b921bccfef8536e38e7b", "to": "0x33b1ed34c11910f767b15ebabab782d61fb2c5ea", "contractAddress": null } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "fromBlock": "0x10", "toBlock": "0x74", "address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/botanix/ title: Botanix description: Botanix is a decentralized Turing-complete Layer 2 EVM built on the native currency of bitcoin. 29 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/botanix/index.mdx --- # Botanix
> Botanix API is available on [Web3 API platform](https://www.ankr.com/rpc/botanix). *Botanix* is a decentralized Turing-complete Layer 2 EVM built on the native currency of bitcoin. It operates using two core components: * **Ethereum Virtual Machine**: Fortified by a Proof-of-Stake consensus protocol that leverages Bitcoin's Proof-of-Work for superior security. Stakes are represented by actual bitcoin stored securely within multi-signature wallets on the Bitcoin network. By supporting EVM, Botanix allows developers to seamlessly port existing Ethereum dApps to the Bitcoin ecosystem. * **Spiderchain Protocol**: At the core of Botanix is the Spiderchain, a series of successive multisignature (multisig) wallets managed by randomized sets of orchestrators. This structure secures user funds and facilitates the movement of Bitcoin within the network, effectively separating Bitcoin "the asset" from Bitcoin "the blockchain." By securing the Bitcoin present on Botanix in a decentralized chain of multisigs, it separates Bitcoin from the EVM. This allows for a transition from Bitcoin’s UTXO model to an account model used in the EVM. In order for your Web3 application to interact with Botanix — either by reading blockchain data or sending transactions to the network — it must connect to a Botanix node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/botanix/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/botanix/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/botanix/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/botanix/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_protocolVersion`](/rpc-service/chains/chains-api/botanix/web3/#eth_protocolversion) — returns the current protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/botanix/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/botanix/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/botanix/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/botanix/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/botanix/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/botanix/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/botanix/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/botanix/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/botanix/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/botanix/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/botanix/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/botanix/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/botanix/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/botanix/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/botanix/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/botanix/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/botanix/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/botanix/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/botanix/web3-p3/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/botanix/eth/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/botanix/eth/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/botanix/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/botanix/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/botanix/eth/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/botanix/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/botanix/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/botanix/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/botanix/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/botanix/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/botanix/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/botanix/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/botanix/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/botanix/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/botanix/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/botanix/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/botanix/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/botanix/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/botanix/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/botanix/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/botanix/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/botanix/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/botanix/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/botanix/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/botanix/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/botanix/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/botanix/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/botanix/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/botanix/web3-p3/#eth_gettransactionbyblockhashandindex) ### eth - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/botanix/eth/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/botanix/eth/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/botanix/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/botanix/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/botanix/eth/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/botanix/web3-p2/ title: Botanix — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/botanix/web3-p2.mdx --- # Botanix — web3, net, eth (2/3) > API reference for [Botanix](/rpc-service/chains/chains-api/botanix/). [All methods ->](/rpc-service/chains/chains-api/botanix/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/botanix/web3/) · 2 · [3](/rpc-service/chains/chains-api/botanix/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0xc546819478373AE2E7cBD2DaF5365Ef90add1e60", "data": "0x70a082310000000000000000000000005A93A3F8C5E3EAE603B36E3E0805A2E2290B1E82" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0x8D53Df2E3Ed5edCd3d821201088Ae213382fD64B", "to": "0x3C9fc59ac02f1929fDc4e4eE7C68f9481eC95347", "value": "0x2", "data": "0xa9059cbb0000000000000000000000005A93A3F8C5E3EAE603B36E3E0805A2E2290B1E8200000000000000000000000000000000000000000000000000000000000003e8" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x54f6" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", false], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "hash": "0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", "parentHash": "0xa1bd6f3e0048e9e02e6d9c7813ca677d2f4c2cdbeb230625a7d49e05df22d852", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x0000000000000000000000000000000000000000", "stateRoot": "0xe06200dad3d27de6ee8f6cacd686760c9cd75b3ad588f10ec2f3de8ac6946e86", "transactionsRoot": "0xabd869fb8949ced639d914003eea4d6828812a4cc2d009e8ad029926ade02756", "receiptsRoot": "0x5742bdfaf3bb8867668776ae36114348cf62cce44ab24bd9fc2f47397807b860", "logsBloom": "0x00200000020000080800000000000000000000000000044000000000000000100040000000000000000000000000000000000000000820000010004000201000040000000000010850800008014004200000000000000000100000010000000000000000020008000000000000000800000002000000000000050010000800000000800000000000100000000008020000000000000000018000004000000200420008100000000000000000400100008000008020800000000000200000000800000022060000000000000004101000000004000000800001100000000020000010004000000000002000000002000000080200000000000000000000040000", "difficulty": "0x0", "number": "0x660b5", "gasLimit": "0x1c9c380", "gasUsed": "0x170f03", "timestamp": "0x6756e1d2", "totalDifficulty": "0x0", "extraData": "0x00000000000000009ad3257eb2068ef8f800595cb5ad7c3f0a23d1d5da2120bf7aacf44fe102000002ba8b5f472d0f435c528488eaab3a29e113222ecc9b3282a313f86f7b85ec2dc785ff04d7785beeaad6e508828b5c9a22262fd98e", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "baseFeePerGas": "0x7", "blobGasUsed": "0x0", "excessBlobGas": "0x0", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "uncles": [], "transactions": [ "0x8816760db1ab5121f82ccc6074e1b81e732354e9c0a21a893c2e0d62980b6735", "0x54b22ece24974af6de3bab39aa31a59708cdacc621609385c606b2bb30f8817f", "0x1ac2ffa0343b447c5b82b253728763103eac03d5b7611dc75c25cfa6979f0883", "0xcec3a9e568ae13291180da1c87f998cadae0913c99bd356085ade92c501a1373", "0x8d598b527e3bbb846bb14ed9b7cfc866e85e82493591ad1bfc3b9f844d167862", "0x0dd0a9fa7457fb7dcdee67abe0e506f5a25d7d31395b9ff92ffe1216f3397175" ], "size": "0x20ec" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x660B5", true], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "hash": "0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", "parentHash": "0xa1bd6f3e0048e9e02e6d9c7813ca677d2f4c2cdbeb230625a7d49e05df22d852", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x0000000000000000000000000000000000000000", "stateRoot": "0xe06200dad3d27de6ee8f6cacd686760c9cd75b3ad588f10ec2f3de8ac6946e86", "transactionsRoot": "0xabd869fb8949ced639d914003eea4d6828812a4cc2d009e8ad029926ade02756", "receiptsRoot": "0x5742bdfaf3bb8867668776ae36114348cf62cce44ab24bd9fc2f47397807b860", "logsBloom": "0x00200000020000080800000000000000000000000000044000000000000000100040000000000000000000000000000000000000000820000010004000201000040000000000010850800008014004200000000000000000100000010000000000000000020008000000000000000800000002000000000000050010000800000000800000000000100000000008020000000000000000018000004000000200420008100000000000000000400100008000008020800000000000200000000800000022060000000000000004101000000004000000800001100000000020000010004000000000002000000002000000080200000000000000000000040000", "difficulty": "0x0", "number": "0x660b5", "gasLimit": "0x1c9c380", "gasUsed": "0x170f03", "timestamp": "0x6756e1d2", "totalDifficulty": "0x0", "extraData": "0x00000000000000009ad3257eb2068ef8f800595cb5ad7c3f0a23d1d5da2120bf7aacf44fe102000002ba8b5f472d0f435c528488eaab3a29e113222ecc9b3282a313f86f7b85ec2dc785ff04d7785beeaad6e508828b5c9a22262fd98e", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "baseFeePerGas": "0x7", "blobGasUsed": "0x0", "excessBlobGas": "0x0", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "uncles": [], "transactions": [ { "hash": "0x8816760db1ab5121f82ccc6074e1b81e732354e9c0a21a893c2e0d62980b6735", "nonce": "0x31", "blockHash": "0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", "blockNumber": "0x660b5", "transactionIndex": "0x0", "from": "0x891c16e3269e35202ba2b75fcb94c821fc2cb91d", "to": "0x33b1ed34c11910f767b15ebabab782d61fb2c5ea", "value": "0x0", "gasPrice": "0x189b3", "gas": "0x3a83c", "maxFeePerGas": "0x189ac", "maxPriorityFeePerGas": "0x189ac", "input": "0x6c09596000000000000000000000000044cfd6b8e7ca65002f87250bbd5e4b3af9efbcaf000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000000000070c84c980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000891c16e3269e35202ba2b75fcb94c821fc2cb91d000000...", "r": "0xc815313071e4762dfdb3ed934c7dca43ed891c16807cfe1d68c874a565dff23b", "s": "0x78d96a0cd608746d7d05a9d0415ba4d337a09be745a8f0db4f86c6dfd2c9c144", "v": "0x1", "yParity": "0x1", "chainId": "0xe34", "accessList": [], "type": "0x2" } ], "size": "0x20ec" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x73f629c2ac279ac5abf37abaab13d11549dea9f6146bb302a80d6161dc103712"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "hash": "0x73f629c2ac279ac5abf37abaab13d11549dea9f6146bb302a80d6161dc103712", "nonce": "0x3", "blockHash": "0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", "blockNumber": "0x660b5", "transactionIndex": "0xe", "from": "0x401316fd6478063231f5b921bccfef8536e38e7b", "to": "0x33b1ed34c11910f767b15ebabab782d61fb2c5ea", "value": "0x9184e72a000", "gasPrice": "0x186a0", "gas": "0x326d4", "input": "0x6c095960000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000e19ce0acf70dbd7ff9cb80715f84ab0fd72b57ac000000000000000000000000000000000000000000000000000009184e72a00000000000000000000000000000000000000000000000000004579a5e7a152a69000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000401316fd6478063231f5b921bccfef8536e38e7b00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000233631132fd56c8f86d1fc97f0b82420a8d20af3000000000000000000000000e19ce0acf70dbd7ff9cb80715f84ab0fd72b57ac000000000000000000000000000000000000000000000000000009184e72a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000401316fd6478063231f5b921bccfef8536e38e7b000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000007c49ade88b40f1ac05707f236d7706f834f6bdb000000000000000000000000c83983d79e4e482734d07360ab9324612dd19c81000000000000000000000000233631132fd56c8f86d1fc97f0b82420a8d20af3000000000000000000000000e19ce0acf70dbd7ff9cb80715f84ab0fd72b57ac000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000000000026fc0000000000000000000000000000000000000000000000000000000000000000", "r": "0xee4e3beb39ea549ea1fbd50448f2f54a5d7f76fc43d1da0ea1f4f8aae365ee1b", "s": "0x31192ba82defb27eaedc8e04af492c58c75369c2fb1304d328ea23e4320e855d", "v": "0x1c8b", "chainId": "0xe34", "type": "0x0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/botanix/web3-p3/ title: Botanix — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/botanix/web3-p3.mdx --- # Botanix — web3, net, eth (3/3) > API reference for [Botanix](/rpc-service/chains/chains-api/botanix/). [All methods ->](/rpc-service/chains/chains-api/botanix/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/botanix/web3/) · [2](/rpc-service/chains/chains-api/botanix/web3-p2/) · 3 ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "hash": "0x8816760db1ab5121f82ccc6074e1b81e732354e9c0a21a893c2e0d62980b6735", "nonce": "0x31", "blockHash": "0x98502d6708fb49ed2762f17ad038bd98ea6e2798a5239137f25e586b93da4e07", "blockNumber": "0x660b5", "transactionIndex": "0x0", "from": "0x891c16e3269e35202ba2b75fcb94c821fc2cb91d", "to": "0x33b1ed34c11910f767b15ebabab782d61fb2c5ea", "value": "0x0", "gasPrice": "0x189b3", "gas": "0x3a83c", "maxFeePerGas": "0x189ac", "maxPriorityFeePerGas": "0x189ac", "input": "0x6c09596000000000000000000000000044cfd6b8e7ca65002f87250bbd5e4b3af9efbcaf000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000000000070c84c980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000891c16e3269e35202ba2b75fcb94c821fc2cb91d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000044cfd6b8e7ca65002f87250bbd5e4b3af9efbcaf000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000000000070c8669a1000000000000000000000000891c16e3269e35202ba2b75fcb94c821fc2cb91d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a5e0ae4e5103dc71ca290aa3654830442357a4890000000000000000000000002d1306bf00468b69345bbf1a2d01aa920359535a00000000000000000000000044cfd6b8e7ca65002f87250bbd5e4b3af9efbcaf000000000000000000000000233631132fd56c8f86d1fc97f0b82420a8d20af3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000000000026f20000000000000000000000000000000000000000000000000000000000000001", "r": "0xc815313071e4762dfdb3ed934c7dca43ed891c16807cfe1d68c874a565dff23b", "s": "0x78d96a0cd608746d7d05a9d0415ba4d337a09be745a8f0db4f86c6dfd2c9c144", "v": "0x1", "yParity": "0x1", "chainId": "0xe34", "accessList": [], "type": "0x2" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/botanix/web3/ title: Botanix — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/botanix/web3.mdx --- # Botanix — web3, net, eth (1/3) > API reference for [Botanix](/rpc-service/chains/chains-api/botanix/). [All methods ->](/rpc-service/chains/chains-api/botanix/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/botanix/web3-p2/) · [3](/rpc-service/chains/chains-api/botanix/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "reth/v1.0.5-70258524/x86_64-unknown-linux-gnu", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "3636" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x5", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x18974" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x66036" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xA2436e808d851cbBC9B221C4B9DA0EDa768cc75c", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x23aefd32b5380a" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xA2436e808d851cbBC9B221C4B9DA0EDa768cc75c", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xA2436e808d851cbBC9B221C4B9DA0EDa768cc75c", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x167" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x58feadbd8aac12d7368a15c65cb28b0d7fb3288eb595286efd8967dc68cfd93b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x66033"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x58feadbd8aac12d7368a15c65cb28b0d7fb3288eb595286efd8967dc68cfd93b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x66033"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x7052e9bed0fd9dfa223735eff03534971028deeb", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/botanix/eth/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/btc/blockbook-api-methods-p2/ title: Bitcoin — Blockbook API methods (2/2) source: docs/rpc-service/chains/chains-api/btc/blockbook-api-methods-p2.mdx --- # Bitcoin — Blockbook API methods (2/2) > API reference for [Bitcoin](/rpc-service/chains/chains-api/btc/). [All methods ->](/rpc-service/chains/chains-api/btc/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/btc/blockbook-api-methods/) · 2 ## Blockbook API methods ### Blockbook API v.1 REST ``` GET /api/v1/block-index/ GET /api/v1/tx/ GET /api/v1/address/
GET /api/v1/utxo/
GET /api/v1/block/ GET /api/v1/estimatefee/ GET /api/v1/sendtx/ POST /api/v1/sendtx/ (hex tx data in request body) ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/btc/blockbook-api-methods/ title: Bitcoin — Blockbook API methods (1/2) source: docs/rpc-service/chains/chains-api/btc/blockbook-api-methods.mdx --- # Bitcoin — Blockbook API methods (1/2) > API reference for [Bitcoin](/rpc-service/chains/chains-api/btc/). [All methods ->](/rpc-service/chains/chains-api/btc/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/btc/blockbook-api-methods-p2/) ## Blockbook API methods
Blockbook is an open-source blockchain indexer and API backend developed by the cryptocurrency wallet company Trezor. It is designed to be a high-performance and scalable solution for accessing blockchain data. Blockbook provides interaction with the indexed blockchain data via the following API interfaces: * [Blockbook API v.2 REST](#blockbook-api-v2-rest) — current methods. * [Blockbook API v.1 REST](/rpc-service/chains/chains-api/btc/blockbook-api-methods-p2/#blockbook-api-v1-rest) — legacy methods. **Common principles used in Blockbook API V2**: * all crypto amounts are transferred as strings, in the lowest denomination (satoshis, wei, ...), without decimal point * empty fields are omitted. Empty field is a string of value null or "", a number of value 0, an object of value null or an array without elements. ### Blockbook API v.2 REST The following methods are supported: * [Get block hash](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#get-block-hash) — retrieve the hash of a specific block by its height. * [Get transaction](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#get-transaction) — retrieves detailed information about a specific transaction by its ID. * [Get transaction specific](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#get-transaction-specific) — retrieves detailed and specific information about a particular transaction. * [Get address](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#get-address) — retrieves info about a specific cryptocurrency address. * [Get xpub](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#get-xpub) — retrieves info about an extended public key (xpub) or descriptor. * [Get utxo](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#get-utxo) — retrieves unspent transaction outputs (UTXOs) for a specific address. * [Get block](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#get-block) — retrieves detailed information about a specific block by its height or hash. * [Send transaction](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#send-transaction) — broadcasts a raw transaction to the blockchain network. * [Tickers list](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#tickers-list) — retrieves a list of all available tickers. * [Tickers](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#tickers) — retrieves detailed information about specific tickers. * [Balance history](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#balance-history) — retrieves the balance history for a specific xpub or address over a specified time range. --- #### Get block hash > `GET /api/v2/block-index/` Retrieves the hash of the block specified by the block number. ##### Parameters
* `block-height` (string; path; required): the height (block number) of the block for which you want to retrieve the hash. ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/block-index/854043 ``` ##### Response example ```json { "blockHash": "000000000000000000020c91b9e0ded91c1b69c00fa0c0611c636425b52f7f98" } ``` _Note: Blockbook always follows the main chain of the backend it is attached to. See notes on **Get Block** below_ #### Get transaction > `GET /api/v2/tx/` Retrieves detailed information about a specific transaction on the blockchain. It does not return coin specific fields. ##### Parameters
* `txid` (string; path; required): the transaction ID of the transaction you want to retrieve information about. ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/tx/950817076007421e23552156277f343fd579cbacc1e92aa14657baff647d2fc9 ``` ##### Response example ```json { "txid": "950817076007421e23552156277f343fd579cbacc1e92aa14657baff647d2fc9", "version": 1, "vin": [ { "sequence": 4294967295, "n": 0, "isAddress": false, "coinbase": "03700a0d194d696e656420627920416e74506f6f6c2048008a0022d76023fabe6d6d457f44903a18fde9ef74fe2f8fcec7bdc2bfea8f0cdca4a7e8d93713dec1ca491000000000000000ea4000001802000000000000" } ], "vout": [ { "value": "546", "n": 0, "hex": "a91442402a28dd61f2718a4b27ae72a4791d5bbdade787", "addresses": [ "37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z" ], "isAddress": true }, { "value": "319767249", "n": 1, "hex": "a9145249bdf2c131d43995cff42e8feee293f79297a887", "addresses": [ "39C7fxSzEACPjM78Z7xdPxhf7mKxJwvfMJ" ], "isAddress": true }, { "value": "0", "n": 2, "hex": "6a24aa21a9ed6daa62fdbed57bd0fa6aa10c9522a4a6f602ab0206310d432541ed7dc33a26d0", "addresses": [ "OP_RETURN aa21a9ed6daa62fdbed57bd0fa6aa10c9522a4a6f602ab0206310d432541ed7dc33a26d0" ], "isAddress": false }, { "value": "0", "n": 3, "hex": "6a2d434f5245012953559db5cc88ab20b1960faa9793803d0703374e3ecda72cb7961caa4b541b1e322bcfe0b5a030", "addresses": [ "OP_RETURN 434f5245012953559db5cc88ab20b1960faa9793803d0703374e3ecda72cb7961caa4b541b1e322bcfe0b5a030" ], "isAddress": false }, { "value": "0", "n": 4, "hex": "6a2952534b424c4f434b3a68162ad9bace1bb20c1d2121e9634bc1be6c6dbe32c32684e291622200642fad", "addresses": [ "OP_RETURN 52534b424c4f434b3a68162ad9bace1bb20c1d2121e9634bc1be6c6dbe32c32684e291622200642fad" ], "isAddress": false } ], "blockHash": "000000000000000000008fe0320eb7034ecababe30a838308b5df4fab8c7a176", "blockHeight": 854640, "confirmations": 16, "blockTime": 1722330680, "size": 392, "vsize": 365, "value": "319767795", "valueIn": "0", "fees": "0", "hex": "010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff5603700a0d194d696e656420627920416e74506f6f6c2048008a0022d76023fabe6d6d457f44903a18fde9ef74fe2f8fcec7bdc2bfea8f0cdca4a7e8d93713dec1ca491000000000000000ea4000001802000000000000ffffffff05220200000000000017a91442402a28dd61f2718a4b27ae72a4791d5bbdade787d1420f130000000017a9145249bdf2c131d43995cff42e8feee293f79297a8870000000000000000266a24aa21a9ed6daa62fdbed57bd0fa6aa10c9522a4a6f602ab0206310d432541ed7dc33a26d000000000000000002f6a2d434f5245012953559db5cc88ab20b1960faa9793803d0703374e3ecda72cb7961caa4b541b1e322bcfe0b5a03000000000000000002b6a2952534b424c4f434b3a68162ad9bace1bb20c1d2121e9634bc1be6c6dbe32c32684e291622200642fad0120000000000000000000000000000000000000000000000000000000000000000000000000" } ``` ##### Response (unconfirmed tx) > (_blockHeight_: -1, _confirmations_: 0, mining estimates _confirmationETABlocks_ and _confirmationETASeconds_): ```json { "txid": "cd8ec77174e426070d0a50779232bba7312b712e2c6843d82d963d7076c61366", "version": 2, "vin": [ { "txid": "47687cc4abb58d815168686465a38113a0608b2568a6d6480129d197e653f6dc", "sequence": 4294967295, "n": 0, "addresses": ["bc1qka0gpenex558g8gpxmpx247mwhw695k6a7yhs4"], "isAddress": true, "value": "1983687" } ], "vout": [ { "value": "3106", "n": 0, "hex": "0020d7da4868055fde790a8581637ab81c216e17a3f8a099283da6c4a27419ffa539", "addresses": [ "bc1q6ldys6q9tl08jz59s93h4wquy9hp0glc5zvjs0dxcj38gx0l55uspu8x86" ], "isAddress": true }, { "value": "1979101", "n": 1, "hex": "0014381be30ca46ddf378ef69ebc4a601bd6ff30b754", "addresses": ["bc1q8qd7xr9ydh0n0rhkn67y5cqm6mlnpd65dcyeeg"], "isAddress": true } ], "blockHeight": -1, "confirmations": 0, "confirmationETABlocks": 3, "confirmationETASeconds": 2055, "blockTime": 1675270935, "size": 234, "vsize": 153, "value": "1982207", "valueIn": "1983687", "fees": "1480", "hex": "020000000001...b18f00000000" } ``` A note about the `blockTime` field: * For already mined transactions (`confirmations > 0`), the field `blockTime` contains time of the block. * For transactions in mempool (`confirmations == 0`), the field contains time when the running instance of Blockbook was first time notified about the transaction. This time may be different in different instances of Blockbook. #### Get transaction specific > `GET /api/v2/tx-specific/` Returns transaction data in the exact format as returned by backend, including all coin specific fields. ##### Parameters
* `txid` (string; path; required): the unique identifier of the transaction you want to retrieve information about. ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/tx-specific/950817076007421e23552156277f343fd579cbacc1e92aa14657baff647d2fc9 ``` ##### Response example ```json { "txid": "950817076007421e23552156277f343fd579cbacc1e92aa14657baff647d2fc9", "hash": "9dedf821ffda5a9e235e455c699983b5c76ce6ab962454317a78aeb84b59519f", "version": 1, "size": 392, "vsize": 365, "weight": 1460, "locktime": 0, "vin": [ { "coinbase": "03700a0d194d696e656420627920416e74506f6f6c2048008a0022d76023fabe6d6d457f44903a18fde9ef74fe2f8fcec7bdc2bfea8f0cdca4a7e8d93713dec1ca491000000000000000ea4000001802000000000000", "txinwitness": [ "0000000000000000000000000000000000000000000000000000000000000000" ], "sequence": 4294967295 } ], "vout": [ { "value": 0.00000546, "n": 0, "scriptPubKey": { "asm": "OP_HASH160 42402a28dd61f2718a4b27ae72a4791d5bbdade7 OP_EQUAL", "desc": "addr(37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z)#avhxp88d", "hex": "a91442402a28dd61f2718a4b27ae72a4791d5bbdade787", "address": "37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z", "type": "scripthash" } }, { "value": 3.19767249, "n": 1, "scriptPubKey": { "asm": "OP_HASH160 5249bdf2c131d43995cff42e8feee293f79297a8 OP_EQUAL", "desc": "addr(39C7fxSzEACPjM78Z7xdPxhf7mKxJwvfMJ)#vjljy0jc", "hex": "a9145249bdf2c131d43995cff42e8feee293f79297a887", "address": "39C7fxSzEACPjM78Z7xdPxhf7mKxJwvfMJ", "type": "scripthash" } }, { "value": 0.00000000, "n": 2, "scriptPubKey": { "asm": "OP_RETURN aa21a9ed6daa62fdbed57bd0fa6aa10c9522a4a6f602ab0206310d432541ed7dc33a26d0", "desc": "raw(6a24aa21a9ed6daa62fdbed57bd0fa6aa10c9522a4a6f602ab0206310d432541ed7dc33a26d0)#e7gqcaj2", "hex": "6a24aa21a9ed6daa62fdbed57bd0fa6aa10c9522a4a6f602ab0206310d432541ed7dc33a26d0", "type": "nulldata" } }, { "value": 0.00000000, "n": 3, "scriptPubKey": { "asm": "OP_RETURN 434f5245012953559db5cc88ab20b1960faa9793803d0703374e3ecda72cb7961caa4b541b1e322bcfe0b5a030", "desc": "raw(6a2d434f5245012953559db5cc88ab20b1960faa9793803d0703374e3ecda72cb7961caa4b541b1e322bcfe0b5a030)#jcuzcwf4", "hex": "6a2d434f5245012953559db5cc88ab20b1960faa9793803d0703374e3ecda72cb7961caa4b541b1e322bcfe0b5a030", "type": "nulldata" } }, { "value": 0.00000000, "n": 4, "scriptPubKey": { "asm": "OP_RETURN 52534b424c4f434b3a68162ad9bace1bb20c1d2121e9634bc1be6c6dbe32c32684e291622200642fad", "desc": "raw(6a2952534b424c4f434b3a68162ad9bace1bb20c1d2121e9634bc1be6c6dbe32c32684e291622200642fad)#c8yvmutu", "hex": "6a2952534b424c4f434b3a68162ad9bace1bb20c1d2121e9634bc1be6c6dbe32c32684e291622200642fad", "type": "nulldata" } } ], "hex": "010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff5603700a0d194d696e656420627920416e74506f6f6c2048008a0022d76023fabe6d6d457f44903a18fde9ef74fe2f8fcec7bdc2bfea8f0cdca4a7e8d93713dec1ca491000000000000000ea4000001802000000000000ffffffff05220200000000000017a91442402a28dd61f2718a4b27ae72a4791d5bbdade787d1420f130000000017a9145249bdf2c131d43995cff42e8feee293f79297a8870000000000000000266a24aa21a9ed6daa62fdbed57bd0fa6aa10c9522a4a6f602ab0206310d432541ed7dc33a26d000000000000000002f6a2d434f5245012953559db5cc88ab20b1960faa9793803d0703374e3ecda72cb7961caa4b541b1e322bcfe0b5a03000000000000000002b6a2952534b424c4f434b3a68162ad9bace1bb20c1d2121e9634bc1be6c6dbe32c32684e291622200642fad0120000000000000000000000000000000000000000000000000000000000000000000000000", "blockhash": "000000000000000000008fe0320eb7034ecababe30a838308b5df4fab8c7a176", "confirmations": 16, "time": 1722330680, "blocktime": 1722330680 } ``` #### Get address > `GET /api/v2/address/
` Returns balances and transactions of an address. The returned transactions are sorted by block height, the newest blocks first. ##### Parameters
* `address` (path; string; required): the cryptocurrency address you want to retrieve information about. * `page` (query; integer; optional): specifies page of returned transactions, starting from 1. If out of range, Blockbook returns the closest possible page. * `pageSize` (query; integer; optional): number of transactions returned by call (default and maximum 1000) * `from` (query; integer; optional): a starting block height of transactions to return. * `to` (query; integer; optional): an ending block height of transactions to return. * `details` (query; string; optional; default=`txids`): specifies level of details returned by request; supported values are the following: * `basic`: return only address balances, without any transactions. * `tokens`: `basic` + tokens belonging to the address (applicable only to some coins). * `tokenBalances`: `basic` + tokens with balances + belonging to the address (applicable only to some coins). * `txids`: `tokenBalances` + list of `txids`, subject to `from`, `to` filter and pagination. * `txslight`: `tokenBalances` + list of transaction with limited details (only data from index), subject to `from`, `to` filter and pagination. * `txs`: `tokenBalances` + list of transaction with details, subject to `from`, `to` filter and pagination. * `contract` (query; string; optional): return only transactions which affect specified contract (applicable only to coins which support contracts). * `secondary` (query; string; optional): specifies secondary (fiat) currency in which the token and total balances are returned in addition to crypto values. ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/address/bc1qqy0q2hxw2hwyw4qqdjjewyxx5sq966tstjyvh2y96zrz674dztjqe6qld0?details=txids ``` ##### Response example ```json { "page": 1, "totalPages": 1, "itemsOnPage": 1000, "address": "bc1qqy0q2hxw2hwyw4qqdjjewyxx5sq966tstjyvh2y96zrz674dztjqe6qld0", "balance": "140659800", "totalReceived": "140659800", "totalSent": "0", "unconfirmedBalance": "0", "unconfirmedTxs": 0, "txs": 1, "txids": [ "711004b7192e86b8c26e2567526a292e01045071a05b5fa40beed8edeb780829" ] } ``` #### Get xpub > `GET /api/v2/xpub/` Returns balances and transactions of an `xpub` or output descriptor, applicable only for Bitcoin-type coins. Blockbook supports BIP44, BIP49, BIP84 and BIP86 (Taproot) derivation schemes, using either xpubs or output descriptors (see https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md) - Xpubs Blockbook expects xpub at level 3 derivation path, i.e. _m/purpose'/coin_type'/account'/_. Blockbook completes the _change/address_index_ part of the path when deriving addresses. The BIP version is determined by the prefix of the xpub. The prefixes for each coin are defined by fields `xpub_magic`, `xpub_magic_segwit_p2sh`, `xpub_magic_segwit_native` in the [trezor-common](https://github.com/trezor/trezor-common/tree/master/defs/bitcoin) library. If the prefix is not recognized, Blockbook defaults to BIP44 derivation scheme.
- Output descriptors Output descriptors are in the form `([][//*])[#checksum]`, for example `pkh([5c9e228d/44'/0'/0']xpub6BgBgses...Mj92pReUsQ/<0;1>/*)#abcd` Parameters `type` and `xpub` are mandatory, the rest is optional Blockbook supports a limited set of `type`s: - BIP44: `pkh(xpub)` - BIP49: `sh(wpkh(xpub))` - BIP84: `wpkh(xpub)` - BIP86 (Taproot single key): `tr(xpub)` Parameter `change` can be a single number or a list of change indexes, specified either in the format `` or `{index1,index2,...}`. If the parameter `change` is not specified, Blockbook defaults to `<0;1>`. The returned transactions are sorted by block height, the newest blocks first. ##### Parameters
* `xpub|descriptor` (path; string; required): the extended public key (xpub) or descriptor you want to retrieve information about. * `page` (query; integer; optional): specifies returned transactions' page number, starting from 1. If out of range, Blockbook returns the closest possible page. * `pageSize` (query; integer; optional): the number of transactions returned by call (default and maximum 1000). * `from` (query; integer; optional): the starting block height to retrieve transactions from. * `to` (query; integer; optional): the ending block height to retrieve transactions up to. * `details` (query; string; optional): The level of detail in the response. Possible values are: * `basic`: only xpub balances, without any derived addresses and transactions. * `tokens`: basic + tokens (addresses) derived from the xpub, subject to tokens parameter * `tokenBalances`: basic + tokens (addresses) derived from the xpub with balances, subject to tokens parameter * `txids`: tokenBalances + list of txids, subject to `from`, `to` filter and paging * `txs`: tokenBalances + list of transaction with details, subject to `from`, `to` filter and paging * `tokens` (query; string; optional): specifies the tokens (xpub addresses) returned by the request (default nonzero); supported values are the following: * `nonzero`: return only addresses with nonzero balance. * `used`: return addresses with at least one transaction. * `derived`: return all derived addresses. * `secondary` (query; string; optional): specifies secondary (fiat) currency in which the balances are returned in addition to crypto values ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/xpub/xpub6AHA9hZDN11k2ijHMeS5QqHx2KP9aMBRhTDqANMnwVtdyw2TDYRmF8PjpvwUFcL1Et8Hj59S3gTSMcUQ5gAqTz3Wd8EsMTmF3DChhqPQBnU ``` ##### Response example ```json { "page": 1, "totalPages": 1, "itemsOnPage": 1000, "address": "xpub6AHA9hZDN11k2ijHMeS5QqHx2KP9aMBRhTDqANMnwVtdyw2TDYRmF8PjpvwUFcL1Et8Hj59S3gTSMcUQ5gAqTz3Wd8EsMTmF3DChhqPQBnU", "balance": "0", "totalReceived": "490131736", "totalSent": "490131736", "unconfirmedBalance": "0", "unconfirmedTxs": 0, "txs": 68, "addrTxCount": 80, "txids": [ "32ae8b107808fa52e811d0b0ac988959a5225af520ab1ba8b6461e1ae01c6549", "4c3fb15f12550280922896879120f2f629e56341df59112b0463d19bced143d9", "32b8d9c755d17da87d7ebbaa0589fe888f8547a7c4307b62991247d5dd4ef6f6", "a69c554c12a0f991cc5b8072e30782381e5748c97ab851dafcbc984928a60894", "2276913ab7b623feeda669d953ebd715984d87200bc01d1cb4fe8c1797e6f6ef", "19540748a8f3dc41a6b4a76fd1567987c375ff028ff280fe0a06f4d77da1744d", "0b24d267cb6c8122f2cff5a12090b78dd96102752b7ce9d274f1207805794635", "bca1b4fa2e0e962523f299588b2aa5f06065f6fc8a46180e0e0992297a9bad22", "8f8e412a4e0b0e140b28ae3ea01bad13b9a03383b04ead14e287f9103ecb64aa", "3b9170ee0267d138334af4ca3accce780d6b99f0b339263dbfe1abbe2e0d9b98", "22c0d06fe20252d22123d31bad257376c038b365e2206518ea3e085e6c1f893c", "45bba65dd50120dbaba555471321074d631c492d7a6f6a48384b313f0e32ed3f", "a958148603cbc8f4b98624c5807a6e6ac86f573191ee108d1795835561f98e2d", "5f2cbbe257f7c38c62f0c5058e97451bc52b218596bb1fcadad1b7feddd8ac37" ], "usedTokens": 33 } ``` Note: _usedTokens_ always returns total number of **used** addresses of xpub. #### Get utxo > `GET /api/v2/utxo/
` Returns array of unspent transaction outputs of address or xpub, applicable only for Bitcoin-type coins. By default, the list contains both confirmed and unconfirmed transactions. The query parameter `confirmed=true` disables return of unconfirmed transactions. The returned utxos are sorted by block height, the newest blocks first. For xpubs or output descriptors, the response also contains address and derivation path of the utxo. Unconfirmed utxos do not have field `height`, the field `confirmations` has value `0` and may contain field `lockTime`, if not zero. Coinbase utxos have field _coinbase_ set to true, however due to performance reasons only up to minimum coinbase confirmations limit (100). After this limit, utxos are not detected as coinbase. ##### Parameters
* `address`|`xpub`|`descriptor` (string; path; required): this parameter can be either a regular cryptocurrency address, an extended public key (xpub), or a descriptor. It is required to specify one of these to identify the source for which UTXOs are to be retrieved: * `address`: a standard cryptocurrency address (e.g., Bitcoin address). * `xpub`: an extended public key that can derive multiple addresses. * `descriptor`: a more flexible way to specify addresses using output descriptors. * `confirmed` (boolean; query; optional): filters the UTXOs based on their confirmation status; If set to `true`, only confirmed UTXOs will be returned. ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/utxo/bc1qxhmdufsvnuaaaer4ynz88fspdsxq2h9e9cetdj?confirmed=true ``` ##### Response example ```json [ { "txid": "c80f70c48aff883b060aed28544aec0fbdeb3db913a214d37194cee6337b0437", "vout": 1, "value": "319691557", "height": 854658, "confirmations": 3, "coinbase": true }, { "txid": "d6957ef0d3a8a13b369f4996f3a80182acc26445508f22ac50a4cea468663f06", "vout": 1, "value": "317092804", "height": 854649, "confirmations": 12, "coinbase": true }, { "txid": "9b11befa61b7e7bc7440fcb68213c6ecf2c19f50bfac4fc5a4bbe37dad138d0d", "vout": 1, "value": "319367244", "height": 854646, "confirmations": 15, "coinbase": true } ] ``` #### Get block > `GET /api/v2/block/` Returns information about block with transactions. Subject to pagination. ##### Parameters
* `block-height`|`block-hash` (path; required): specify the block height or the block hash to retrieve info for: * `block-height` (integer): the height (number) of the block in the blockchain. * `block-hash` (string): unique hash of the block. ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/block/854631 ``` ##### Response example ```json { "page": 1, "totalPages": 4, "itemsOnPage": 1000, "hash": "00000000000000000000b6770ffd8f9c1697e3d7f63ffe129c4f3a8f5eea0437", "previousBlockHash": "00000000000000000002b9e2f4f115c54505978fc8691053af32e51127b5b335", "nextBlockHash": "00000000000000000000225a7447063290267bf4ba2013b4bd53b1bc94c568d9", "height": 854631, "confirmations": 30, "size": 1615140, "time": 1722328595, "version": 735567872, "merkleRoot": "56b0dc81de0f00d81eb5ea566563deb15acb7b39ff79b46d14e34584d0431f1b", "nonce": "287725700", "bits": "17036e3a", "difficulty": "82047728459932.75", "txCount": 3988, "txs": [ { "txid": "9ebf046099d38fc97d9fbdb864fdbb1205871b2294bc6fd6eb187e13b42d41f7", "vin": [ { "n": 0, "isAddress": false, "value": "0" } ], "vout": [ { "value": "546", "n": 0, "addresses": [ "37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z" ], "isAddress": true }, { "value": "320584648", "n": 1, "addresses": [ "39C7fxSzEACPjM78Z7xdPxhf7mKxJwvfMJ" ], "isAddress": true }, { "value": "0", "n": 2, "addresses": [ "OP_RETURN aa21a9edb28074e5f34e138fd659c82217610fbe81159aff0fee8bdb15f619828811f4f8" ], "isAddress": false }, { "value": "0", "n": 3, "addresses": [ "OP_RETURN 434f5245012953559db5cc88ab20b1960faa9793803d0703374e3ecda72cb7961caa4b541b1e322bcfe0b5a030" ], "isAddress": false }, { "value": "0", "n": 4, "addresses": [ "OP_RETURN 52534b424c4f434b3aef4c3fbaf3d2e916c4159306ca07eb8d7ba33359c32684e291621c2700642f6a" ], "isAddress": false } ], "blockHash": "00000000000000000000b6770ffd8f9c1697e3d7f63ffe129c4f3a8f5eea0437", "blockHeight": 854631, "confirmations": 30, "blockTime": 1722328595, "vsize": 365, "value": "320585194", "valueIn": "0", "fees": "0" } ] } ``` _Note: Blockbook always follows the main chain of the backend it is attached to. If there is a rollback-reorg in the backend, Blockbook will also do rollback. When you ask for block by height, you will always get the main chain block. If you ask for block by hash, you may get the block from another fork, but it is not guaranteed (backend may not keep it)_ #### Send transaction > `GET /api/v2/sendtx/`
> `POST /api/v2/sendtx/` Broadcasts new transaction to the blockchain. ##### Parameters (GET request)
* `hex-tx-data` (path; string; required): the raw transaction data in hexadecimal format that you want to broadcast to the network. ##### Parameters (POST request)
* `hex-tx-data` (body; string; required): the raw transaction data in hexadecimal format that you want to broadcast to the network. ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/sendtx/{hex-tx-data} ``` ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/sendtx/ \ -H 'Content-Type: application/json' \ -d '{ "hex-tx-data": "your-raw-tx" }' ``` ##### Response example ```json { "result": "7c3be24063f268aaa1ed81b64776798f56088757641a34fb156c4f51ed2e9d25" } ``` ##### Response example (error) ```json { "error": { "message": "error message" } } ``` #### Tickers list > `GET /api/v2/tickers-list/` Returns a list of available currency rate tickers (secondary currencies) for the specified date, along with an actual data timestamp. ##### Parameters * `timestamp` (query; integer; optional): the Unix timestamp for which to retrieve the tickers for. ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/tickers-list/?timestamp=1625648394 ``` ##### Response example ```json { "ts": 1722346261, "available_currencies": [ "aed", "ars", "aud", "bdt", "bhd", "bmd", "brl", "btc", "cad" ] } ``` #### Tickers > `GET /api/v2/tickers/` Returns currency rate for the specified currency and date. If the currency is not available for that specific timestamp, the next closest rate will be returned. All responses contain an actual rate timestamp. ##### Parameters * `currency` (query; string; optional): specifies a currency of returned rate ("usd", "eur", "eth"...). If not specified, all available currencies will be returned. * `timestamp` (query; integer; optional): a Unix timestamp that specifies a date to return currency rates for. If not specified, the last available rate will be returned. ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/tickers/?currency=usd×tamp=1625648394 ``` ##### Response example ```json { "ts": 1722346380, "rates": { "usd": 66601 } } ``` ##### Response example (no params) ```json { "ts": 1722346500, "rates": { "aed": 244626, "ars": 62038176, "aud": 101909, "bdt": 7828348, "bhd": 25103, "bmd": 66601, "brl": 376127, "btc": 1 } } ``` ##### Response example (error) Rate unavailable, incorrect currency, etc. ```json { "ts":7980386400, "rates": { "usd": -1 } } ``` #### Balance history > `GET /api/v2/balancehistory/
` Returns a balance history for the specified xpub or address. ##### Parameters * `xpub|address` (path; string; required): the extended public key (XPUB) or the cryptocurrency address to retrieve the balance history for. * `from` (query; integer; optional): specifies a start date as a Unix timestamp. * `to` (query; integer; optional): specifies an end date as a Unix timestamp. * `fiatcurrency` (query; string; optional): if specified, the response will contain secondary (fiat) rate at the time of transaction. If not, all available currencies will be returned. * `groupBy` (query; integer; optional): an interval in seconds, to group results by. Default is 3600 seconds. ##### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/YOUR_ANKR_API_KEY/api/v2/balancehistory/39C7fxSzEACPjM78Z7xdPxhf7mKxJwvfMJ ``` ##### Response example ```json [ { "time": 1711350000, "txs": 1, "received": "100000", "sent": "0", "sentToSelf": "0", "rates": { "aed": 245674, "ars": 62306730, "aud": 102337 ... } }, { "time": 1711436400, "txs": 1, "received": "5000000000", "sent": "0", "sentToSelf": "0", "rates": { "aed": 245674, "ars": 62306730, "aud": 102337 ... } } ] ``` ##### Response example (`?fiatcurrency=usd`) ```json [ { "time": 1711350000, "txs": 1, "received": "100000", "sent": "0", "sentToSelf": "0", "rates": { "usd": 66563 } }, { "time": 1711436400, "txs": 1, "received": "5000000000", "sent": "0", "sentToSelf": "0", "rates": { "usd": 66563 } } ] ``` ##### Response example (`?fiatcurrency=usd&groupBy=172800`): ```json [ { "time": 1711238400, "txs": 1, "received": "100000", "sent": "0", "sentToSelf": "0", "rates": { "usd": 66563 } }, { "time": 1711411200, "txs": 33, "received": "30061271674", "sent": "5000000000", "sentToSelf": "4998996282", "rates": { "usd": 66563 } } ] ``` The value of `sentToSelf` is the amount sent from the same address to the same address or within addresses of xpub. --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/ title: Bitcoin — Blockchain RPCs (2/3) source: docs/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2.mdx --- # Bitcoin — Blockchain RPCs (2/3) > API reference for [Bitcoin](/rpc-service/chains/chains-api/btc/). [All methods ->](/rpc-service/chains/chains-api/btc/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/btc/blockchain-rpcs/) · 2 · [3](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p3/) ## Blockchain RPCs ### `getchaintxstats` > Computes statistics about the total number and rate of transactions in the chain. ```text getchaintxstats ( nblocks "blockhash" ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (numeric; optional; default=one month): size of the window in number of blocks * `` (string; optional; default=chain tip): the hash of the block that ends the window. #### Returns ```json { (json object) "time" : xxx, (numeric) The timestamp for the final block in the window, expressed in UNIX epoch time "txcount" : n, (numeric) The total number of transactions in the chain up to that point "window_final_block_hash" : "hex", (string) The hash of the final block in the window "window_final_block_height" : n, (numeric) The height of the final block in the window. "window_block_count" : n, (numeric) Size of the window in number of blocks "window_tx_count" : n, (numeric) The number of transactions in the window. Only returned if "window_block_count" is > 0 "window_interval" : n, (numeric) The elapsed time in the window in seconds. Only returned if "window_block_count" is > 0 "txrate" : n (numeric) The average rate of transactions per second in the window. Only returned if "window_interval" is > 0 } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getchaintxstats", "params": [2016] }' ``` #### Response example ```json { "result": { "time": 1715767659, "txcount": 1005147385, "window_final_block_hash": "00000000000000000001f0d113bbcef2c1f52882bf8044a7df5299d364216734", "window_final_block_height": 843553, "window_block_count": 2016, "window_tx_count": 7940938, "window_interval": 1269305, "txrate": 6.256130717203509 }, "error": null, "id": "test" } ``` --- ### `getdifficulty` > Returns the proof-of-work difficulty as a multiple of the minimum difficulty. ```text getdifficulty ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns The proof-of-work difficulty as a multiple of the minimum difficulty. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getdifficulty", "params": [] }' ``` #### Response example ```json { "result": 83148355189239.77, "error": null, "id": "test" } ``` --- ### `getmempoolancestors` > If txid is in the mempool, returns all in-mempool ancestors. ```text getmempoolancestors "txid" ( verbose ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the transaction id (must be in mempool). * `` (boolean; optional; default=false): `true` for a json object, `false` for array of transaction ids. #### Returns **Verbose=false**: ```json [ (json array) "hex", (string) The transaction id of an in-mempool ancestor transaction ... ] ``` **Verbose=true**: ```json { (json object) "transactionid" : { (json object) "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. "weight" : n, (numeric) transaction weight as defined in BIP 141. "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT "height" : n, (numeric) block height when transaction entered pool "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) "wtxid" : "hex", (string) hash of serialized transaction, including witness data "fees" : { (json object) "base" : n, (numeric) transaction fee in BTC "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC }, "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction "hex", (string) parent transaction id ... ], "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction "hex", (string) child transaction id ... ], "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) }, ... } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getmempoolancestors", "params": ["mytxid"] }' ``` --- ### `getmempooldescendants` > If txid is in the mempool, returns all in-mempool descendants. ```text getmempooldescendants "txid" ( verbose ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the transaction id (must be in mempool). * `` (boolean; optional; default=false): `true` for a json object, `false` for array of transaction ids. #### Returns **Verbose=false**: ```json [ (json array) "hex", (string) The transaction id of an in-mempool descendant transaction ... ] ``` **Verbose=true**: ```json { (json object) "transactionid" : { (json object) "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. "weight" : n, (numeric) transaction weight as defined in BIP 141. "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT "height" : n, (numeric) block height when transaction entered pool "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) "wtxid" : "hex", (string) hash of serialized transaction, including witness data "fees" : { (json object) "base" : n, (numeric) transaction fee in BTC "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC }, "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction "hex", (string) parent transaction id ... ], "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction "hex", (string) child transaction id ... ], "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) }, ... } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getmempooldescendants", "params": ["mytxid"] }' ``` --- ### `getmempoolentry` > Returns mempool data for given transaction. ```text getmempoolentry "txid" ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the transaction id (must be in mempool). #### Returns ```json { (json object) "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. "weight" : n, (numeric) transaction weight as defined in BIP 141. "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT "height" : n, (numeric) block height when transaction entered pool "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) "wtxid" : "hex", (string) hash of serialized transaction, including witness data "fees" : { (json object) "base" : n, (numeric) transaction fee in BTC "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC }, "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction "hex", (string) parent transaction id ... ], "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction "hex", (string) child transaction id ... ], "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getmempoolentry", "params": ["mytxid"] }' ``` --- ### `getmempoolinfo` > Returns the details on the active state of the TX memory pool. ```text getmempoolinfo ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns ```json { (json object) "loaded" : true|false, (boolean) True if the mempool is fully loaded "size" : n, (numeric) Current tx count "bytes" : n, (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted "usage" : n, (numeric) Total memory usage for the mempool "maxmempool" : n, (numeric) Maximum memory usage for the mempool "mempoolminfee" : n, (numeric) Minimum fee rate in BTC/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee "minrelaytxfee" : n, (numeric) Current minimum relay fee for transactions "unbroadcastcount" : n (numeric) Current number of transactions that haven't passed initial broadcast yet } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getmempoolinfo", "params": [] }' ``` #### Response example ```json { "result": { "loaded": true, "size": 57725, "bytes": 90167011, "usage": 294308080, "total_fee": 7.18859673, "maxmempool": 300000000, "mempoolminfee": 0.00004923, "minrelaytxfee": 0.00001, "incrementalrelayfee": 0.00001, "unbroadcastcount": 0, "fullrbf": false }, "error": null, "id": "test" } ``` --- ### `getrawmempool` > Returns all transaction ids in memory pool as a json array of string transaction ids. Hint: use `getmempoolentry` to fetch a specific transaction from the mempool. ```text getrawmempool ( verbose mempool_sequence ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (boolean; optional; default=false): `true` for a json object, `false` for array of transaction ids. * `` (boolean; optional; default=false): if verbose=false, returns a json object with transaction list and mempool sequence number attached. #### Returns **Verbose=false**: ```json [ (json array) "hex", (string) The transaction id ... ] ``` **Verbose=true**: ```json { (json object) "transactionid" : { (json object) "vsize" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted. "weight" : n, (numeric) transaction weight as defined in BIP 141. "fee" : n, (numeric) transaction fee in BTC (DEPRECATED) "modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED) "time" : xxx, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT "height" : n, (numeric) block height when transaction entered pool "descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one) "descendantsize" : n, (numeric) virtual transaction size of in-mempool descendants (including this one) "descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED) "ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one) "ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one) "ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED) "wtxid" : "hex", (string) hash of serialized transaction, including witness data "fees" : { (json object) "base" : n, (numeric) transaction fee in BTC "modified" : n, (numeric) transaction fee with fee deltas used for mining priority in BTC "ancestor" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in BTC "descendant" : n (numeric) modified fees (see above) of in-mempool descendants (including this one) in BTC }, "depends" : [ (json array) unconfirmed transactions used as inputs for this transaction "hex", (string) parent transaction id ... ], "spentby" : [ (json array) unconfirmed transactions spending outputs from this transaction "hex", (string) child transaction id ... ], "bip125-replaceable" : true|false, (boolean) Whether this transaction could be replaced due to BIP125 (replace-by-fee) "unbroadcast" : true|false (boolean) Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers) }, ... } ``` **verbose=false and mempool_sequence=true**: ```json { (json object) "txids" : [ (json array) "hex", (string) The transaction id ... ], "mempool_sequence" : n (numeric) The mempool sequence value. } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getrawmempool", "params": [] }' ``` #### Response example ```json { "result": [ "09448e71251330ff2fab39365284df31278eee4a5102556f674f32155d5eda5b", "703feebeac6110ec3ab941e6c2e6ef655dc303f77209a142864828e4bba7bfc9", "587af96d47e5ff6b9690ccba02fafb07473ed70a4528ec34ab5d7bcb1cef7c2e", "6557e364a70420a1c0d06bad1eaff11cf23ccce3714aa2f384dcc854211f69cc", "7e42415091463558478e17e62517faace89e14a88c430e0efb9b511739c6b31d", "9eda12a34bbf507265c21e8d6c59dbfc1a779f238db7c06e8e8160147f74cbef", "e44938eacb53f4e8a5e61a67cd3f840c02d26ff999349c523cf36761f711fcb4", "e3494ca0f7fea1e598a1ec090f2f50df989e6c7b36ed1815a67f4a5c1b9e441b", "7bf20128eb9904fdf4d5dd1a7fafe9d494c52304574a3fcd88c188a83a32086f", "ebaedb496434bbd6b218e2d5ea1cb6d948a30cabb8f41576c4f15c5e4ad34f9d", "75f614042e2bd67ac5ee19f425830333ae0381a706afa2b4d21c6f49745b6bff", "85a183e9e19630e77b65abbf4e50305b32d683626099f65c385f034a2e72cb75" ], "error": null, "id": "test" } ``` --- ### `gettxout` > Returns details about an unspent transaction output. ```text gettxout "txid" n ( include_mempool ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the transaction ID. * `` (numeric; required): vout number. * `` (boolean; optional; default=true): whether to include the mempool. Note that an unspent output that is spent in the mempool won’t appear. #### Returns ```json { (json object) "bestblock" : "hex", (string) The hash of the block at the tip of the chain "confirmations" : n, (numeric) The number of confirmations "value" : n, (numeric) The transaction value in BTC "scriptPubKey" : { (json object) "asm" : "hex", (string) "hex" : "hex", (string) "reqSigs" : n, (numeric) Number of required signatures "type" : "hex", (string) The type, eg pubkeyhash "addresses" : [ (json array) array of bitcoin addresses "str", (string) bitcoin address ... ] }, "coinbase" : true|false (boolean) Coinbase or not } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "gettxout", "params": ["txid", 1] }' ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/btc/blockchain-rpcs-p3/ title: Bitcoin — Blockchain RPCs (3/3) source: docs/rpc-service/chains/chains-api/btc/blockchain-rpcs-p3.mdx --- # Bitcoin — Blockchain RPCs (3/3) > API reference for [Bitcoin](/rpc-service/chains/chains-api/btc/). [All methods ->](/rpc-service/chains/chains-api/btc/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/btc/blockchain-rpcs/) · [2](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/) · 3 ## Blockchain RPCs ### `gettxoutproof` > Returns a hex-encoded proof that “txid” was included in a block. NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the `-txindex` command line option or specify the block in which the transaction is included manually (by blockhash). ```text gettxoutproof ["txid",...] ( "blockhash" ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (array of strings: required): the txids to filter. ```json [ "txid", (string) A transaction hash ... ] ``` * `` (string; optional): if specified, looks for txid in the block with this hash. #### Returns A string that is a serialized, hex-encoded data for the proof. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "gettxoutproof", "params": [["c7f32887779200fec23a0f4ebe73bed003f9ab8a46c2b549320c3c5cb78c7dc9"], "000000000000000000034e30310c8bf30133e41ae3ae189f987e509901409bf7"] ``` #### Response example ```json { "result": "008035222f854ca799cc749ca6d54a9ab85793b130a95348fe6e00000000000000000000badfdb8bab19d4ab1f08da2c98122c7d25586ba56b9c13cce8325eb42948fb8028a644669a62031723892528750d00000dc97d8cb75c3c0c3249b5c2468aabf903d0be73be4e0f3ac2fe0092778728f3c7096a1ace4290e6cfb9ab99245aee7fab74f6e6393ef47932d1b6cb494d60451780ecc5be308320b45fd9f07b6cffe1a6b7143ae9e2d134a4292dd937ff83d92b5a683483be79cabafd107330094c049ef166fad38a395b6bc4f58de82f0d5cbd479483b11d489ccb87e20cf97451419453495d1492e32bb9c0539c9a92885d7c2310ef802b85611f6340a7f99c36f04e769ab50bb00048791b16091870f817c503d46587bd48aa6bd895ea6ce9eb3fa06a86b432a40afbf27d879c09093ca03586284ac2b64b252b32be440a683beaf2f672efaf1cb36a429fa2a2cbe0800373a72857c1af218d71e4295ebeabdb80ca35b41f5d3a91c78a186fc76b01690d6f7a89a6912d4528a0072a5945f6a3f94b8fbc293964bdab3b9fb70ea0e7be6caa25f15f366a9473bbf55f69335b7dc642472efeb4feeaa0fafedf70c5a4f7dc370bddd972db84dd9fb5e82fced3cdef20bc98ae178fc8aedb8a2448652c6ce32cbe82d4859c7004d38db06d61b7b5014a89ad9160ec39adfb21b7a92d7f84525404ff1f0000", "error": null, "id": "test" } ``` --- ### `verifytxoutproof` > Verifies that a proof points to a transaction in a block. Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain. ```text verifytxoutproof "proof" ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hex-encoded proof generated by `gettxoutproof`. #### Returns ```json [ (json array) "hex", (string) The txid(s) which the proof commits to, or empty array if the proof can not be validated. ... ] ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "verifytxoutproof", "params": ["008035222f854ca799cc749ca6d54a9ab85793b130a95348fe6e00000000000000000000badfdb8bab19d4ab1f08da2c98122c7d25586ba56b9c13cce8325eb42948fb8028a644669a62031723892528750d00000dc97d8cb75c3c0c3249b5c2468aabf903d0be73be4e0f3ac2fe0092778728f3c7096a1ace4290e6cfb9ab99245aee7fab74f6e6393ef47932d1b6cb494d60451780ecc5be308320b45fd9f07b6cffe1a6b7143ae9e2d134a4292dd937ff83d92b5a683483be79cabafd107330094c049ef166fad38a395b6bc4f58de82f0d5cbd479483b11d489ccb87e20cf97451419453495d1492e32bb9c0539c9a92885d7c2310ef802b85611f6340a7f99c36f04e769ab50bb00048791b16091870f817c503d46587bd48aa6bd895ea6ce9eb3fa06a86b432a40afbf27d879c09093ca03586284ac2b64b252b32be440a683beaf2f672efaf1cb36a429fa2a2cbe0800373a72857c1af218d71e4295ebeabdb80ca35b41f5d3a91c78a186fc76b01690d6f7a89a6912d4528a0072a5945f6a3f94b8fbc293964bdab3b9fb70ea0e7be6caa25f15f366a9473bbf55f69335b7dc642472efeb4feeaa0fafedf70c5a4f7dc370bddd972db84dd9fb5e82fced3cdef20bc98ae178fc8aedb8a2448652c6ce32cbe82d4859c7004d38db06d61b7b5014a89ad9160ec39adfb21b7a92d7f84525404ff1f0000"] }' ``` #### Response example ```json { "result": [ "c7f32887779200fec23a0f4ebe73bed003f9ab8a46c2b549320c3c5cb78c7dc9" ], "error": null, "id": "test" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/btc/blockchain-rpcs/ title: Bitcoin — Blockchain RPCs (1/3) source: docs/rpc-service/chains/chains-api/btc/blockchain-rpcs.mdx --- # Bitcoin — Blockchain RPCs (1/3) > API reference for [Bitcoin](/rpc-service/chains/chains-api/btc/). [All methods ->](/rpc-service/chains/chains-api/btc/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/) · [3](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p3/) ## Blockchain RPCs ### `getbestblockhash` > Returns the hash of the best (tip) block in the most-work fully-validated chain. ```text getbestblockhash ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns The block hash, hex-encoded. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getbestblockhash", "params": [] }' ``` #### Response example ```json { "result": "00000000000000000001e4696901be3535c9f1cb3f3111caa57e809666021f46", "error": null, "id": "test" } ``` --- ### `getblock` > Retrieves info about a specific block given its block hash. If verbosity is 0, returns a string that is serialized, hex-encoded data for block ‘hash’.
If verbosity is 1, returns an Object with information about block ‘hash’.
If verbosity is 2, returns an Object with information about block ‘hash’ and information about each transaction. ```text getblock "blockhash" ( verbosity ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the block hash. * `` (numeric; optional; default=1): 0 for hex-encoded data, 1 for a json object, and 2 for json object with transaction data. #### Returns **Verbosity=0**: A string that is serialized, hex-encoded data for the block hash. **Verbosity=1**: ```json { (json object) "hash" : "hex", (string) the block hash (same as provided) "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain "size" : n, (numeric) The block size "strippedsize" : n, (numeric) The block size excluding witness data "weight" : n, (numeric) The block weight as defined in BIP 141 "height" : n, (numeric) The block height or index "version" : n, (numeric) The block version "versionHex" : "hex", (string) The block version formatted in hexadecimal "merkleroot" : "hex", (string) The merkle root "tx" : [ (json array) The transaction ids "hex", (string) The transaction id ... ], "time" : xxx, (numeric) The block time expressed in UNIX epoch time "mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time "nonce" : n, (numeric) The nonce "bits" : "hex", (string) The bits "difficulty" : n, (numeric) The difficulty "chainwork" : "hex", (string) Expected number of hashes required to produce the chain up to this block (in hex) "nTx" : n, (numeric) The number of transactions in the block "previousblockhash" : "hex", (string) The hash of the previous block "nextblockhash" : "hex" (string) The hash of the next block } ``` **Verbosity=2**: ```json { (json object) ..., Same output as verbosity = 1 "tx" : [ (json array) { (json object) ... The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result }, ... ] } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getblock", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' ``` #### Response example ```json { "result": { "hash": "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "confirmations": 842553, "height": 1000, "version": 1, "versionHex": "00000001", "merkleroot": "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33", "time": 1232346882, "mediantime": 1232344831, "nonce": 2595206198, "bits": "1d00ffff", "difficulty": 1, "chainwork": "000000000000000000000000000000000000000000000000000003e903e903e9", "nTx": 1, "previousblockhash": "0000000008e647742775a230787d66fdf92c46a48c896bfbc85cdc8acc67e87d", "nextblockhash": "00000000a2887344f8db859e372e7e4bc26b23b9de340f725afbf2edb265b4c6", "strippedsize": 216, "size": 216, "weight": 864, "tx": [ "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33" ] }, "error": null, "id": "test" } ``` --- ### `getblockchaininfo` > Returns an object containing various state info regarding blockchain processing. ```text getblockchaininfo ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns ```json { (json object) "chain" : "str", (string) current network name (main, test, regtest) "blocks" : n, (numeric) the height of the most-work fully-validated chain. The genesis block has height 0 "headers" : n, (numeric) the current number of headers we have validated "bestblockhash" : "str", (string) the hash of the currently best block "difficulty" : n, (numeric) the current difficulty "mediantime" : n, (numeric) median time for the current best block "verificationprogress" : n, (numeric) estimate of verification progress [0..1] "initialblockdownload" : true|false, (boolean) (debug information) estimate of whether this node is in Initial Block Download mode "chainwork" : "hex", (string) total amount of work in active chain, in hexadecimal "size_on_disk" : n, (numeric) the estimated size of the block and undo files on disk "pruned" : true|false, (boolean) if the blocks are subject to pruning "pruneheight" : n, (numeric) lowest-height complete block stored (only present if pruning is enabled) "automatic_pruning" : true|false, (boolean) whether automatic pruning is enabled (only present if pruning is enabled) "prune_target_size" : n, (numeric) the target size used by pruning (only present if automatic pruning is enabled) "softforks" : { (json object) status of softforks "xxxx" : { (json object) name of the softfork "type" : "str", (string) one of "buried", "bip9" "bip9" : { (json object) status of bip9 softforks (only for "bip9" type) "status" : "str", (string) one of "defined", "started", "locked_in", "active", "failed" "bit" : n, (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status) "start_time" : xxx, (numeric) the minimum median time past of a block at which the bit gains its meaning "timeout" : xxx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in "since" : n, (numeric) height of the first block to which the status applies "statistics" : { (json object) numeric statistics about BIP9 signalling for a softfork (only for "started" status) "period" : n, (numeric) the length in blocks of the BIP9 signalling period "threshold" : n, (numeric) the number of blocks with the version bit set required to activate the feature "elapsed" : n, (numeric) the number of blocks elapsed since the beginning of the current period "count" : n, (numeric) the number of blocks with the version bit set in the current period "possible" : true|false (boolean) returns false if there are not enough blocks left in this period to pass activation threshold } }, "height" : n, (numeric) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status) "active" : true|false (boolean) true if the rules are enforced for the mempool and the next block }, ... }, "warnings" : "str" (string) any network and blockchain warnings } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getblockchaininfo", "params": [] }' ``` #### Response example ```json { "result": { "chain": "main", "blocks": 843552, "headers": 843552, "bestblockhash": "00000000000000000000961750bb966af043f98ac0cc9a00c433ccc455204bac", "difficulty": 83148355189239.77, "time": 1715765116, "mediantime": 1715761540, "verificationprogress": 0.999989001722265, "initialblockdownload": false, "chainwork": "000000000000000000000000000000000000000079805bf222b2b5d07d76e90c", "size_on_disk": 649426145409, "pruned": false, "warnings": "" }, "error": null, "id": "test" } ``` --- ### `getblockcount` > Returns the height of the most-work fully-validated chain. The genesis block has height 0. ```text getblockcount ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns The current block count. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getblockcount", "params": [] }' ``` #### Response example ```json { "result": 843552, "error": null, "id": "test" } ``` --- ### `getblockfilter` > Retrieves a BIP 157 content filter for a particular block. ```text getblockfilter "blockhash" ( "filtertype" ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block. * `` (string; optional; default=basic): the type name of the filter. #### Returns ```json { (json object) "filter" : "hex", (string) the hex-encoded filter data "header" : "hex" (string) the hex-encoded filter header } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getblockfilter", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "basic"] }' ``` #### Response example ```json { "result": { "filter": "0163cb10", "header": "4a242283a406a7c089f671bb8df7671e5d5e9ba577cea1047d30a7f4919df193" }, "error": null, "id": "test" } ``` --- ### `getblockhash` > Returns hash of block in best-block-chain at height provided. ```text getblockhash height ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (numeric; required): the height index. #### Returns The hash of the block. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getblockhash", "params": [1000] }' ``` #### Response example ```json { "result": "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "error": null, "id": "test" } ``` --- ### `getblockheader` > Retrieves information about a specific block header If verbose is false, returns a string that is serialized, hex-encoded data for blockheader hash.
If verbose is true, returns an Object with information about blockheader hash. ```text getblockheader "blockhash" ( verbose ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the block hash. * `` (boolean; optional; default=true): `true` for a json object, `false` for the hex-encoded data. #### Returns **Verbose=true**: ```json { (json object) "hash" : "hex", (string) the block hash (same as provided) "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain "height" : n, (numeric) The block height or index "version" : n, (numeric) The block version "versionHex" : "hex", (string) The block version formatted in hexadecimal "merkleroot" : "hex", (string) The merkle root "time" : xxx, (numeric) The block time expressed in UNIX epoch time "mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time "nonce" : n, (numeric) The nonce "bits" : "hex", (string) The bits "difficulty" : n, (numeric) The difficulty "chainwork" : "hex", (string) Expected number of hashes required to produce the current chain "nTx" : n, (numeric) The number of transactions in the block "previousblockhash" : "hex", (string) The hash of the previous block "nextblockhash" : "hex" (string) The hash of the next block } ``` **Verbose=false**: A string that is serialized, hex-encoded data for block hash. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' ``` #### Response example ```json { "result": { "hash": "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", "confirmations": 842554, "height": 1000, "version": 1, "versionHex": "00000001", "merkleroot": "fe28050b93faea61fa88c4c630f0e1f0a1c24d0082dd0e10d369e13212128f33", "time": 1232346882, "mediantime": 1232344831, "nonce": 2595206198, "bits": "1d00ffff", "difficulty": 1, "chainwork": "000000000000000000000000000000000000000000000000000003e903e903e9", "nTx": 1, "previousblockhash": "0000000008e647742775a230787d66fdf92c46a48c896bfbc85cdc8acc67e87d", "nextblockhash": "00000000a2887344f8db859e372e7e4bc26b23b9de340f725afbf2edb265b4c6" }, "error": null, "id": "test" } ``` --- ### `getblockstats` > Computes per block statistics for a given window. All amounts are in satoshis. It won’t work for some heights with pruning. ```text getblockstats hash_or_height ( stats ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string/numeric; required): the block hash or height of the target block. * `` (json array; optional; default=all values): ```json [ "height", (string) Selected statistic "time", (string) Selected statistic ... ] ``` #### Returns ```json { (json object) "avgfee" : n, (numeric) Average fee in the block "avgfeerate" : n, (numeric) Average feerate (in satoshis per virtual byte) "avgtxsize" : n, (numeric) Average transaction size "blockhash" : "hex", (string) The block hash (to check for potential reorgs) "feerate_percentiles" : [ (json array) Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte) n, (numeric) The 10th percentile feerate n, (numeric) The 25th percentile feerate n, (numeric) The 50th percentile feerate n, (numeric) The 75th percentile feerate n (numeric) The 90th percentile feerate ], "height" : n, (numeric) The height of the block "ins" : n, (numeric) The number of inputs (excluding coinbase) "maxfee" : n, (numeric) Maximum fee in the block "maxfeerate" : n, (numeric) Maximum feerate (in satoshis per virtual byte) "maxtxsize" : n, (numeric) Maximum transaction size "medianfee" : n, (numeric) Truncated median fee in the block "mediantime" : n, (numeric) The block median time past "mediantxsize" : n, (numeric) Truncated median transaction size "minfee" : n, (numeric) Minimum fee in the block "minfeerate" : n, (numeric) Minimum feerate (in satoshis per virtual byte) "mintxsize" : n, (numeric) Minimum transaction size "outs" : n, (numeric) The number of outputs "subsidy" : n, (numeric) The block subsidy "swtotal_size" : n, (numeric) Total size of all segwit transactions "swtotal_weight" : n, (numeric) Total weight of all segwit transactions "swtxs" : n, (numeric) The number of segwit transactions "time" : n, (numeric) The block time "total_out" : n, (numeric) Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee]) "total_size" : n, (numeric) Total size of all non-coinbase transactions "total_weight" : n, (numeric) Total weight of all non-coinbase transactions "totalfee" : n, (numeric) The fee total "txs" : n, (numeric) The number of transactions (including coinbase) "utxo_increase" : n, (numeric) The increase/decrease in the number of unspent outputs "utxo_size_inc" : n (numeric) The increase/decrease in size for the utxo index (not discounting op_return and similar) } ``` #### Request example **Block hash param**: ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getblockstats", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", ["minfeerate","avgfeerate"]] }' ``` **Block height param**: ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getblockstats", "params": [1000, ["minfeerate","avgfeerate"]] }' ``` #### Response example ```json { "result": { "avgfeerate": 0, "minfeerate": 0 }, "error": null, "id": "test" } ``` --- ### `getchaintips` > Returns information about all known tips in the block tree. Return information about all known tips in the block tree, including the main chain as well as orphaned branches. ```text getchaintips ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns ```json [ (json array) { (json object) "height" : n, (numeric) height of the chain tip "hash" : "hex", (string) block hash of the tip "branchlen" : n, (numeric) zero for main chain, otherwise length of branch connecting the tip to the main chain "status" : "str" (string) status of the chain, "active" for the main chain Possible values for status: 1. "invalid" This branch contains at least one invalid block 2. "headers-only" Not all blocks for this branch are available, but the headers are valid 3. "valid-headers" All blocks are available for this branch, but they were never fully validated 4. "valid-fork" This branch is not part of the active chain, but is fully validated 5. "active" This is the tip of the active main chain, which is certainly valid }, ... ] ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getchaintips", "params": [] }' ``` #### Response example ```json { "result": [ { "height": 843553, "hash": "00000000000000000001f0d113bbcef2c1f52882bf8044a7df5299d364216734", "branchlen": 0, "status": "active" }, { "height": 829613, "hash": "0000000000000000000357088139cba6dc295875d7d3b2dd1fd764705727e451", "branchlen": 1, "status": "valid-fork" } ], "error": null, "id": "test" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/btc/ title: Bitcoin description: Bitcoin API provides the means for communication with the Bitcoin’s public ledger. Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/btc/index.mdx --- # Bitcoin
> Bitcoin API is available on [Web3 API platform](https://www.ankr.com/rpc/btc). *Bitcoin* API provides the means for communication with the Bitcoin’s public ledger. In order for your Web3 application to interact with Bitcoin — either by reading blockchain data or sending transactions to the network — it must connect to a Bitcoin node. Developers interact with the blockchain using the methods provided by the API. **Bitcoin interaction interfaces supported**: * [Bitcoin API native methods](/rpc-service/chains/chains-api/btc/#methods-supported) — [JSON-RPC](https://www.jsonrpc.org/specification). * [Blockbook API methods](/rpc-service/chains/chains-api/btc/#blockbook-api-methods) — indexed data via REST. --- ## Bitcoin native methods
**Blockchain RPCs**: * [`getbestblockhash`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getbestblockhash) — returns the hash of the best (tip) block in the most-work fully-validated chain. * [`getblock`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblock) — retrieves info about a specific block given its block hash. * [`getblockchaininfo`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockchaininfo) — returns an object containing various state info regarding blockchain processing. * [`getblockcount`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockcount) — returns the height of the most-work fully-validated chain. * [`getblockfilter`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockfilter) — retrieves a BIP 157 content filter for a particular block. * [`getblockhash`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockhash) — returns hash of block in best-block-chain at height provided. * [`getblockheader`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockheader) — retrieves information about a specific block header. * [`getblockstats`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockstats) — computes per block statistics for a given window. * [`getchaintips`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getchaintips) — returns information about all known tips in the block tree. * [`getchaintxstats`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getchaintxstats) — computes statistics about the total number and rate of transactions in the chain. * [`getdifficulty`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getdifficulty) — returns the proof-of-work difficulty as a multiple of the minimum difficulty. * [`getmempoolancestors`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getmempoolancestors) — if txid is in the mempool, returns all in-mempool ancestors. * [`getmempooldescendants`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getmempooldescendants) — if txid is in the mempool, returns all in-mempool descendants. * [`getmempoolentry`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getmempoolentry) — returns mempool data for given transaction. * [`getmempoolinfo`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getmempoolinfo) — returns details on the active state of the TX memory pool. * [`getrawmempool`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getrawmempool) — returns all transaction ids in memory pool as a json array of string transaction ids. * [`gettxout`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#gettxout) — returns details about an unspent transaction output. * [`gettxoutproof`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p3/#gettxoutproof) — returns a hex-encoded proof that “txid” was included in a block. * [`verifytxoutproof`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p3/#verifytxoutproof) — verifies that a proof points to a transaction in a block. **Raw transactions RPCs**: * [`analyzepsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#analyzepsbt) — analyzes and provides information about the current status of a PSBT and its inputs. * [`combinepsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#combinepsbt) — combines multiple partially signed Bitcoin transactions into one transaction. * [`combinerawtransaction`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#combinerawtransaction) — combines multiple partially signed transactions into one transaction. * [`converttopsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#converttopsbt) — converts a network serialized transaction to a PSBT. * [`createpsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#createpsbt) – creates a transaction in the Partially Signed Transaction format. * [`createrawtransaction`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#createrawtransaction) — creates a transaction spending the given inputs and creating new outputs. * [`decodepsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#decodepsbt) – returns a JSON object representing the serialized, base64-encoded partially signed Bitcoin transaction. * [`decoderawtransaction`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#decoderawtransaction) — returns a JSON object representing the serialized, hex-encoded transaction. * [`decodescript`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#decodescript) — decodes a hex-encoded script. * [`finalizepsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#finalizepsbt) — finalizes the inputs of a PSBT. * [`getrawtransaction`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#getrawtransaction) — returns the raw transaction data. * [`joinpsbts`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#joinpsbts) — joins multiple distinct PSBTs with different inputs and outputs into one PSBT. * [`sendrawtransaction`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#sendrawtransaction) — submits a raw transaction (serialized, hex-encoded) to local node and network. * [`testmempoolaccept`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#testmempoolaccept) — returns result of mempool acceptance tests. * [`utxoupdatepsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#utxoupdatepsbt) — updates all segwit inputs and outputs in a PSBT with data from output descriptors, the UTXO set, or the mempool. **Util RPCs**: * [`estimatesmartfee`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#estimatesmartfee) — estimates the approximate fee. * [`getindexinfo`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#getindexinfo) — returns the status of one or all available indices currently running in the node. * [`validateaddress`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#validateaddress) — returns information about the given bitcoin address. * [`verifymessage`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#verifymessage) — verifies a signed message. **Wallet RPCs**: The wallet RPCs are only available if Bitcoin Core was built with wallet support, which is the default. * [`getaddressinfo`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p3/#getaddressinfo) — returns information about the given Bitcoin address. --- ## Methods ### Blockchain RPCs - [`getbestblockhash`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getbestblockhash) - [`getblock`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblock) - [`getblockchaininfo`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockchaininfo) - [`getblockcount`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockcount) - [`getblockfilter`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockfilter) - [`getblockhash`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockhash) - [`getblockheader`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockheader) - [`getblockstats`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getblockstats) - [`getchaintips`](/rpc-service/chains/chains-api/btc/blockchain-rpcs/#getchaintips) - [`getchaintxstats`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getchaintxstats) - [`getdifficulty`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getdifficulty) - [`getmempoolancestors`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getmempoolancestors) - [`getmempooldescendants`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getmempooldescendants) - [`getmempoolentry`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getmempoolentry) - [`getmempoolinfo`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getmempoolinfo) - [`getrawmempool`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#getrawmempool) - [`gettxout`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p2/#gettxout) - [`gettxoutproof`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p3/#gettxoutproof) - [`verifytxoutproof`](/rpc-service/chains/chains-api/btc/blockchain-rpcs-p3/#verifytxoutproof) ### Raw transactions RPCs, Util RPCs, Wallet RPCs - [`analyzepsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#analyzepsbt) - [`combinepsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#combinepsbt) - [`combinerawtransaction`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#combinerawtransaction) - [`converttopsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#converttopsbt) - [`createpsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#createpsbt) - [`createrawtransaction`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#createrawtransaction) - [`decodepsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#decodepsbt) - [`decoderawtransaction`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/#decoderawtransaction) - [`decodescript`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#decodescript) - [`finalizepsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#finalizepsbt) - [`getrawtransaction`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#getrawtransaction) - [`joinpsbts`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#joinpsbts) - [`sendrawtransaction`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#sendrawtransaction) - [`testmempoolaccept`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#testmempoolaccept) - [`utxoupdatepsbt`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#utxoupdatepsbt) - [`estimatesmartfee`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#estimatesmartfee) - [`getindexinfo`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#getindexinfo) - [`validateaddress`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#validateaddress) - [`verifymessage`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/#verifymessage) - [`getaddressinfo`](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p3/#getaddressinfo) ### Blockbook API methods - [`Blockbook API v.2 REST`](/rpc-service/chains/chains-api/btc/blockbook-api-methods/#blockbook-api-v2-rest) - [`Blockbook API v.1 REST`](/rpc-service/chains/chains-api/btc/blockbook-api-methods-p2/#blockbook-api-v1-rest) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/ title: Bitcoin — Raw transactions RPCs, Util RPCs, Wallet RPCs (2/3) source: docs/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2.mdx --- # Bitcoin — Raw transactions RPCs, Util RPCs, Wallet RPCs (2/3) > API reference for [Bitcoin](/rpc-service/chains/chains-api/btc/). [All methods ->](/rpc-service/chains/chains-api/btc/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/) · 2 · [3](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p3/) ## Raw transactions RPCs ### `decodescript` > Decodes a hex-encoded script. ```text decodescript "hexstring" ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hex-encoded script. #### Returns ```json { (json object) "asm" : "str", (string) Script public key "type" : "str", (string) The output type (e.g. nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_unknown) "reqSigs" : n, (numeric) The required signatures "addresses" : [ (json array) "str", (string) bitcoin address ... ], "p2sh" : "str", (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH) "segwit" : { (json object) Result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH or witness) "asm" : "str", (string) String representation of the script public key "hex" : "hex", (string) Hex string of the script public key "type" : "str", (string) The type of the script public key (e.g. witness_v0_keyhash or witness_v0_scripthash) "reqSigs" : n, (numeric) The required signatures (always 1) "addresses" : [ (json array) (always length 1) "str", (string) segwit address ... ], "p2sh-segwit" : "str" (string) address of the P2SH script wrapping this witness redeem script } } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "decodescript", "params": ["76a91489abcdefabbaabbaabbaabbaabbaabbaabbaabba88ac"] }' ``` #### Response example ```json { "result": { "asm": "OP_DUP OP_HASH160 89abcdefabbaabbaabbaabbaabbaabbaabbaabba OP_EQUALVERIFY OP_CHECKSIG", "desc": "addr(1DYwPTpZuLjY2qApmJdHaSAuWRvEF5skCN)#kh26y3vv", "address": "1DYwPTpZuLjY2qApmJdHaSAuWRvEF5skCN", "type": "pubkeyhash", "p2sh": "3F6i6kwkevjR7AsAd4te2YB2zZyASEm1HM", "segwit": { "asm": "0 89abcdefabbaabbaabbaabbaabbaabbaabbaabba", "desc": "addr(bc1q3x4ummath24m42a64wa2hw4th24m42a6rul9r7)#fpmsztnh", "hex": "001489abcdefabbaabbaabbaabbaabbaabbaabbaabba", "address": "bc1q3x4ummath24m42a64wa2hw4th24m42a6rul9r7", "type": "witness_v0_keyhash", "p2sh-segwit": "37PDvpSnXXNRppuGZxa4CvqdfeNh9j6DtE" } }, "error": null, "id": "test" } ``` --- ### `finalizepsbt` > Finalizes the inputs of a PSBT. Finalize the inputs of a PSBT. If the transaction is fully signed, it will produce a network serialized transaction which can be broadcast with `sendrawtransaction`. Otherwise, a PSBT will be created which has the `final_scriptSig` and `final_scriptWitness` fields filled for inputs that are complete. Implements the Finalizer and Extractor roles. ```text finalizepsbt "psbt" ( extract ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): a base64 string of a PSBT. * `` (boolean; optional; default=true): `true` and the transaction is complete, extract and return the complete transaction in normal network serialization instead of the PSBT. #### Returns ```json { (json object) "psbt" : "str", (string) The base64-encoded partially signed transaction if not extracted "hex" : "hex", (string) The hex-encoded network transaction if extracted "complete" : true|false (boolean) If the transaction has a complete set of signatures } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "finalizepsbt", "params": ["cHNidP8BAFUCAAAAATK/5HXt1hQqK9Sy/NYfp/TPW/RZlM5LbV0v76TH56nhAAAAAAD9////AUBCDwAAAAAAGXapFGLpB7FcvyfVQlOZ6/bw+1DruI8YiKwAAAAAAAAA"] }' ``` #### Response example ```json { "result": { "psbt": "cHNidP8BAFUCAAAAATK/5HXt1hQqK9Sy/NYfp/TPW/RZlM5LbV0v76TH56nhAAAAAAD9////AUBCDwAAAAAAGXapFGLpB7FcvyfVQlOZ6/bw+1DruI8YiKwAAAAAAAAA", "complete": false }, "error": null, "id": "test" } ``` --- ### `getrawtransaction` > Returns the raw transaction data. ```text getrawtransaction "txid" ( verbose "blockhash" ) ``` By default, this function only works for mempool transactions. When called with a blockhash argument, `getrawtransaction` will return the transaction if the specified block is available and the transaction is found in that block. When called without a blockhash argument, `getrawtransaction` will return the transaction if it is in the mempool, or if `-txindex` is enabled and the transaction is in a block in the blockchain. Hint: Use `gettransaction` for wallet transactions. If verbose is `true`, returns an Object with information about `txid`.
If verbose is `false` or omitted, returns a string that is serialized, hex-encoded data for `txid`. #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the transaction ID. * `` (boolean; optional; default=false): if `false`, return a string, otherwise return a json object. * `` (string; optional): the block in which to look for the transaction. #### Returns **Verbose=false**: The serialized, hex-encoded data for `txid`. **Verbose=true**: ```json { (json object) "in_active_chain" : true|false, (boolean) Whether specified block is in the active chain or not (only present with explicit "blockhash" argument) "hex" : "hex", (string) The serialized, hex-encoded data for 'txid' "txid" : "hex", (string) The transaction id (same as provided) "hash" : "hex", (string) The transaction hash (differs from txid for witness transactions) "size" : n, (numeric) The serialized transaction size "vsize" : n, (numeric) The virtual transaction size (differs from size for witness transactions) "weight" : n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4) "version" : n, (numeric) The version "locktime" : xxx, (numeric) The lock time "vin" : [ (json array) { (json object) "txid" : "hex", (string) The transaction id "vout" : n, (numeric) The output number "scriptSig" : { (json object) The script "asm" : "str", (string) asm "hex" : "hex" (string) hex }, "sequence" : n, (numeric) The script sequence number "txinwitness" : [ (json array) "hex", (string) hex-encoded witness data (if any) ... ] }, ... ], "vout" : [ (json array) { (json object) "value" : n, (numeric) The value in BTC "n" : n, (numeric) index "scriptPubKey" : { (json object) "asm" : "str", (string) the asm "hex" : "str", (string) the hex "reqSigs" : n, (numeric) The required sigs "type" : "str", (string) The type, eg 'pubkeyhash' "addresses" : [ (json array) "str", (string) bitcoin address ... ] } }, ... ], "blockhash" : "hex", (string) the block hash "confirmations" : n, (numeric) The confirmations "blocktime" : xxx, (numeric) The block time expressed in UNIX epoch time "time" : n (numeric) Same as "blocktime" } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getrawtransaction", "params": ["c7f32887779200fec23a0f4ebe73bed003f9ab8a46c2b549320c3c5cb78c7dc9", false, "000000000000000000034e30310c8bf30133e41ae3ae189f987e509901409bf7"] }' ``` #### Response example ```json { "result": "010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff560327df0c194d696e656420627920416e74506f6f6c20d1001e027fbb47f4fabe6d6de0c279796c6962fedcf285c9d73b2db2bdbf613053c23bde86fbfd601dcb857f10000000000000000000a0a91100000000000000ffffffff05220200000000000017a91442402a28dd61f2718a4b27ae72a4791d5bbdade787e380d0130000000017a9145249bdf2c131d43995cff42e8feee293f79297a8870000000000000000266a24aa21a9edbec170280a56f035b0341dbbddd94bb6e7980831c83800833367122d7aa839dc00000000000000002f6a2d434f524501a37cf4faa0758b26dca666f3e36d42fa15cc01064e3ecda72cb7961caa4b541b1e322bcfe0b5a03000000000000000002b6a2952534b424c4f434b3a4a651ea38b372994e3ba5f22984412606c1f031ea133168998896e280060d9d20120000000000000000000000000000000000000000000000000000000000000000000000000", "error": null, "id": "test" } ``` --- ### `joinpsbts` > Joins multiple distinct PSBTs with different inputs and outputs into one PSBT. Joins multiple distinct PSBTs with different inputs and outputs into one PSBT with inputs and outputs from all of the PSBTs. No input in any of the PSBTs can be in more than one of the PSBTs. ```text joinpsbts ["psbt",...] ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (array of strings; required): the base64 strings of partially signed transactions. ```json [ "psbt", (string, required) A base64 string of a PSBT ... ] ``` #### Returns The base64-encoded partially signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "joinpsbts", "params": ["my-spbt1", "my-spbt2", "my-spbt3"] }' ``` --- ### `sendrawtransaction` > Submits a raw transaction (serialized, hex-encoded) to local node and network. Note that the transaction will be sent unconditionally to all peers, so using this for manual rebroadcast may degrade privacy by leaking the transaction’s origin, as nodes will normally not rebroadcast non-wallet transactions already in their mempool. Also see `createrawtransaction` and `signrawtransactionwithkey` calls. ```text sendrawtransaction "hexstring" ( maxfeerate ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hex string of the raw transaction. * `` (numeric/string; optional; default=0.10): rejects transactions whose fee rate is higher than the specified value, expressed in BTC/kB. Set to 0 to accept any fee rate. #### Returns The transaction hash in hex. #### Request example **Create a transaction**: ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "createrawtransaction", "params": [[{"txid":"b6f6991d5f1548f957aa29c2b9a11297ae303fa205a72880a4d7b77e1b9f7c7e","vout":0}], {"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa":0.01}] }' ``` **Sign the transaction, and get back the hex**: ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "signrawtransactionwithwallet", "params": ["0200000001b6f6991d5f1548f957aa29c2b9a11297ae303fa205a72880a4d7b77e1b9f7c7e0000000000ffffffff0100f2052a010000001976a91489abcdefabbaabbaabbaabbaabbaabbaabbaabba88ac00000000"] }' ``` **Send the transaction (signed hex)**: ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "sendrawtransaction", "params": ["0200000001b6f6991d5f1548f957aa29c2b9a11297ae303fa205a72880a4d7b77e1b9f7c7e010000006a47304402203b8e51e8ee7a9f23f7c7ea3a73a9b7d9fda7914f7f7d433c9a9e6efad0706e9f022073c405f2beed367d9 ``` --- ### `testmempoolaccept` > Returns result of mempool acceptance tests. Returns result of mempool acceptance tests indicating if raw transaction (serialized, hex-encoded) would be accepted by mempool. This checks if the transaction violates the consensus or policy rules. See `sendrawtransaction` call. ```text testmempoolaccept ["rawtx",...] ( maxfeerate ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (array of strings; required): an array of hex strings of raw transactions. ```json [ "rawtx", (string) ... ] ``` * `` (numeric/string; optional; default=0.10): rejects transactions whose fee rate is higher than the specified value, expressed in BTC/kB. #### Returns ```json [ (json array) The result of the mempool acceptance test for each raw transaction in the input array. Length is exactly one for now. { (json object) "txid" : "hex", (string) The transaction hash in hex "allowed" : true|false, (boolean) If the mempool allows this tx to be inserted "vsize" : n, (numeric) Virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted (only present when 'allowed' is true) "fees" : { (json object) Transaction fees (only present if 'allowed' is true) "base" : n (numeric) transaction fee in BTC }, "reject-reason" : "str" (string) Rejection string (only present when 'allowed' is false) }, ... ] ``` #### Request example **Create a transaction**: ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "createrawtransaction", "params": [[{"txid":"b6f6991d5f1548f957aa29c2b9a11297ae303fa205a72880a4d7b77e1b9f7c7e","vout":0}], {"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa":0.01}] }' ``` **Sign the transaction, and get back the hex**: ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "signrawtransactionwithwallet", "params": ["0200000001b6f6991d5f1548f957aa29c2b9a11297ae303fa205a72880a4d7b77e1b9f7c7e0000000000ffffffff0100f2052a010000001976a91489abcdefabbaabbaabbaabbaabbaabbaabbaabba88ac00000000"] }' ``` **Test acceptance of the transaction (signed hex)**: ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "testmempoolaccept", "params": [["0200000001b6f6991d5f1548f957aa29c2b9a11297ae303fa205a72880a4d7b77e1b9f7c7e010000006a47304402203b8e51e8ee7a9f23f7c7ea3a73a9b7d9fda7914f7f7d433c9a9e6efad0706e9f022073c405f2beed367d9f7ee5e8e6a4e5e5c595cf1fa2b3b5dc74db9b2a36d4e7ec012102f3b5c0e7322d3e72d40c7f6b3fd8b1ab3141574a63eefa9a098c4b0be1dbb5e4ffffffff0100f2052a010000001976a91489abcdefabbaabbaabbaabbaabbaabbaabbaabba88ac00000000"]] }' ``` #### Reponse example ```json { "result": [ { "txid": "077e6ae456a9d84b4bc85aa782121e8b725031178595326d4df078927a66e998", "wtxid": "077e6ae456a9d84b4bc85aa782121e8b725031178595326d4df078927a66e998", "allowed": false, "reject-reason": "missing-inputs" } ], "error": null, "id": "test" } ``` --- ### `utxoupdatepsbt` > Updates all segwit inputs and outputs in a PSBT with data from output descriptors, the UTXO set, or the mempool. ```text utxoupdatepsbt "psbt" ( ["",{"desc":"str","range":n or [n,n]},...] ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): a base64 string of a PSBT. * `` (array; optional): an array of either strings or objects. ```json [ "", (string) An output descriptor { (json object) An object with an output descriptor and extra information "desc": "str", (string, required) An output descriptor "range": n or [n,n], (numeric or array, optional, default=1000) Up to what index HD chains should be explored (either end or [begin,end]) }, ... ] ``` #### Returns The base64-encoded partially signed transaction with inputs updated. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "utxoupdatepsbt", "params": ["cHNidP8BAFUCAAAAATK/5HXt1hQqK9Sy/NYfp/TPW/RZlM5LbV0v76TH56nhAAAAAAD9////AUBCDwAAAAAAGXapFGLpB7FcvyfVQlOZ6/bw+1DruI8YiKwAAAAAAAAA"] }' ``` #### Response example ```json { "result": "cHNidP8BAFUCAAAAATK/5HXt1hQqK9Sy/NYfp/TPW/RZlM5LbV0v76TH56nhAAAAAAD9////AUBCDwAAAAAAGXapFGLpB7FcvyfVQlOZ6/bw+1DruI8YiKwAAAAAAAAA", "error": null, "id": "test" } ``` --- ## Util RPCs ### `estimatesmartfee` > Estimates the approximate fee. Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks if possible and return the number of blocks for which the estimate is valid. Uses virtual transaction size as defined in BIP 141 (witness data is discounted). ```text estimatesmartfee conf_target ( "estimate_mode" ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (numeric; required): confirmation target in blocks (1 - 1008). * `` (string; optional; default=CONSERVATIVE): the fee estimate mode. Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market. Must be one of: “UNSET” “ECONOMICAL” “CONSERVATIVE”. #### Returns ```json { (json object) "feerate" : n, (numeric, optional) estimate fee rate in BTC/kB (only present if no errors were encountered) "errors" : [ (json array, optional) Errors encountered during processing (if there are any) "str", (string) error ... ], "blocks" : n (numeric) block number where estimate was found The request target will be clamped between 2 and the highest target fee estimation is able to return based on how long it has been running. An error is returned if not enough transactions and blocks have been observed to make an estimate for any number of blocks. } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "estimatesmartfee", "params": [6] }' ``` #### Response example ```json { "result": { "feerate": 0.00012296, "blocks": 6 }, "error": null, "id": "test" } ``` --- ### `getindexinfo` > Returns the status of one or all available indices currently running in the node. ```text getindexinfo ( "index_name" ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; optional): filters results for an index with a specific name. #### Returns ```json { (json object) "name" : { (json object) The name of the index "synced" : true|false, (boolean) Whether the index is synced or not "best_block_height" : n (numeric) The block height to which the index is synced } } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getindexinfo", "params": ["txindex"] }' ``` --- ### `validateaddress` > Returns information about the given bitcoin address. ```text validateaddress "address" ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `
` (string; required): the Bitcoin address to validate. #### Returns ```json { (json object) "isvalid" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned. "address" : "str", (string) The bitcoin address validated "scriptPubKey" : "hex", (string) The hex-encoded scriptPubKey generated by the address "isscript" : true|false, (boolean) If the key is a script "iswitness" : true|false, (boolean) If the address is a witness address "witness_version" : n, (numeric, optional) The version number of the witness program "witness_program" : "hex" (string, optional) The hex value of the witness program } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "validateaddress", "params": ["bc1qw4e2dl3pfw6nzxrzpghrtnpx7y8kyj7vg09qlh"] }' ``` #### Response example ```json { "result": { "isvalid": false, "error_locations": [ 35, 36 ], "error": "Invalid Bech32 checksum" }, "error": null, "id": "test" } ``` --- ### `verifymessage` > Verifies a signed message. ```text verifymessage "address" "signature" "message" ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `
` (string; required): the Bitcoin address to use for the signature. * `` (string; required): the signature provided by the signer in base 64 encoding (see `signmessage`). * `` (string; required): the message that was signed. #### Returns If the signature is verified or not. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "verifymessage", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX", "signature", "my message"] }' ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p3/ title: Bitcoin — Raw transactions RPCs, Util RPCs, Wallet RPCs (3/3) source: docs/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p3.mdx --- # Bitcoin — Raw transactions RPCs, Util RPCs, Wallet RPCs (3/3) > API reference for [Bitcoin](/rpc-service/chains/chains-api/btc/). [All methods ->](/rpc-service/chains/chains-api/btc/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/) · [2](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/) · 3 ## Wallet RPCs The wallet RPCs are only available if Bitcoin Core was built with wallet support, which is the default. ### `getaddressinfo` > Returns information about the given Bitcoin address. Some information will only be present if the address is in the active wallet. ```text getaddressinfo "address" ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `
` (string; required): the Bitcoin address for which to get information. #### Returns ```json { (json object) "address" : "str", (string) The bitcoin address validated. "scriptPubKey" : "hex", (string) The hex-encoded scriptPubKey generated by the address. "ismine" : true|false, (boolean) If the address is yours. "iswatchonly" : true|false, (boolean) If the address is watchonly. "solvable" : true|false, (boolean) If we know how to spend coins sent to this address, ignoring the possible lack of private keys. "desc" : "str", (string, optional) A descriptor for spending coins sent to this address (only when solvable). "isscript" : true|false, (boolean) If the key is a script. "ischange" : true|false, (boolean) If the address was used for change output. "iswitness" : true|false, (boolean) If the address is a witness address. "witness_version" : n, (numeric, optional) The version number of the witness program. "witness_program" : "hex", (string, optional) The hex value of the witness program. "script" : "str", (string, optional) The output script type. Only if isscript is true and the redeemscript is known. Possible types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash, witness_v0_scripthash, witness_unknown. "hex" : "hex", (string, optional) The redeemscript for the p2sh address. "pubkeys" : [ (json array, optional) Array of pubkeys associated with the known redeemscript (only if script is multisig). "str", (string) ... ], "sigsrequired" : n, (numeric, optional) The number of signatures required to spend multisig output (only if script is multisig). "pubkey" : "hex", (string, optional) The hex value of the raw public key for single-key addresses (possibly embedded in P2SH or P2WSH). "embedded" : { (json object, optional) Information about the address embedded in P2SH or P2WSH, if relevant and known. ... Includes all getaddressinfo output fields for the embedded address, excluding metadata (timestamp, hdkeypath, hdseedid) and relation to the wallet (ismine, iswatchonly). }, "iscompressed" : true|false, (boolean, optional) If the pubkey is compressed. "timestamp" : xxx, (numeric, optional) The creation time of the key, if available, expressed in UNIX epoch time. "hdkeypath" : "str", (string, optional) The HD keypath, if the key is HD and available. "hdseedid" : "hex", (string, optional) The Hash160 of the HD seed. "hdmasterfingerprint" : "hex", (string, optional) The fingerprint of the master key. "labels" : [ (json array) Array of labels associated with the address. Currently limited to one label but returned as an array to keep the API stable if multiple labels are enabled in the future. "str", (string) Label name (defaults to ""). ... ] } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "getaddressinfo", "params": ["bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl"] }' ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/btc/raw-transactions-rpcs/ title: Bitcoin — Raw transactions RPCs, Util RPCs, Wallet RPCs (1/3) source: docs/rpc-service/chains/chains-api/btc/raw-transactions-rpcs.mdx --- # Bitcoin — Raw transactions RPCs, Util RPCs, Wallet RPCs (1/3) > API reference for [Bitcoin](/rpc-service/chains/chains-api/btc/). [All methods ->](/rpc-service/chains/chains-api/btc/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p2/) · [3](/rpc-service/chains/chains-api/btc/raw-transactions-rpcs-p3/) ## Raw transactions RPCs ### `analyzepsbt` > Analyzes and provides information about the current status of a PSBT and its inputs. ```text analyzepsbt "psbt" ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): a base64 string of a PSBT. #### Returns ```json { (json object) "inputs" : [ (json array) { (json object) "has_utxo" : true|false, (boolean) Whether a UTXO is provided "is_final" : true|false, (boolean) Whether the input is finalized "missing" : { (json object, optional) Things that are missing that are required to complete this input "pubkeys" : [ (json array, optional) "hex", (string) Public key ID, hash160 of the public key, of a public key whose BIP 32 derivation path is missing ... ], "signatures" : [ (json array, optional) "hex", (string) Public key ID, hash160 of the public key, of a public key whose signature is missing ... ], "redeemscript" : "hex", (string, optional) Hash160 of the redeemScript that is missing "witnessscript" : "hex" (string, optional) SHA256 of the witnessScript that is missing }, "next" : "str" (string, optional) Role of the next person that this input needs to go to }, ... ], "estimated_vsize" : n, (numeric, optional) Estimated vsize of the final signed transaction "estimated_feerate" : n, (numeric, optional) Estimated feerate of the final signed transaction in BTC/kB. Shown only if all UTXO slots in the PSBT have been filled "fee" : n, (numeric, optional) The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled "next" : "str", (string) Role of the next person that this psbt needs to go to "error" : "str" (string, optional) Error message (if there is one) } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "analyzepsbt", "params": ["cHNidP8BAFUCAAAAATK/5HXt1hQqK9Sy/NYfp/TPW/RZlM5LbV0v76TH56nhAAAAAAD9////AUBCDwAAAAAAGXapFGLpB7FcvyfVQlOZ6/bw+1DruI8YiKwAAAAAAAAA"] }' ``` #### Response example ```json { "result": { "inputs": [ { "has_utxo": false, "is_final": false, "next": "updater" } ], "next": "updater" }, "error": null, "id": "test" } ``` --- ### `combinepsbt` > Combines multiple partially signed Bitcoin transactions into one transaction. Implements the Combiner role. ```text combinepsbt ["psbt",...] ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (array of strings; required): the base64 strings of partially signed transactions. ```json [ "psbt", (string) A base64 string of a PSBT ... ] ``` #### Returns The base64-encoded partially signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "combinepsbt", "params": ["mybase64_1", "mybase64_2", "mybase64_3"] }' ``` --- ### `combinerawtransaction` > Combines multiple partially signed transactions into one transaction. The combined transaction may be another partially signed transaction or a fully signed transaction. ```text combinerawtransaction ["hexstring",...] ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (array of strings; required): the hex strings of partially signed transactions. ```json [ "hexstring", (string) A hex-encoded raw transaction ... ] ``` #### Returns The hex-encoded raw transaction with signatures. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "combinerawtransaction", "params": ["mybase64_1", "mybase64_2", "mybase64_3"] }' ``` --- ### `converttopsbt` > Converts a network serialized transaction to a PSBT. This should be used only with `createrawtransaction` and `fundrawtransaction`. `createpsbt` and `walletcreatefundedpsbt` should be used for new applications. ```text converttopsbt "hexstring" ( permitsigdata iswitness ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hex string of a raw transaction. * `` (boolean; optional; default=false): if `true`, any signatures in the input will be discarded and conversion will continue. If `false`, RPC will fail if any signatures are present. * `` (boolean; optional; default=depends on heuristic tests): whether the transaction hex is a serialized witness transaction. If `iswitness` is not present, heuristic tests will be used in decoding. If true, only witness deserialization will be tried. If false, only non-witness deserialization will be tried. This boolean should reflect whether the transaction has inputs (e.g. fully valid, or on-chain transactions), if known by the caller. #### Returns The resulting raw transaction (base64-encoded string). #### Request example **Create a transaction**: ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "createrawtransaction", "params": [[{"txid":"myid","vout":0}],[{"address":0.01}]] }' ``` **Convert the transaction to PSBT**: ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "converttopsbt", "params": ["020000000132bfe475edd6142a2bd4b2fcd61fa7f4cf5bf45994ce4b6d5d2fefa4c7e7a9e10000000000fdffffff0140420f00000000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac00000000"] }' ``` #### Response example ```json { "result": "cHNidP8BAFUCAAAAATK/5HXt1hQqK9Sy/NYfp/TPW/RZlM5LbV0v76TH56nhAAAAAAD9////AUBCDwAAAAAAGXapFGLpB7FcvyfVQlOZ6/bw+1DruI8YiKwAAAAAAAAA", "error": null, "id": "test" } ``` --- ### `createpsbt` > Creates a transaction in the Partially Signed Transaction format. Implements the Creator role. ```text createpsbt [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime replaceable ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (json array; required): the json objects. ```json [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "sequence": n, (numeric, optional, default=depends on the value of the 'replaceable' and 'locktime' arguments) The sequence number }, ... ] ``` * `` (json array; required): the outputs (key-value pairs), where none of the keys are duplicated. That is, each address can only appear once and there can only be one ‘data’ object. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter. ```json [ { (json object) "address": amount, (numeric or string, required) A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BTC }, { (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data }, ... ] ``` * `` (numeric; optional; default=0): raw locktime. Non-0 value also locktime-activates inputs. * `` (boolean; optional; default=false): marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible. #### Returns The resulting raw transaction (base64-encoded string). #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "createpsbt", "params": [[{"txid":"e1a9e7c7a4ef2f5d6d4bce9459f45bcff4a71fd6fcb2d42b2a14d6ed75e4bf32","vout":0}],[{"data":"00010203"}]] }' ``` #### Response example ```json { "result": "cHNidP8BAEICAAAAATK/5HXt1hQqK9Sy/NYfp/TPW/RZlM5LbV0v76TH56nhAAAAAAD9////AQAAAAAAAAAABmoEAAECAwAAAAAAAAA=", "error": null, "id": "test" } ``` --- ### `createrawtransaction` > Creates a transaction spending the given inputs and creating new outputs. Outputs can be addresses or data.
Returns hex-encoded raw transaction.
Note that the transaction’s inputs are not signed, and it is not stored in the wallet or transmitted to the network. ```text createrawtransaction [{"txid":"hex","vout":n,"sequence":n},...] [{"address":amount},{"data":"hex"},...] ( locktime replaceable ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (json array; required): the inputs. ```json [ { (json object) "txid": "hex", (string, required) The transaction id "vout": n, (numeric, required) The output number "sequence": n, (numeric, optional, default=depends on the value of the 'replaceable' and 'locktime' arguments) The sequence number }, ... ] ``` * `` (json array; required): the outputs (key-value pairs), where none of the keys are duplicated. That is, each address can only appear once and there can only be one ‘data’ object. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter. ```json [ { (json object) "address": amount, (numeric or string, required) A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in BTC }, { (json object) "data": "hex", (string, required) A key-value pair. The key must be "data", the value is hex-encoded data }, ... ] ``` * `` (numeric; optional; default=0): raw locktime. Non-0 value also locktime-activates inputs. * `` (boolean; optional; default=false): marks this transaction as BIP125-replaceable. Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible. #### Returns A hex string of the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "hww", "method": "createrawtransaction", "params": [[{"txid":"e1a9e7c7a4ef2f5d6d4bce9459f45bcff4a71fd6fcb2d42b2a14d6ed75e4bf32","vout":0}], [{"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa":0.01}]] }' ``` #### Response example ```json { "result": "020000000132bfe475edd6142a2bd4b2fcd61fa7f4cf5bf45994ce4b6d5d2fefa4c7e7a9e10000000000fdffffff0140420f00000000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac00000000", "error": null, "id": "hww" } ``` --- ### `decodepsbt` > Returns a JSON object representing the serialized, base64-encoded partially signed Bitcoin transaction. ```text decodepsbt "psbt" ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the PSBT base64 string. #### Returns ```json { (json object) "tx" : { (json object) The decoded network-serialized unsigned transaction. ... The layout is the same as the output of decoderawtransaction. }, "unknown" : { (json object) The unknown global fields "key" : "hex", (string) (key-value pair) An unknown key-value pair ... }, "inputs" : [ (json array) { (json object) "non_witness_utxo" : { (json object, optional) Decoded network transaction for non-witness UTXOs ... }, "witness_utxo" : { (json object, optional) Transaction output for witness UTXOs "amount" : n, (numeric) The value in BTC "scriptPubKey" : { (json object) "asm" : "str", (string) The asm "hex" : "hex", (string) The hex "type" : "str", (string) The type, eg 'pubkeyhash' "address" : "str" (string) Bitcoin address if there is one } }, "partial_signatures" : { (json object, optional) "pubkey" : "str", (string) The public key and signature that corresponds to it. ... }, "sighash" : "str", (string, optional) The sighash type to be used "redeem_script" : { (json object, optional) "asm" : "str", (string) The asm "hex" : "hex", (string) The hex "type" : "str" (string) The type, eg 'pubkeyhash' }, "witness_script" : { (json object, optional) "asm" : "str", (string) The asm "hex" : "hex", (string) The hex "type" : "str" (string) The type, eg 'pubkeyhash' }, "bip32_derivs" : [ (json array, optional) { (json object, optional) The public key with the derivation path as the value. "master_fingerprint" : "str", (string) The fingerprint of the master key "path" : "str" (string) The path }, ... ], "final_scriptsig" : { (json object, optional) "asm" : "str", (string) The asm "hex" : "str" (string) The hex }, "final_scriptwitness" : [ (json array) "hex", (string) hex-encoded witness data (if any) ... ], "unknown" : { (json object) The unknown global fields "key" : "hex", (string) (key-value pair) An unknown key-value pair ... } }, ... ], "outputs" : [ (json array) { (json object) "redeem_script" : { (json object, optional) "asm" : "str", (string) The asm "hex" : "hex", (string) The hex "type" : "str" (string) The type, eg 'pubkeyhash' }, "witness_script" : { (json object, optional) "asm" : "str", (string) The asm "hex" : "hex", (string) The hex "type" : "str" (string) The type, eg 'pubkeyhash' }, "bip32_derivs" : [ (json array, optional) { (json object) "pubkey" : "str", (string) The public key this path corresponds to "master_fingerprint" : "str", (string) The fingerprint of the master key "path" : "str" (string) The path }, ... ], "unknown" : { (json object) The unknown global fields "key" : "hex", (string) (key-value pair) An unknown key-value pair ... } }, ... ], "fee" : n (numeric, optional) The transaction fee paid if all UTXOs slots in the PSBT have been filled. } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "decodepsbt", "params": ["cHNidP8BAEICAAAAATK/5HXt1hQqK9Sy/NYfp/TPW/RZlM5LbV0v76TH56nhAAAAAAD9////AQAAAAAAAAAABmoEAAECAwAAAAAAAAA="] }' ``` #### Response example ```json { "result": { "tx": { "txid": "ad0f4833625ac33a57251e4c7d43fa29ed6f0b4b0276beed9977b6f84bfe58b4", "hash": "ad0f4833625ac33a57251e4c7d43fa29ed6f0b4b0276beed9977b6f84bfe58b4", "version": 2, "size": 66, "vsize": 66, "weight": 264, "locktime": 0, "vin": [ { "txid": "e1a9e7c7a4ef2f5d6d4bce9459f45bcff4a71fd6fcb2d42b2a14d6ed75e4bf32", "vout": 0, "scriptSig": { "asm": "", "hex": "" }, "sequence": 4294967293 } ], "vout": [ { "value": 0, "n": 0, "scriptPubKey": { "asm": "OP_RETURN 50462976", "desc": "raw(6a0400010203)#6scht25q", "hex": "6a0400010203", "type": "nulldata" } } ] }, "global_xpubs": [], "psbt_version": 0, "proprietary": [], "unknown": {}, "inputs": [ {} ], "outputs": [ {} ] }, "error": null, "id": "test" } ``` --- ### `decoderawtransaction` > Returns a JSON object representing the serialized, hex-encoded transaction. ```text decoderawtransaction "hexstring" ( iswitness ) ``` #### Parameters
* `id` (string; required): a request ID (example: test). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the transaction hex string. * `` (boolean; optional; default=depends on heuristic tests): whether the transaction hex is a serialized witness transaction. If `iswitness` is not present, heuristic tests will be used in decoding. If true, only witness deserialization will be tried. If false, only non-witness deserialization will be tried. This boolean should reflect whether the transaction has inputs (e.g. fully valid, or on-chain transactions), if known by the caller. #### Returns ```json { (json object) "txid" : "hex", (string) The transaction id "hash" : "hex", (string) The transaction hash (differs from txid for witness transactions) "size" : n, (numeric) The transaction size "vsize" : n, (numeric) The virtual transaction size (differs from size for witness transactions) "weight" : n, (numeric) The transaction's weight (between vsize*4 - 3 and vsize*4) "version" : n, (numeric) The version "locktime" : xxx, (numeric) The lock time "vin" : [ (json array) { (json object) "txid" : "hex", (string) The transaction id "vout" : n, (numeric) The output number "scriptSig" : { (json object) The script "asm" : "str", (string) asm "hex" : "hex" (string) hex }, "txinwitness" : [ (json array) "hex", (string) hex-encoded witness data (if any) ... ], "sequence" : n (numeric) The script sequence number }, ... ], "vout" : [ (json array) { (json object) "value" : n, (numeric) The value in BTC "n" : n, (numeric) index "scriptPubKey" : { (json object) "asm" : "str", (string) the asm "hex" : "hex", (string) the hex "reqSigs" : n, (numeric) The required sigs "type" : "str", (string) The type, eg 'pubkeyhash' "addresses" : [ (json array) "str", (string) bitcoin address ... ] } }, ... ] } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/YOUR_ANKR_API_KEY \ -d '{ "id": "test", "method": "decoderawtransaction", "params": ["02000000017e7c9f1b7eb7d7a48028a705a23f30ae9712a1b9c229aa57f948155f1d99f6b60000000000fdffffff0140420f00000000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac00000000"] }' ``` #### Response example ```json { "result": { "txid": "af71499460ee644f623f51d023dc837f3e2ae5dd6995ab872931fdb0cff2c2ee", "hash": "af71499460ee644f623f51d023dc837f3e2ae5dd6995ab872931fdb0cff2c2ee", "version": 2, "size": 85, "vsize": 85, "weight": 340, "locktime": 0, "vin": [ { "txid": "b6f6991d5f1548f957aa29c2b9a11297ae303fa205a72880a4d7b77e1b9f7c7e", "vout": 0, "scriptSig": { "asm": "", "hex": "" }, "sequence": 4294967293 } ], "vout": [ { "value": 0.01, "n": 0, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 62e907b15cbf27d5425399ebf6f0fb50ebb88f18 OP_EQUALVERIFY OP_CHECKSIG", "desc": "addr(1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa)#632p52jr", "hex": "76a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac", "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "type": "pubkeyhash" } } ] }, "error": null, "id": "test" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/celo/ title: Celo description: Celo is a mobile-first blockchain designed to make decentralized financial (DeFi) tools and services accessible… 24 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/celo/index.mdx --- # Celo
> Celo API is available on [Web3 API platform](https://www.ankr.com/rpc/celo). *Celo* is a mobile-first blockchain designed to make decentralized financial (DeFi) tools and services accessible to anyone with a mobile phone. Celo is a layer 1 protocol and blockchain platform. The Celo Mainnet is entirely separate from the Ethereum network. The Celo client originated as a fork of Ethereum Go language client, [go-ethereum](https://github.com/ethereum/go-ethereum) (or geth). Celo has several significant differences, including a proof-of-stake based PBFT consensus mechanism. All the cryptoassets on Celo have ERC-20 compliant interfaces, meaning that while they are not ERC-20 tokens on the Ethereum Mainnet, all familiar tooling and code that support ERC-20 tokens can be easily adapted for Celo assets, including the Celo Native Asset (CELO) and the Celo Dollar (cUSD). In order for your Web3 application to interact with Celo — either by reading blockchain data or sending transactions to the network — it must connect to a Celo node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/celo/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/celo/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/celo/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/celo/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/celo/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/celo/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/celo/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/celo/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/celo/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/celo/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/celo/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/celo/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/celo/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getCode`](/rpc-service/chains/chains-api/celo/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/celo/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/celo/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/celo/web3/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getLogs`](/rpc-service/chains/chains-api/celo/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/celo/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/celo/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/celo/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/celo/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/celo/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/celo/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/celo/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/celo/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/celo/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/celo/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/celo/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/celo/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/celo/web3/#eth_getblocktransactioncountbynumber) - [`eth_getCode`](/rpc-service/chains/chains-api/celo/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/celo/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/celo/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/celo/web3/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/celo/web3-p2/#eth_gettransactionreceipt) - [`eth_getLogs`](/rpc-service/chains/chains-api/celo/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/celo/web3-p2/ title: Celo — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/celo/web3-p2.mdx --- # Celo — web3, net, eth (2/3) > API reference for [Celo](/rpc-service/chains/chains-api/celo/). [All methods ->](/rpc-service/chains/chains-api/celo/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/celo/web3/) · 2 · [3](/rpc-service/chains/chains-api/celo/web3-p3/) ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "epochSnarkData": null, "extraData": "0xd983010000846765746889676f312e31332e3130856c696e7578000000000000f8c0c0c080b841455a52f6357349c5e1526cde273de9c28869f1f986d3b95b6d7ed7f4d358868a695ce26ef7f0ad271095d3b54f1b17920809a790d85a2648ef646dcef96fa60d00f83b88c4aa7fd67fc1fffbb0743b9c7e425a7c098dbbf6e7f52cab82da304a49b79eb8dc64bee6558f04371c23c0e6e2144bc53f4d6e22dc2a15de8080f83b88cdeeffd77ff7fffbb0ad0d7f89709ff7c96346ebd90fdcde629c5261780821d9faf860a5e5e9915244074299b83f09f2eb47df8ad6bf94328080", "gasUsed": "0x0", "hash": "0x471705c554792e2b1af7561872a6a7c3a630aecf1fe887f18ebd4159fdc5645e", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xe3020350aceea29b783e0c947ae001692b8f6248", "number": "0x1b4", "parentHash": "0x312583d4ac62cc5ca91307b824577cfeed45d8ea271ef6a5295490f02c4353c8", "randomness": { "committed": "0x0000000000000000000000000000000000000000000000000000000000000000", "revealed": "0x0000000000000000000000000000000000000000000000000000000000000000" }, "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "size": "0x2d7", "stateRoot": "0xb7424af0eda57fd6b5631029fa1f90e91ff881de58207e910f4fb72cd2a67167", "timestamp": "0x5ea07511", "totalDifficulty": "0x1b5", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xc5043f", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xed8df15ca001741a2abaf06dd280da270eaa9fb37ac267938d84a6dfc11abbe3", "blockNumber": "0xc5043f", "from": "0x8cf35e5229becab14d822c57b9ce54da99e43046", "gas": "0x2797a", "gasPrice": "0x13d2762ab", "feeCurrency": "0xe8537a3d056da446677b9e9d6c5db704eaab4787", "gatewayFeeRecipient": null, "gatewayFee": "0x0", "hash": "0xd90570fb4a3c2143209b3063acfe0a43dc06d903341e1ed622a8292228019677", "input": "0xa9059cbb000000000000000000000000e87fa0bfe3258b648fecb048c5920395125efc27000000000000000000000000000000000000000000000002a1129d0936720000", "nonce": "0x48", "to": "0xe8537a3d056da446677b9e9d6c5db704eaab4787", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "v": "0x149fb", "r": "0x10e71d4d30850521ab5919d65084de551ee1f167b2414e54aad3cbb359901cb7", "s": "0x59ed3146059508829d79f7a92c7a73d781d95d773eda6758bed834af41ec3d30", "ethCompatible": false } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3c9329b765d88c03d18f87dc1f2b5138c89d9a415d5c73dc7827b87aca176c8e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/celo/web3-p3/ title: Celo — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/celo/web3-p3.mdx --- # Celo — web3, net, eth (3/3) > API reference for [Celo](/rpc-service/chains/chains-api/celo/). [All methods ->](/rpc-service/chains/chains-api/celo/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/celo/web3/) · [2](/rpc-service/chains/chains-api/celo/web3-p2/) · 3 ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/celo/web3/ title: Celo — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/celo/web3.mdx --- # Celo — web3, net, eth (1/3) > API reference for [Celo](/rpc-service/chains/chains-api/celo/). [All methods ->](/rpc-service/chains/chains-api/celo/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/celo/web3-p2/) · [3](/rpc-service/chains/chains-api/celo/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "celo/v1.7.2-stable/linux-amd64/go1.17.13" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "42220" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or FALSE, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5d21dba00" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x10cdecf" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2c85c3ecfcb5fb" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x36c1d18"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xb6" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/celo/web3-p2/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/celo/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6cd5" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/chiliz/ title: Chiliz description: Chiliz is an EVM-compatible Layer-1 blockchain built to serve as the foundation for an ever-growing ecosystem of… 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/chiliz/index.mdx --- # Chiliz
> Chiliz API is available on [Web3 API platform](https://www.ankr.com/rpc/chiliz). *Chiliz* is an EVM-compatible Layer-1 blockchain built to serve as the foundation for an ever-growing ecosystem of enterprise-level sports and entertainment stakeholders developing blockchain-based user/fan experiences and B2B/B2C tools within their respective industries. In order for your Web3 application to interact with Chiliz — either by reading blockchain data or sending transactions to the network — it must connect to a Chiliz node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/chiliz/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/chiliz/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/chiliz/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/chiliz/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/chiliz/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/chiliz/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/chiliz/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/chiliz/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/chiliz/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/chiliz/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/chiliz/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/chiliz/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/chiliz/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/chiliz/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/chiliz/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/chiliz/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/chiliz/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/chiliz/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/chiliz/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/chiliz/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/chiliz/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/chiliz/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/chiliz/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/chiliz/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/chiliz/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/chiliz/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/chiliz/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/chiliz/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/chiliz/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/chiliz/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/chiliz/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/chiliz/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/chiliz/web3-p2/ title: Chiliz — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/chiliz/web3-p2.mdx --- # Chiliz — web3, net, eth (2/3) > API reference for [Chiliz](/rpc-service/chains/chains-api/chiliz/). [All methods ->](/rpc-service/chains/chains-api/chiliz/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/chiliz/web3/) · 2 · [3](/rpc-service/chains/chains-api/chiliz/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei; note that if the value exceeds the `from` address balance (which is 0.000000000000000001 ETH by default), then you'll receive an `insufficient funds` error in response. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0x6E9681c9cbCF23Fc3B9a044B04941B792B0dCBd9"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x23b361994b3c5cf8101623b6efa01d5d20abbdb3e50e522e65094d6b2bd93280", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x31", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x17d7840", "gasUsed": "0x94012", "hash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "logsBloom": "0x00000000000000000000000000000000000000000400040000000000000000000000004000000000000001000000000000000000000000000100000000000000000000000000020800000008000000000000000000000000000000000000000004000000028040004000000000008800200000000000000000000110200100200008800000000040000000000000800000000000000000000002000000000000000000000000000000000000000000000000000000004000000000000000000000000002000000000000000000000008000000000000200000000000000820000001000000000000000000000000800000000000000000000008000000000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x7180a31b9dd9cee2c54b01e8f2159f8f319344a6bef98ddb2ba1c7aa7b6f7881", "nonce": "0x0000000000000000", "number": "0x3c755c", "parentHash": "0xd101d2af1b670fbe88eb0defb057cc4c0384df350edbe771a6a199e7898f9d65", "receiptsRoot": "0x70f185eb69e67c0c084b299237c1503198cc1b7b7c27f4cf1279595a16cc038b", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x7e8", "stateRoot": "0x15f9c468bc700599a24a230e60847f50e689617b033b27f371f703a91e3e5dc6", "timestamp": "0x645257c8", "totalDifficulty": "0x0", "transactions": [ "0xf14686c9327d897ab5b0754b18cea248cf08a9caa3c9d7c98e73690d46d2cb39", "0xc263dd53e1aaaabb951c49cfd4aa7a9e1251b0c5db1ad00226d72870f08c8d78", "0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b", "0x023fb744a61685e453db52bd35473c8593ecdf57e6642146c8de60a5cf642396", "0xf4c8bfb6c3e9eefa28f297bdab17954e1e74532df3bd8c71e87c257408f56bea" ], "transactionsRoot": "0x1c21ae0871abb6a8a1fc9b5e5d3b5d10b840903f628dfdf18da8b02fd16c972f", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x2", "extraData": "0xd983010108846765746889676f312e31362e3135856c696e75780000bd7c1b1b4d5395dcb04ebc3bca5f8d501b11eae55e194bbddf2ba2a1b0957822b1fa632b547ec992b469068caaeb5f0fcf74062e4e65fbb0636a1f2f62423906b5f01a7c01", "gasLimit": "0x1c9c380", "gasUsed": "0x0", "hash": "0x68ca2f7050fbf04874b9614e652b8bd4f6ac44bb5c1e600bb66c6070a5424170", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xf84aed72066e635fd9b0f2fbddbdb77a8761d028", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x2a3cde", "parentHash": "0xb6bcca7a7e91f9854ef66a27eb7fa2e77f957903601f2fed214f87570591adc2", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x262", "stateRoot": "0x6506ff6f995b6d1defd5f3fecff5054eb9266ce9be310afef12011f627f23aaf", "timestamp": "0x6463776e", "totalDifficulty": "0x54648b", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x58a525386e069209bad64c761fe1b6b79e758ef2989e3659e1ef7cba6f4d594d"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "blockNumber": "0x3c755c", "from": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "gas": "0x186a0", "gasPrice": "0x0", "hash": "0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b", "input": "0x", "nonce": "0x0", "to": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "transactionIndex": "0x2", "value": "0x21ec894ca2f7b800", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x4b34328ff3466ddda82a19e849e6724e03cae75075709ec600c7d8bf6c7b5e9b", "mint": "0x21ec894ca2f7b800" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "blockNumber": "0x3c755c", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0x8f0d180", "gasPrice": "0x0", "hash": "0xf14686c9327d897ab5b0754b18cea248cf08a9caa3c9d7c98e73690d46d2cb39", "input": "0x015d8eb90000000000000000000000000000000000000000000000000000000000885554000000000000000000000000000000000000000000000000000000006452579400000000000000000000000000000000000000000000000000000009abdfc80badc6a92f7b910d6eb19519df02d5f553acf1916705b5c8ffc363f19eae6378bb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d679b567db6187c0c8323fa982cfb88b74dbcc7000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240", "nonce": "0x0", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x8d211d9a6c156ad43a3330c0f07904f319936ae4eadf6d57cce64c1f52a569b1", "mint": "0x0", "isSystemTx": true } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa72d3db5dc554ec1eee6be321d3d7fa5eadf68ef19e1ddba2cbdde65bd049325", "blockNumber": "0x3c764e", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0x8f0d180", "gasPrice": "0x0", "hash": "0xfa21b7302972609248949646b06703f94010c724f1565949da1e050a56672504", "input": "0x015d8eb9000000000000000000000000000000000000000000000000000000000088557000000000000000000000000000000000000000000000000000000000645259680000000000000000000000000000000000000000000000000000000d6a1b7750abf0a584e9f633edf00ea6ca61d6a845313965c3f39426e66ed959ba18f1c6d900000000000000000000000000000000000000000000000000000000000000020000000000000000000000002d679b567db6187c0c8323fa982cfb88b74dbcc7000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240", "nonce": "0x0", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x0d55c4a6698e3facccbb99f7d27a091886a9c4286c36f2789b850b70e7f83a0c", "mint": "0x0", "isSystemTx": true } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/chiliz/web3-p3/ title: Chiliz — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/chiliz/web3-p3.mdx --- # Chiliz — web3, net, eth (3/3) > API reference for [Chiliz](/rpc-service/chains/chains-api/chiliz/). [All methods ->](/rpc-service/chains/chains-api/chiliz/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/chiliz/web3/) · [2](/rpc-service/chains/chains-api/chiliz/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x58a525386e069209bad64c761fe1b6b79e758ef2989e3659e1ef7cba6f4d594d"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "blockNumber": "0x3c755c", "contractAddress": null, "cumulativeGasUsed": "0x30d40", "effectiveGasPrice": "0x0", "from": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "gasUsed": "0x186a0", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "transactionHash": "0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b", "transactionIndex": "0x2", "type": "0x7e" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xf54b65b1c0ba67b2fb64add9151df5a5f2ee6366e16c3e6f01adb4c9a2e58bdf", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xB7Ce2087829FC7672E23cd044A3039908780262d"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/chiliz/web3/ title: Chiliz — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/chiliz/web3.mdx --- # Chiliz — web3, net, eth (1/3) > API reference for [Chiliz](/rpc-service/chains/chains-api/chiliz/). [All methods ->](/rpc-service/chains/chains-api/chiliz/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/chiliz/web3-p2/) · [3](/rpc-service/chains/chains-api/chiliz/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Geth/v1.1.8/linux-amd64/go1.16.15" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "88888" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x246139ca800" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2a36ed" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x94E7358492C968FCA9D984aB507067Ea734233Ce", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x46bb5369701C44E3F1a78825A5E55743B0D81401", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x46bb5369701C44E3F1a78825A5E55743B0D81401", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x2b64fbd89591504539f013f3a00fbeb01d6927fc72e08e9ef0bc0d0c041492fa"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x8" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x15A846B"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x8" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x2b64fbd89591504539f013f3a00fbeb01d6927fc72e08e9ef0bc0d0c041492fa"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x15A844D"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x4D5a7038ca6573eA6682e788843f53d33B453BeE", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/chiliz/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x4D5a7038ca6573eA6682e788843f53d33B453BeE","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/core/ title: Core description: Core is a layer 1 blockchain built around a unique consensus mechanism called "Satoshi Plus". 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/core/index.mdx --- # Core
> Core API is available on [Web3 API platform](https://www.ankr.com/rpc/core). *Core* is a layer 1 blockchain built around a unique consensus mechanism called ["Satoshi Plus"](https://docs.coredao.org/core-white-paper-v1.0.5/satoshi-plus-consensus). In order for your Web3 application to interact with Core — either by reading blockchain data or sending transactions to the network — it must connect to a Core node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/core/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/core/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/core/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/core/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/core/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/core/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/core/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/core/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/core/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/core/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/core/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/core/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/core/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/core/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/core/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/core/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/core/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/core/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/core/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/core/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/core/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/core/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/core/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/core/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/core/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/core/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/core/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/core/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/core/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/core/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/core/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/core/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/core/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/core/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/core/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/core/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/core/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/core/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/core/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/core/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/core/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/core/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/core/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/core/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/core/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/core/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/core/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/core/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/core/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/core/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/core/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/core/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/core/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/core/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/core/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/core/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/core/web3-p2/ title: Core — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/core/web3-p2.mdx --- # Core — web3, net, eth (2/3) > API reference for [Core](/rpc-service/chains/chains-api/core/). [All methods ->](/rpc-service/chains/chains-api/core/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/core/web3/) · 2 · [3](/rpc-service/chains/chains-api/core/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei; note that if the value exceeds the `from` address balance (which is 0.000000000000000001 ETH by default), then you'll receive an `insufficient funds` error in response. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":"0xBe1283580c8CDe2E6F47a0811f8822835A3d27e7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xcf08" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xa395f12713dd311a95e7ed88dff96201b25470a2347daa122497e11a9d843e54", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x2", "extraData": "0xd983010004846765746889676f312e31392e3133856c696e7578000056321a1cd4c1ba81b5b7391e9458424ddb95fe7c5b5319d5ee662c05d16213b54adad56c2c3b68ddfbf4e20eda8e4718ba5b9615dae554852b87a1eaa3020c658742761a01", "gasLimit": "0x2625a00", "gasUsed": "0x15faca", "hash": "0xa395f12713dd311a95e7ed88dff96201b25470a2347daa122497e11a9d843e54", "logsBloom": "0x800000200800200000000400100000040400a404004004000100a008000000000000200008000002040000200000000214008412201010000000000004010000000000000004000008000002000000002030000000801000000010080200010100000020080200400000000040003000000400000404810200000004001000000001000010082000010000400005400000000420000000000000810000000020000080000540400100000200020000100100020010020701400000800800110400000004000000000080000000000000020004000000400100001040000000020000000000000000010004040000030020040821200500004000000101000040", "miner": "0x586261e2ec40c979ae6d24dae8bb044be48b635a", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x905cc1", "parentHash": "0x199e671ee4f94b79a31f59b62127ec73be5f647cb6cb6b3b507931b01884eab6", "receiptsRoot": "0x8e3613e1dffb0fe400f6b91e33cc530921b6fbd6fea429e807b7823dea9fbea4", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0xdf4", "stateRoot": "0xdf254d5902e5b179a8af6322bb3d686221274954d8ca2e9b2ec0736765ee4f59", "timestamp": "0x656d8a9c", "totalDifficulty": "0x1206e0b", "transactions": [ "0x622be4a32950fd54e33e3a9ce86d860f394c640e82689b1c9479708678ad89a4", "0xe82ce437e2354a7398f2e164f93a77fbd9b6e83d4ade160c891f38753683176a", "0xb1116cdcf98adfb8dfa3aac43787e4098a55e2b4f2cd948d16a27dc081265b28", "0x83818322bdcf090bad7d9928a6bf1bc755b2bbafd2f55ce6f4be9144ce1cb828", "0x246ca37628d99ada338abdce3ceeaa313d994d3f7543fb96e78e5ddb0424b657", "0xd3217e1ba3bf45720ab9c8e8f351d7d99dcbe0897053b7be00db4b3a92c400cb", "0x95043f30cec040a92ff7ad56fe3b674def1947d7a038491a2e48c371580f3938", "0xb1430786113843dc1019b81e0677d88c818d3c0fc1be6fa8f7cbc693b34f8faa", "0xedb630223ec8ba03b85a706b9b0e531599e012262ee9fa2921a176e262a1d514" ], "transactionsRoot": "0xa16ea8756623459227d6d0ccd479bb34067015c634c8084d51a0b2e4d5dc9986", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x2", "extraData": "0xd983010004846765746889676f312e31392e3133856c696e7578000056321a1c6c1009bd1344e15547523a8c6b1692f01059efda144875ce7bd486fd361af6b26d3903f0bedec52ffa74d39404cdd2ac210b7bb54b60198901a61bef8275aee800", "gasLimit": "0x2625a00", "gasUsed": "0x3021b", "hash": "0x08cc94c3b49c45edc68e08f5270cc0bbcfba12d430912a7d8fd439eb793d7ee7", "logsBloom": "0x00000000000000000000040000080000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000040000000000000020000200000000000000040000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000020000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000004000000000000000000000000020000000200000000010000000000000000000800000000000000000100000000", "miner": "0x4bfa260cb855ef3071be244505a10df7819f96a0", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x905e39", "parentHash": "0x8c69dec8547ccc73dc2c0deebc2557ef97c1f1b19b35eb2d13751538fd643fef", "receiptsRoot": "0x4e412039c3867bd5e5bb64ac1a97219958fba04283c75ae12b32e4fdeedcebe4", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3c7", "stateRoot": "0x14de7715cdd028c4e3170012556db0f587ce2723e61b9276ff0a43b32f77ab6f", "timestamp": "0x656d8f04", "totalDifficulty": "0x12070fb", "transactions": [ "0x42a98094dac44392bde4dde5fedcc1a39a73af24ab91fa485ff5f2c693dd3faa", "0x4bdbe8a11858707af1166190647d21dd38e5685b33ea624064fdafbb2c3573f8" ], "transactionsRoot": "0x16e9f8e8a732765f627d23e40810c25926038660a484fcfcc97c3d403b7fcde2", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xa395f12713dd311a95e7ed88dff96201b25470a2347daa122497e11a9d843e54"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "blockNumber": "0x3c755c", "from": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "gas": "0x186a0", "gasPrice": "0x0", "hash": "0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b", "input": "0x", "nonce": "0x0", "to": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "transactionIndex": "0x2", "value": "0x21ec894ca2f7b800", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x4b34328ff3466ddda82a19e849e6724e03cae75075709ec600c7d8bf6c7b5e9b", "mint": "0x21ec894ca2f7b800" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xa395f12713dd311a95e7ed88dff96201b25470a2347daa122497e11a9d843e54", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa395f12713dd311a95e7ed88dff96201b25470a2347daa122497e11a9d843e54", "blockNumber": "0x905cc1", "from": "0xa20898e457c552d203039d45d55d48a21e507690", "gas": "0xea60", "gasPrice": "0xc92a69c00", "hash": "0x622be4a32950fd54e33e3a9ce86d860f394c640e82689b1c9479708678ad89a4", "input": "0x", "nonce": "0xb59", "to": "0xed55fcddf6903042ef5a8f724cc289e6300e0796", "transactionIndex": "0x0", "value": "0x13fbe85edc90000", "type": "0x0", "v": "0x8dc", "r": "0x8a5f9e0b36bec477e629919eb27b5eca432a14eab16a2460bc5506cdec8348e8", "s": "0x506433d8e581e6062ecba4800fda7e6fa5ea45d268947da8779a2dceced9ccdd" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x8bf7659b501c6e6421e3a98fb07d21702f03a33a4a68d57e4acc70ee644151d7", "blockNumber": "0x905e6b", "from": "0xa86e95c5cab2de4f2132725d4f328b1b638686d1", "gas": "0x325c9", "gasPrice": "0x6fc23ac00", "hash": "0x17a7106e4b8d6cfa31356748ae208eaf95d5868fe4ee5e24c0ef09e38206718c", "input": "0x879762e2000000000000000000000000a4151b2b3e269645181dccf2d426ce75fcbdeca900000000000000000000000000000000000000000000000000000000000000660000000000000000000000000000000000000000000000000000000000024ab8000000000000000000000000a86e95c5cab2de4f2132725d4f328b1b638686d10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a86e95c5cab2de4f2132725d4f328b1b638686d1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x19", "to": "0xa4218e1f39da4aadac971066458db56e901bcbde", "transactionIndex": "0x0", "value": "0x10778745f9d47327", "type": "0x0", "v": "0x8dc", "r": "0xd2b7643361f044c4e24160bf02789f4e065ad34252f13701e97b7a55a35425e8", "s": "0x4dccdbcb976eb9b359f85d9d328c6ef67013b7b7c003250ed73ead8227d476ae" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/core/web3-p3/ title: Core — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/core/web3-p3.mdx --- # Core — web3, net, eth (3/3) > API reference for [Core](/rpc-service/chains/chains-api/core/). [All methods ->](/rpc-service/chains/chains-api/core/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/core/web3/) · [2](/rpc-service/chains/chains-api/core/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x473dbd7a59b6b0ef45aa959ad213397c752883db163c5276e942aa95b60bf73e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x895a5d7e976129b8a53e3082b30f0c8100b28f2b5f07c7ebbe7e55c96bb8e33e", "blockNumber": "0x905e76", "contractAddress": null, "cumulativeGasUsed": "0x29d62", "effectiveGasPrice": "0x6fc23ac00", "from": "0xbeb04eb082e61940096e0943e4f883ebec412de1", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x05cfade323a90bc94ef697f630be4ba21b699a2d", "transactionHash": "0x473dbd7a59b6b0ef45aa959ad213397c752883db163c5276e942aa95b60bf73e", "transactionIndex": "0x2", "type": "0x0" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xbbd1327480250c4941546a42230056cc9b758cc42997fc8a6506ccc0216de1c8", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x905EA3", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x5EaCcA7e77639e350970688672A0CA868175F387"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/core/web3/ title: Core — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/core/web3.mdx --- # Core — web3, net, eth (1/3) > API reference for [Core](/rpc-service/chains/chains-api/core/). [All methods ->](/rpc-service/chains/chains-api/core/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/core/web3-p2/) · [3](/rpc-service/chains/chains-api/core/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Geth/v1.0.4-f2035d54/linux-amd64/go1.20.10" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1116" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6fc23ac00" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x905c65" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xBe1283580c8CDe2E6F47a0811f8822835A3d27e7", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x34e91635917709b" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xBe1283580c8CDe2E6F47a0811f8822835A3d27e7", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xBe1283580c8CDe2E6F47a0811f8822835A3d27e7", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x8" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xa395f12713dd311a95e7ed88dff96201b25470a2347daa122497e11a9d843e54"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x17" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x905CC1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x17" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xa395f12713dd311a95e7ed88dff96201b25470a2347daa122497e11a9d843e54"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x905CC1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xBe1283580c8CDe2E6F47a0811f8822835A3d27e7", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/core/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/core/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x4D5a7038ca6573eA6682e788843f53d33B453BeE","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/corn/ title: Corn description: Corn is an Ethereum Layer 2 network that offers a rich, Bitcoin-centric ecosystem powered by cutting-edge… 27 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/corn/index.mdx --- # Corn
> Corn API is available on [Web3 API platform](https://www.ankr.com/rpc/corn). Corn is an Ethereum Layer 2 network that offers a rich, Bitcoin-centric ecosystem powered by cutting-edge technologies. It includes Bitcorn (BTCN) as its gas token, the popCORN System for long-term incentives, and LayerZero for seamless cross-chain asset transfers. Built on Arbitrum Orbit, Corn brings unparalleled scalability and efficiency, with support for Stylus, enabling developers to use multiple programming languages for smart contract development. In order for your Web3 application to interact with Corn — either by reading blockchain data or sending transactions to the network — it must connect to a Corn node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/corn/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/corn/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/corn/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/corn/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/corn/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/corn/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/corn/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/corn/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/corn/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/corn/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/corn/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/corn/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/corn/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/corn/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/corn/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/corn/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/corn/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/corn/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/corn/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/corn/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/corn/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/corn/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/corn/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/corn/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/corn/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/corn/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/corn/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/corn/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/corn/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/corn/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/corn/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/corn/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/corn/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/corn/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/corn/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/corn/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/corn/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/corn/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/corn/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/corn/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/corn/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/corn/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/corn/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/corn/web3-p2/ title: Corn — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/corn/web3-p2.mdx --- # Corn — web3, net, eth (2/3) > API reference for [Corn](/rpc-service/chains/chains-api/corn/). [All methods ->](/rpc-service/chains/chains-api/corn/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/corn/web3/) · 2 · [3](/rpc-service/chains/chains-api/corn/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0x83c4A688174A8d4b99b4C8A2feC124dff79D58d2", "to": "0x7E359114E9098cBeB28f4e23648a39E3Fcb915D0", "data": "0xa9059cbb000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf90000000000000000000000000000000000000000000000000000000000000064" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x54ea" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x7a120", "difficulty": "0x1", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x4000000000000", "gasUsed": "0x35627", "hash": "0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8", "l1BlockNumber": "0x1497c2f", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000002000000000000000000000000000000000000000000000100000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000008000000000000000000000000000000000000400000000000080000000000000000000000000000000000000000000000000000000", "miner": "0xa4b000000000000000000073657175656e636572", "mixHash": "0x00000000000000000000000001497c2f00000000000000200000000000000000", "nonce": "0x000000000000000e", "number": "0x2091c", "parentHash": "0x23dcf4596ccd306b0cd04de5bd2cc5c2a633c26f394a47d27e8bbb1b3be24d7e", "receiptsRoot": "0xdddeebb43f8150acc7d5930ed3bb797c844279d916e076803f9c77b5fe321d24", "sendCount": "0x0", "sendRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x72e", "stateRoot": "0x778e256a5ad4b7b4d0c74f5029b46287eabaa7ec0eae57d1369c25bc7b49af63", "timestamp": "0x6780e623", "totalDifficulty": "0x2091d", "transactions": [ "0xad06bd8b78bf48f9f3d69e968db30816ed2b60e1220da727d930bbf6d302e262", "0x377077af08a5676dcd6706728c21811520638a5623da4a0ef1ddd9d940bca9e1" ], "transactionsRoot": "0xf59d707ba45d76d5b4105a0fa5b32bc1d3bc37f74bd42feec86610541976289b", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x2091C", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x7a120", "difficulty": "0x1", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x4000000000000", "gasUsed": "0x35627", "hash": "0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8", "l1BlockNumber": "0x1497c2f", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000002000000000000000000000000000000000000000000000100000000000009000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000008000000000000000000000000000000000000400000000000080000000000000000000000000000000000000000000000000000000", "miner": "0xa4b000000000000000000073657175656e636572", "mixHash": "0x00000000000000000000000001497c2f00000000000000200000000000000000", "nonce": "0x000000000000000e", "number": "0x2091c", "parentHash": "0x23dcf4596ccd306b0cd04de5bd2cc5c2a633c26f394a47d27e8bbb1b3be24d7e", "receiptsRoot": "0xdddeebb43f8150acc7d5930ed3bb797c844279d916e076803f9c77b5fe321d24", "sendCount": "0x0", "sendRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x72e", "stateRoot": "0x778e256a5ad4b7b4d0c74f5029b46287eabaa7ec0eae57d1369c25bc7b49af63", "timestamp": "0x6780e623", "totalDifficulty": "0x2091d", "transactions": [ "0xad06bd8b78bf48f9f3d69e968db30816ed2b60e1220da727d930bbf6d302e262", "0x377077af08a5676dcd6706728c21811520638a5623da4a0ef1ddd9d940bca9e1" ], "transactionsRoot": "0xf59d707ba45d76d5b4105a0fa5b32bc1d3bc37f74bd42feec86610541976289b", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x377077af08a5676dcd6706728c21811520638a5623da4a0ef1ddd9d940bca9e1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8", "blockNumber": "0x2091c", "from": "0xb880d4637443106859ee957666a6c55a7dcac176", "gas": "0x3617e", "gasPrice": "0x7a120", "hash": "0x377077af08a5676dcd6706728c21811520638a5623da4a0ef1ddd9d940bca9e1", "input": "0x49a1a4fb000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000004cfbf5aabd000000000000000000000000000000000000000000000000000000000217f618000000000000000000000000000000000000000000000000000000006780e622000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000041a5ece755efb2507fc5c64c2a33d641f22bb91a353eecc551d6963f831145557c32d167db7b4335d744938253e870405c6ef504628130b8ee166471d7659205a001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041cbca0b58c2f92d19a37d68291553c906770bdd46157a764083b8cd1fd1aa53a53c97c641f03177b3fb31654eedbd633388cdf45693e23ef685817dbbb406f8c80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004157898e123d8cb06ab91cffa135fbe66e1eb335eff58a555326121d3581c83faf07cd25239e2b67ea2009d356ce6eb65abd3bfb7cd66afe812d4c7a681102c55e0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004138fefe4c3a4313521b13cc973cd40a9934028ecdecfe1b2bd4e90719a86ed5902389d350b4e28730a42127e44ceefc91a85a53001487716582776f9e0c89717100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041819c58754d97e4637240cc62f5fd6feaea6ca3fcf00a1dc3603d929295d1bfb91c9f6b75ac11dd7b25495a9feb72773cc09e1d02b40395a497c9d41120efc2c20000000000000000000000000000000000000000000000000000000000000000", "nonce": "0xbebd", "to": "0xa0caf2fb33b28d6878e334075a6637eb36cf2b7a", "transactionIndex": "0x1", "value": "0x0", "type": "0x0", "chainId": "0x1406f40", "v": "0x280dea4", "r": "0x77d8d18870e71b7f33925f3f3fb1e2152d9fd8b4e065c10ef15cc85895d9672a", "s": "0x8175e314d3bcbef76bb8e7f10ce9045fb27f30db9ecb3d73cb5312e09bcf047" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8", "0x0" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8", "blockNumber": "0x2091c", "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasPrice": "0x0", "hash": "0xad06bd8b78bf48f9f3d69e968db30816ed2b60e1220da727d930bbf6d302e262", "input": "0x6bf6a42d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001497c2f000000000000000000000000000000000000000000000000000000000002091c000000000000000000000000000000000000000000000000000000000000000f", "nonce": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "transactionIndex": "0x0", "value": "0x0", "type": "0x6a", "chainId": "0x1406f40", "v": "0x0", "r": "0x0", "s": "0x0" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x2091C", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8", "blockNumber": "0x2091c", "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasPrice": "0x0", "hash": "0xad06bd8b78bf48f9f3d69e968db30816ed2b60e1220da727d930bbf6d302e262", "input": "0x6bf6a42d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001497c2f000000000000000000000000000000000000000000000000000000000002091c000000000000000000000000000000000000000000000000000000000000000f", "nonce": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "transactionIndex": "0x0", "value": "0x0", "type": "0x6a", "chainId": "0x1406f40", "v": "0x0", "r": "0x0", "s": "0x0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/corn/web3-p3/ title: Corn — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/corn/web3-p3.mdx --- # Corn — web3, net, eth (3/3) > API reference for [Corn](/rpc-service/chains/chains-api/corn/). [All methods ->](/rpc-service/chains/chains-api/corn/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/corn/web3/) · [2](/rpc-service/chains/chains-api/corn/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xad06bd8b78bf48f9f3d69e968db30816ed2b60e1220da727d930bbf6d302e262"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8", "blockNumber": "0x2091c", "contractAddress": null, "cumulativeGasUsed": "0x0", "effectiveGasPrice": "0x7a120", "from": "0x00000000000000000000000000000000000a4b05", "gasUsed": "0x0", "gasUsedForL1": "0x0", "l1BlockNumber": "0x1497c2f", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x00000000000000000000000000000000000a4b05", "transactionHash": "0xad06bd8b78bf48f9f3d69e968db30816ed2b60e1220da727d930bbf6d302e262", "transactionIndex": "0x0", "type": "0x6a" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x2091C", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0x20", "toBlock": "0x30" }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0x16ae0f42dc414c339b399459c4fdec10beeef975", "topics": [ "0x141df868a6331af528e38c83b7aa03edc19be66e37ae67f9285bf4f8e3c6a1a8", "0x000000000000000000000000a6b71e26c5e0845f74c812102ca7114b6a896ab2" ], "data": "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f48f2b2d2a534e402487b3ee7c18c33aec0fe5e40000000000000000000000000000000000000000000000000000000000000001000000000000000000000000cb416bf9b1c7caaf64aae813d1bb8f5c2a853182", "blockNumber": "0x2e", "transactionHash": "0x7a24256a4cc7d379b5a83fd4a8713dcd20b566dbe1b340d95d6e81089acb3a2e", "transactionIndex": "0x1", "blockHash": "0xfcd6d628bad142f1d5331e13a5956d8d1f59561d0a8aa551cca089cc2e348b2c", "logIndex": "0x0", "removed": false }, { "address": "0xa6b71e26c5e0845f74c812102ca7114b6a896ab2", "topics": [ "0x4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e235" ], "data": "0x00000000000000000000000016ae0f42dc414c339b399459c4fdec10beeef9750000000000000000000000003e5c63644e683549055b9be8653de26e0b4cd36e", "blockNumber": "0x2e", "transactionHash": "0x7a24256a4cc7d379b5a83fd4a8713dcd20b566dbe1b340d95d6e81089acb3a2e", "transactionIndex": "0x1", "blockHash": "0xfcd6d628bad142f1d5331e13a5956d8d1f59561d0a8aa551cca089cc2e348b2c", "logIndex": "0x1", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/corn/web3/ title: Corn — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/corn/web3.mdx --- # Corn — web3, net, eth (1/3) > API reference for [Corn](/rpc-service/chains/chains-api/corn/). [All methods ->](/rpc-service/chains/chains-api/corn/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/corn/web3-p2/) · [3](/rpc-service/chains/chains-api/corn/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "nitro/v3.3.2-9d70997/linux-amd64/go1.23.1" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "21000000" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7a120" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2091d" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x1663efB77d63745b1B80116D43BfC3062d743803", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x1663efB77d63745b1B80116D43BfC3062d743803", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xb880D4637443106859ee957666a6C55a7DcAC176", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xbec6" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xc9f7eeb52a2e215f695031412c7db6b8b0c2d6231dbeb2b5027f473f3982a4c8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x1663efB77d63745b1B80116D43BfC3062d743803", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6080604052600436101561001e575b361561001c5761001c600080fd5b005b60003560e01c8062b99e361461032957806301ffc9a714610320578063248a9ca3146103175780632f2ff15d1461030e57806331ac99201461030557806336568abe146102fc5780633a9a4081146102f35780633cf57ac71..." } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/corn/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_tx_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x1234567890abcdef1234567890abcdef12345678", "data": "0x70a08231000000000000000000000000abcdefabcdefabcdefabcdefabcdef" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/electroneum/eth/ title: Electroneum — eth, debug source: docs/rpc-service/chains/chains-api/electroneum/eth.mdx --- # Electroneum — eth, debug > API reference for [Electroneum](/rpc-service/chains/chains-api/electroneum/). [All methods ->](/rpc-service/chains/chains-api/electroneum/#methods) ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6429e98ac2774c3062b81d7575fe7d1bc837b45fc5f4c9b468cf49815e9fcfc", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0x1E6CFF", "toBlock": "0x1E6D00", "address": "0xb2D0A71509A77E7A4B485E40882997701A3554b8", "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"] }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Electroneum blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0x33fae588909af0e48e0e70e799c366206d98e27a4b31c818324a5c95d5d9fe1b", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "result": { "type": "CALL", "from": "0x12090c459a10757e4debaa114a46c082c22bdc70", "to": "0x8018de591a0593bf856ffcff675ad87c39b8e633", "value": "0x3bcb33300e37dc0000", "gas": "0x0", "gasUsed": "0x0", "input": "0x", "output": "0x" } } ] } ``` --- ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Electroneum blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0x2A5D33", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "result": { "type": "CALL", "from": "0x12090c459a10757e4debaa114a46c082c22bdc70", "to": "0x8018de591a0593bf856ffcff675ad87c39b8e633", "value": "0x3bcb33300e37dc0000", "gas": "0x0", "gasUsed": "0x0", "input": "0x", "output": "0x" } } ] } ``` --- ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Electroneum blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/electroneum/ title: Electroneum description: Electroneum is an IBFT-based blockchain that operates with known validators, ensuring a high level of trust and… 30 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/electroneum/index.mdx --- # Electroneum
> Electroneum API is available on [Web3 API platform](https://www.ankr.com/rpc/electroneum). *Electroneum* is an IBFT-based blockchain that operates with known validators, ensuring a high level of trust and security. Compatible with the Ethereum Virtual Machine (EVM), Electroneum allows developers to easily deploy and interact with smart contracts. The blockchain offers impressive 5-second transaction speeds, facilitated by its unique proprietary instant blockchain finality system. The finality system ensures that transactions are quickly and irreversibly confirmed, eliminating the need for multiple confirmations and enabling rapid and efficient transactions. Combined with ultra low-cost smart contract fees, Electroneum provides an attractive platform for developers and users alike. In order for your Web3 application to interact with Electroneum — either by reading blockchain data or sending transactions to the network — it must connect to an Electroneum node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/electroneum/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/electroneum/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/electroneum/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/electroneum/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/electroneum/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/electroneum/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/electroneum/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/electroneum/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/electroneum/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/electroneum/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/electroneum/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/electroneum/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/electroneum/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/electroneum/eth/#eth_getlogs) — returns logs matching the parameters specified. **Premium-only methods**: * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/electroneum/eth/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/electroneum/eth/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/electroneum/eth/#debug_traceblock) — traces the execution of all transactions within a block. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/electroneum/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/electroneum/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/electroneum/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/electroneum/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/electroneum/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/electroneum/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/electroneum/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/electroneum/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/electroneum/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/electroneum/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/electroneum/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/electroneum/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/electroneum/web3-p3/#eth_gettransactionreceipt) ### eth, debug - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/electroneum/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/electroneum/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/electroneum/eth/#eth_getlogs) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/electroneum/eth/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/electroneum/eth/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/electroneum/eth/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/electroneum/web3-p2/ title: Electroneum — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/electroneum/web3-p2.mdx --- # Electroneum — web3, net, eth (2/3) > API reference for [Electroneum](/rpc-service/chains/chains-api/electroneum/). [All methods ->](/rpc-service/chains/chains-api/electroneum/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/electroneum/web3/) · 2 · [3](/rpc-service/chains/chains-api/electroneum/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.electroneum.com \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{ "from": "0xb2D0A71509A77E7A4B485E40882997701A3554b8", "to": "0x53FC09AA2481d3EFBc5816F7DEc1d7A978AfC810", "value": "0x9184e72a000", "data": "0x" }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xc6429e98ac2774c3062b81d7575fe7d1bc837b45fc5f4c9b468cf49815e9fcfc", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x7", "difficulty": "0x1", "extraData": "0xf90277a0d983060000846765746889676f312e32302e3132856c696e7578000000000000f8bd94135ec2bc4c04935ccd53967a072562120e4a3f92945584c91681cd7d850750941618dbaea2944e8ed49457752beb85f0b8811023f048039591ef9eb7892994763976728bc214a5c389d3928e03661bd6e7a649947779ab2cb675d7a31714e86d01bd7a56a03f41d89483ff6272d1de08ad8d492167412f1f329bd805f394915956a26fd7ee449d37ec93bbcfc5cad5ac8e2794d3e10f17e2e34e0a0fea05573992b21e13c224c994d8a2376cf7afa426414b960cfbfb4bb780e5181ac080f90192b8414e1f1b60dbb2663a02480926e6d3dec822de108b62cd2c3feb287195ded70612281fe59cc8ac18b529bddb5a5958cf764b517076bf4426fb8ce516b092a1977200b841e83cf9b6d64ae87688d91706dc602ad0f8a40eb23597a682fbeb7235c4c89f57471bf1bc3913db149b48887f69deaafb8239d324fd8dc921a432761ec5e93cdb01b841ac02a7174d5d3cecbd100c73dee6902c9762953179e7e8bc8f9885b459a960084cd0ce1dfb895af3035ebee7afa6fecc1759168efdf7adf1ed4a4672e5dd176600b8415a4dd3c40bdf9e01fee83e7d28cbbd8cc6070c5acb805dd5c661cc043b995c3306d6358fc17656c56f1bd3ffb536995f2ceb692d9e33db6feb97299d6b4b30ff01b841799bd6ca9d9585f081dc11ee1b5760520a10193525992ae765751705a4db77897f6816ce3e59d87b356eb410b302fafc3ba8bf954f0c4fb4e1351015d709093e00b8410989718ca70282cb5561b5fec09715c045de4d85ca4f464352bd67128ca9d74915131e9a86827016c66993e861ad61325a089bbc537b05285fbc64654090d42800", "gasLimit": "0x1c9c380", "gasUsed": "0x5208", "hash": "0xc6429e98ac2774c3062b81d7575fe7d1bc837b45fc5f4c9b468cf49815e9fcfc", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x135ec2bc4c04935ccd53967a072562120e4a3f92", "mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", "nonce": "0x0000000000000000", "number": "0x1e6cff", "parentHash": "0x08896e2fdc956d9a2db6dab2e7e809f3a8d75aaf3859d156ea9fda9e36387ad2", "receiptsRoot": "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x4fa", "stateRoot": "0xc2a539e6af183e0f2eb3c10bf91f7ec69f4b3eb365b393231a5a793b6d84fe28", "timestamp": "0x667d453d", "totalDifficulty": "0x1e6d00", "transactions": [ "0x5ae2a87e184d7ad1cad8d214e5505d5ab45c0e10fb77290c4b6df2a8947b876f" ], "transactionsRoot": "0x0b792ca26317cbba77bb3c5c538e18e052a1984f1b580ed4e01e5e2ec052ead8", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1E6CFF", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x7", "difficulty": "0x1", "extraData": "0xf90277a0d983060000846765746889676f312e32302e3132856c696e7578000000000000f8bd94135ec2bc4c04935ccd53967a072562120e4a3f92945584c91681cd7d850750941618dbaea2944e8ed49457752beb85f0b8811023f048039591ef9eb7892994763976728bc214a5c389d3928e03661bd6e7a649947779ab2cb675d7a31714e86d01bd7a56a03f41d89483ff6272d1de08ad8d492167412f1f329bd805f394915956a26fd7ee449d37ec93bbcfc5cad5ac8e2794d3e10f17e2e34e0a0fea05573992b21e13c224c994d8a2376cf7afa426414b960cfbfb4bb780e5181ac080f90192b8414e1f1b60dbb2663a02480926e6d3dec822de108b62cd2c3feb287195ded70612281fe59cc8ac18b529bddb5a5958cf764b517076bf4426fb8ce516b092a1977200b841e83cf9b6d64ae87688d91706dc602ad0f8a40eb23597a682fbeb7235c4c89f57471bf1bc3913db149b48887f69deaafb8239d324fd8dc921a432761ec5e93cdb01b841ac02a7174d5d3cecbd100c73dee6902c9762953179e7e8bc8f9885b459a960084cd0ce1dfb895af3035ebee7afa6fecc1759168efdf7adf1ed4a4672e5dd176600b8415a4dd3c40bdf9e01fee83e7d28cbbd8cc6070c5acb805dd5c661cc043b995c3306d6358fc17656c56f1bd3ffb536995f2ceb692d9e33db6feb97299d6b4b30ff01b841799bd6ca9d9585f081dc11ee1b5760520a10193525992ae765751705a4db77897f6816ce3e59d87b356eb410b302fafc3ba8bf954f0c4fb4e1351015d709093e00b8410989718ca70282cb5561b5fec09715c045de4d85ca4f464352bd67128ca9d74915131e9a86827016c66993e861ad61325a089bbc537b05285fbc64654090d42800", "gasLimit": "0x1c9c380", "gasUsed": "0x5208", "hash": "0xc6429e98ac2774c3062b81d7575fe7d1bc837b45fc5f4c9b468cf49815e9fcfc", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x135ec2bc4c04935ccd53967a072562120e4a3f92", "mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", "nonce": "0x0000000000000000", "number": "0x1e6cff", "parentHash": "0x08896e2fdc956d9a2db6dab2e7e809f3a8d75aaf3859d156ea9fda9e36387ad2", "receiptsRoot": "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x4fa", "stateRoot": "0xc2a539e6af183e0f2eb3c10bf91f7ec69f4b3eb365b393231a5a793b6d84fe28", "timestamp": "0x667d453d", "totalDifficulty": "0x1e6d00", "transactions": [ "0x5ae2a87e184d7ad1cad8d214e5505d5ab45c0e10fb77290c4b6df2a8947b876f" ], "transactionsRoot": "0x0b792ca26317cbba77bb3c5c538e18e052a1984f1b580ed4e01e5e2ec052ead8", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x5ae2a87e184d7ad1cad8d214e5505d5ab45c0e10fb77290c4b6df2a8947b876f"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc6429e98ac2774c3062b81d7575fe7d1bc837b45fc5f4c9b468cf49815e9fcfc", "blockNumber": "0x1e6cff", "from": "0xb2d0a71509a77e7a4b485e40882997701a3554b8", "gas": "0x5208", "gasPrice": "0x3b9aca07", "maxFeePerGas": "0x3b9aca07", "maxPriorityFeePerGas": "0x3b9aca00", "hash": "0x5ae2a87e184d7ad1cad8d214e5505d5ab45c0e10fb77290c4b6df2a8947b876f", "input": "0x", "nonce": "0x7", "to": "0x53fc09aa2481d3efbc5816f7dec1d7a978afc810", "transactionIndex": "0x0", "value": "0x29a2241af62c00000", "type": "0x2", "accessList": [], "chainId": "0xcb2e", "v": "0x0", "r": "0x943f4193d9159a7458872f0c7611b4e97f71f3ab068f41af7d05373188b5a707", "s": "0x1de7755c27ff7b869d52db09e6236d5b077d3360c28c7d025ac37d443b24a18b" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xc6429e98ac2774c3062b81d7575fe7d1bc837b45fc5f4c9b468cf49815e9fcfc", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc6429e98ac2774c3062b81d7575fe7d1bc837b45fc5f4c9b468cf49815e9fcfc", "blockNumber": "0x1e6cff", "from": "0xb2d0a71509a77e7a4b485e40882997701a3554b8", "gas": "0x5208", "gasPrice": "0x3b9aca07", "maxFeePerGas": "0x3b9aca07", "maxPriorityFeePerGas": "0x3b9aca00", "hash": "0x5ae2a87e184d7ad1cad8d214e5505d5ab45c0e10fb77290c4b6df2a8947b876f", "input": "0x", "nonce": "0x7", "to": "0x53fc09aa2481d3efbc5816f7dec1d7a978afc810", "transactionIndex": "0x0", "value": "0x29a2241af62c00000", "type": "0x2", "accessList": [], "chainId": "0xcb2e", "v": "0x0", "r": "0x943f4193d9159a7458872f0c7611b4e97f71f3ab068f41af7d05373188b5a707", "s": "0x1de7755c27ff7b869d52db09e6236d5b077d3360c28c7d025ac37d443b24a18b" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x1E6CFF", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc6429e98ac2774c3062b81d7575fe7d1bc837b45fc5f4c9b468cf49815e9fcfc", "blockNumber": "0x1e6cff", "from": "0xb2d0a71509a77e7a4b485e40882997701a3554b8", "gas": "0x5208", "gasPrice": "0x3b9aca07", "maxFeePerGas": "0x3b9aca07", "maxPriorityFeePerGas": "0x3b9aca00", "hash": "0x5ae2a87e184d7ad1cad8d214e5505d5ab45c0e10fb77290c4b6df2a8947b876f", "input": "0x", "nonce": "0x7", "to": "0x53fc09aa2481d3efbc5816f7dec1d7a978afc810", "transactionIndex": "0x0", "value": "0x29a2241af62c00000", "type": "0x2", "accessList": [], "chainId": "0xcb2e", "v": "0x0", "r": "0x943f4193d9159a7458872f0c7611b4e97f71f3ab068f41af7d05373188b5a707", "s": "0x1de7755c27ff7b869d52db09e6236d5b077d3360c28c7d025ac37d443b24a18b" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/electroneum/web3-p3/ title: Electroneum — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/electroneum/web3-p3.mdx --- # Electroneum — web3, net, eth (3/3) > API reference for [Electroneum](/rpc-service/chains/chains-api/electroneum/). [All methods ->](/rpc-service/chains/chains-api/electroneum/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/electroneum/web3/) · [2](/rpc-service/chains/chains-api/electroneum/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5ae2a87e184d7ad1cad8d214e5505d5ab45c0e10fb77290c4b6df2a8947b876f"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc6429e98ac2774c3062b81d7575fe7d1bc837b45fc5f4c9b468cf49815e9fcfc", "blockNumber": "0x1e6cff", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x3b9aca07", "from": "0xb2d0a71509a77e7a4b485e40882997701a3554b8", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x53fc09aa2481d3efbc5816f7dec1d7a978afc810", "transactionHash": "0x5ae2a87e184d7ad1cad8d214e5505d5ab45c0e10fb77290c4b6df2a8947b876f", "transactionIndex": "0x0", "type": "0x2" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/electroneum/web3/ title: Electroneum — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/electroneum/web3.mdx --- # Electroneum — web3, net, eth (1/3) > API reference for [Electroneum](/rpc-service/chains/chains-api/electroneum/). [All methods ->](/rpc-service/chains/chains-api/electroneum/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/electroneum/web3-p2/) · [3](/rpc-service/chains/chains-api/electroneum/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "etn-sc/vAurelius-6.0.0-stable-285b59d6/linux-amd64/go1.21.1", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "52014" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3b9aca07" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1e30f2" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x840bb8d233bfBf58658A57b85A74F4b8a57B555D", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x92eda8f9b6596329130" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x840bb8d233bfBf58658A57b85A74F4b8a57B555D", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x840bb8d233bfBf58658A57b85A74F4b8a57B555D", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x44" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xce7fa96a539b838e6c2c4e8401afa89010b7ab578066d1569a222ad1ed066f2c"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x1E30F3"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xce7fa96a539b838e6c2c4e8401afa89010b7ab578066d1569a222ad1ed066f2c"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x840bb8d233bfBf58658A57b85A74F4b8a57B555D", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/electroneum/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.electroneum.com \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{ "to": "0x4e470dc7321E84ca96FcB506cC147bA59d22f3F4", "data": "0x70a08231000000000000000000000000b60e8dd61c5d32be8058bb8eb970870f07233155" }, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/beacon-2-p2/ title: Ethereum Beacon — Beacon (2/3) source: docs/rpc-service/chains/chains-api/eth-beacon/beacon-2-p2.mdx --- # Ethereum Beacon — Beacon (2/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/eth-beacon/beacon-2/) · 2 · [3](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/) ### `GET /eth/v1/beacon/blinded_blocks/{block_id}` > Retrieves blinded block. Retrieves blinded block for given block ID. Depending on `Accept` header it can be returned either as JSON or as bytes serialized by SSZ. ##### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blinded_blocks/{block_id}" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "version": "phase0", "execution_optimistic": false, "finalized": false, "data": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ``` * `400`: The block ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid block ID: current" } ``` * `404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/light_client/bootstrap/{block_root}` > Retrieves `LightClientBootstrap` structure for a requested block root. Requests the [`LightClientBootstrap`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/sync-protocol.md#lightclientbootstrap) structure corresponding to a given post-Altair beacon block root. Depending on the `Accept` header it can be returned either as JSON or SSZ-serialized bytes. Servers SHOULD provide results as defined in [`create_light_client_bootstrap`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/full-node.md#create_light_client_bootstrap). To fulfill a request, the requested block's post state needs to be known. #### Parameters * `block_root` (string, hex; path; required): Block root. ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/light_client/bootstrap/{block_root}" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "version": "phase0", "data": { "header": { "beacon": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } }, "current_sync_committee": { "pubkeys": [ "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" ], "aggregate_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" }, "current_sync_committee_branch": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ] } } ``` * `400`: Malformed request parameter. ```json { "code": 400, "message": "Invalid block root value" } ``` * `404`: `LightClientBootstrap` instance cannot be produced for the given block root. ```json { "code": 404, "message": "LC bootstrap unavailable" } ``` * `406`: Unacceptable media type. ```json { "code": 406, "message": "Accepted media type not supported" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` ### `GET /eth/v1/beacon/light_client/updates` > Retrieves `LightClientUpdate` instances in a requested sync committee period range. Requests the [`LightClientUpdate`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/sync-protocol.md#lightclientupdate) instances in the sync committee period range `[start_period, start_period + count)`, leading up to the current head sync committee period as selected by fork choice. Depending on the `Accept` header they can be returned either as JSON or SSZ-serialized bytes. Servers SHOULD provide results as defined in [`create_light_client_update`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/full-node.md#create_light_client_update). They MUST respond with at least the earliest known result within the requested range, and MUST send results in consecutive order (by period). The response MUST NOT contain more than [`min(MAX_REQUEST_LIGHT_CLIENT_UPDATES, count`)](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/p2p-interface.md#configuration) results. #### Parameters * `start_period` (string; query; required) * `count` (string; query; required) #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/light_client/updates" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json [ { "version": "phase0", "data": { "attested_header": { "beacon": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } }, "next_sync_committee": { "pubkeys": [ "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" ], "aggregate_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" }, "next_sync_committee_branch": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "finalized_header": { "beacon": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } }, "finality_branch": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "sync_aggregate": { "sync_committee_bits": "0x01", "sync_committee_signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signature_slot": "1" } } ] ``` * `400`: Malformed or missing request parameter. ```json { "code": 400, "message": "Invalid sync committee period requested" } ``` * `406`: Unacceptable media type. ```json { "code": 406, "message": "Accepted media type not supported" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` ### `GET /eth/v1/beacon/light_client/finality_update` > Retrieves the known `LightClientFinalityUpdate`. Requests the latest [`LightClientFinalityUpdate`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/sync-protocol.md#lightclientfinalityupdate) known by the server. Depending on the `Accept` header it can be returned either as JSON or SSZ-serialized bytes. Servers SHOULD provide results as defined in [`create_light_client_finality_update`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/full-node.md#create_light_client_finality_update). #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/light_client/finality_update" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "version": "phase0", "data": { "attested_header": { "beacon": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } }, "finalized_header": { "beacon": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } }, "finality_branch": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "sync_aggregate": { "sync_committee_bits": "0x01", "sync_committee_signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signature_slot": "1" } } ``` * `400`: No `LightClientFinalityUpdate` available. ```json { "code": 404, "message": "LC finality update unavailable" } ``` * `406`: Unacceptable media type. ```json { "code": 406, "message": "Accepted media type not supported" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/ title: Ethereum Beacon — Beacon (3/3) source: docs/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3.mdx --- # Ethereum Beacon — Beacon (3/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/eth-beacon/beacon-2/) · [2](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p2/) · 3 ### `GET /eth/v1/beacon/light_client/optimistic_update` > Retrieves the latest known `LightClientOptimisticUpdate`. Requests the latest [`LightClientOptimisticUpdate`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/sync-protocol.md#lightclientoptimisticupdate) known by the server. Depending on the Accept header it can be returned either as JSON or SSZ-serialized bytes. Servers SHOULD provide results as defined in [`create_light_client_optimistic_update`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/full-node.md#create_light_client_optimistic_update). #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/light_client/optimistic_update" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "version": "phase0", "data": { "attested_header": { "beacon": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } }, "sync_aggregate": { "sync_committee_bits": "0x01", "sync_committee_signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signature_slot": "1" } } ``` * `404`: No `LightClientOptimisticUpdate` available. ```json { "code": 404, "message": "LC optimistic update unavailable" } ``` * `406`: Unacceptable media type. ```json { "code": 406, "message": "Accepted media type not supported" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/pool/attestations` > Retrieves attestations from the operations pool. Retrieves attestations known by the node but not necessarily incorporated into any block #### Parameters * `slot` (string; query): a slot. * `committee_index` (string; query): a committee index. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attestations" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ] } ``` * `Code 400`: The slot or committee index could not be parsed. ```json { "code": 400, "message": "Invalid slot: current" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/attestations` > Submits attestation objects to the node. Submits Attestation objects to the node. Each attestation in the request body is processed individually. If an attestation is validated successfully the node MUST publish that attestation on the appropriate subnet. If one or more attestations fail validation the node MUST return a 400 error with details of which attestations have failed, and why. #### Parameters * `` (required): ```json [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attestations" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Attestations are stored in pool and broadcast on appropriate subnet. * `Code 400`: Errors with one or more attestations. ```json { "code": 400, "message": "some failures", "failures": [ { "index": 3, "message": "invalid signature" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/pool/attester_slashings` > Retrieves `AttesterSlashings` from the operations pool. Retrieves attester slashings known by the node but not necessarily incorporated into any block. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attester_slashings" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/attester_slashings` > Submits the `AttesterSlashing` object to the node's pool. Submits `AttesterSlashing` object to node's pool and if passes validation node MUST broadcast it to network. #### Parameters * `` (required): ```json { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attester_slashings" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid attester slashing. ```json { "code": 400, "message": "Invalid attester slashing, it will never pass validation so it's rejected" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/pool/proposer_slashings` > Retrieves ProposerSlashings from the operations pool. Retrieves proposer slashings known by the node but not necessarily incorporated into any block. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/proposer_slashings" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/proposer_slashings` > Submits the ProposerSlashing object to the node's pool. Submits ProposerSlashing object to node's pool and if passes validation node MUST broadcast it to network. #### Parameters * `` (required): ```json { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/proposer_slashings" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid proposer slashing. ```json { "code": 400, "message": "Invalid proposer slashing, it will never pass validation so it's rejected" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/sync_committees` > Submits sync committee signatures to the node. Submits sync committee signature objects to the node. Sync committee signatures are not present in phase0, but are required for Altair networks. If a sync committee signature is validated successfully the node MUST publish that sync committee signature on all applicable subnets. If one or more sync committee signatures fail validation the node MUST return a 400 error with details of which sync committee signatures have failed, and why. #### Parameters * `` (required): ```json [ { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "validator_index": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/sync_committees" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Sync committee signatures are stored in pool and broadcast on appropriate subnet. * `Code 400`: Errors with one or more sync committee signatures. ```json { "code": 400, "message": "some failures", "failures": [ { "index": 3, "message": "invalid signature" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/pool/voluntary_exits` > Retrieves SignedVoluntaryExit from the operations pool. Retrieves voluntary exits known by the node but not necessarily incorporated into any block. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/voluntary_exits" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/voluntary_exits` > Submits the SignedVoluntaryExit object to the node's pool. Submits SignedVoluntaryExit object to node's pool and if passes validation node MUST broadcast it to network. #### Parameters * `` (required): ```json { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/voluntary_exits" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Voluntary exit is stored in node and broadcasted to network. * `Code 400`: Invalid voluntary exit. ```json { "code": 400, "message": "Invalid voluntary exit, it will never pass validation so it's rejected" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/pool/bls_to_execution_changes` > Retrieves SignedBLSToExecutionChange from operations pool. Retrieves BLS to execution changes known by the node but not necessarily incorporated into any block. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/bls_to_execution_changes" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "data": [ { "message": { "validator_index": "1", "from_bls_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "to_execution_address": "0xAbcF8e0d4e9587369b2301D0790347320302cc09" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/bls_to_execution_changes` > Submits SignedBLSToExecutionChange object to node's pool Submits a list of SignedBLSToExecutionChange objects to node's pool. Any that pass validation MUST be broadcast to the network. #### Parameters * `` (required): ```json [ { "message": { "validator_index": "1", "from_bls_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "to_execution_address": "0xAbcF8e0d4e9587369b2301D0790347320302cc09" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/bls_to_execution_changes" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `200`: BLS to execution changes were all stored to the pool and broadcast on the appropriate subnet. * `400`: Errors in one or more BLS to execution changes. ```json { "code": 400, "message": "some failures", "failures": [ { "index": 3, "message": "invalid signature" } ] } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/beacon-2/ title: Ethereum Beacon — Beacon (1/3) source: docs/rpc-service/chains/chains-api/eth-beacon/beacon-2.mdx --- # Ethereum Beacon — Beacon (1/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p2/) · [3](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/) ### `GET /eth/v2/beacon/blocks/{block_id}` > Retrieves a block. Retrieves block details for given block id. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v2/beacon/blocks/{block_id}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Note: The `Eth-Consensus-Version` header is required in response so client can deserialize returned json or ssz data more effectively. ```json { "version": "phase0", "execution_optimistic": false, "finalized": false, "data": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ``` * `Code 400`: The block ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid block ID: current" } ``` * `Code 404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/blocks/{block_id}/root` > Retrieves a block root. Retrieves `hashTreeRoot` of BeaconBlock/BeaconBlockHeader #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blocks/{block_id}/root" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } ``` * `Code 400`: The block ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid block ID: current" } ``` * `Code 404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/blocks/{block_id}/attestations` > Retrieves block attestations. Retrieves attestation included in requested block. #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blocks/{block_id}/attestations" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ] } ``` * `Code 400`: The block ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid block ID: current" } ``` * `Code 404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/blob_sidecars/{block_id}` > Retrieves blob sidecars. Retrieves blob sidecars for a given block id. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ. If the `indices` parameter is specified, only the blob sidecars with the specified indices will be returned. There are no guarantees for the returned blob sidecars in terms of ordering. #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. * `indices` (array; string; query): an array of indices for blob sidecars to request for in the specified block. Returns all blob sidecars in the block if not specified. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blob_sidecars/{block_id}" \ -H "Accept: application/json" ``` #### Responses * `200`: Successful response. ```json { "data": [ { "index": "1", "blob": "0x4aad0Fad1Efb9D9825Cde0846cabc4323312ABAA63fE5435824F8d7D8c89B43Bcfce42BBF8BFe6A4D89Ede1ADa060a8AC2e8cb425Af0b8f30cD89BFaB0b51aDd0BAdcE8cAB69F3E8DcB76709a78D4Eb9D4d2D71f02beea8f3E01DEBeeEbb583...", "kzg_commitment": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "kzg_proof": "0xAD18a6a4A3EECfb6eba0A36236e74a00BE86B44d925fabAcbc2c4B78920Baf3dFEeb5Bff3794A5cC8F1d48EBc0921AB2", "signed_block_header": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "kzg_commitment_inclusion_proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ] } ] } ``` * `400`: The block ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid block ID: current" } ``` * `404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/rewards/sync_committee/{block_id}` > Retrieves sync committee rewards. Retrieves the rewards info for sync committee members specified by array of public keys or validator index. If no array is provided, return reward info for every committee member. #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. * ``: An array of either hex encoded public key (any bytes48 with 0x prefix) or validator index. ```json [ "string" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/rewards/sync_committee/{block_id}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": [ { "validator_index": "0", "reward": "2000" } ] } ``` * `400`: Invalid get sync committee rewards request. ```json { "code": 400, "message": "Invalid request to retrieve sync committee rewards info" } ``` * `404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/deposit_snapshot` > Retrieves deposit tree snapshot. Retrieve [EIP-4881](https://eips.ethereum.org/EIPS/eip-4881) Deposit Tree Snapshot. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/deposit_snapshot" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "data": { "finalized": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "execution_block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "execution_block_height": "1" } } ``` * `404`: No Finalized Snapshot Available. ```json { "code": 404, "message": "No Finalized Snapshot Available" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/rewards/blocks/{block_id}` > Retrieves block rewards. Retrieve block reward info for a single block. #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/rewards/blocks/{block_id}" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "proposer_index": "123", "total": "123", "attestations": "123", "sync_aggregate": "123", "proposer_slashings": "123", "attester_slashings": "123" } } ``` * `400`: Invalid get block rewards request. ```json { "code": 400, "message": "Invalid request to retrieve block rewards info" } ``` * `404`: The block or required state not found. ```json { "code": 404, "message": "Block or required state not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/rewards/attestations/{epoch}` > Retrieves attestations rewards. Retrieve attestation reward info for validators specified by array of public keys or validator index. If no array is provided, return reward info for every validator. #### Parameters * `epoch` (string; path; required): the epoch to get rewards info from. * ``: an array of either hex encoded public key (any bytes48 with 0x prefix) or validator index. ```json [ "string" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/rewards/attestations/{epoch}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "ideal_rewards": [ { "effective_balance": "1000000000", "head": "2500", "target": "5000", "source": "5000", "inclusion_delay": "5000", "inactivity": "5000" } ], "total_rewards": [ { "validator_index": "0", "head": "2000", "target": "2000", "source": "4000", "inclusion_delay": "2000", "inactivity": "2000" } ] } } ``` * `400`: Invalid get attestations rewards request. ```json { "code": 400, "message": "Invalid request to retrieve attestations rewards info" } ``` * `404`: Epoch not known or required data not available. ```json { "code": 404, "message": "Epoch not known or required data not available" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/beacon-p2/ title: Ethereum Beacon — Beacon (2/3) source: docs/rpc-service/chains/chains-api/eth-beacon/beacon-p2.mdx --- # Ethereum Beacon — Beacon (2/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/eth-beacon/beacon/) · 2 · [3](/rpc-service/chains/chains-api/eth-beacon/beacon-p3/) ## Beacon ### `GET /eth/v1/beacon/headers/{block_id}` > Retrieves a block header. Retrieves a block header for a given block ID. #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/headers/{block_id}" \ -H "Accept: application/json" ``` ### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "canonical": true, "header": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } } ``` * `400`: The block ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid block ID: current" } ``` * `404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/blinded_blocks` > Publishes a signed block. Instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct and publish a `SignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`. The beacon node should broadcast a newly constructed `SignedBeaconBlock` to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed `BeaconBlock`, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202). Before Bellatrix, this endpoint will accept a `SignedBeaconBlock`. #### Parameters * `Eth-Consensus-Version` (string; header): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`, `capella`, `deneb`. * `` (required): The `SignedBlindedBeaconBlock` object composed of `BlindedBeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blinded_blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. ```json "string" ``` * `Code 202`: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database. ```json "string" ``` * `Code 400`: The `SignedBlindedBeaconBlock` object is invalid. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 415`: The supplied content-type is not supported. ```json { "code": 415, "message": "Cannot read the supplied content type." } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v2/beacon/blinded_blocks` > Publishes a signed block. Instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct and publish a `SignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`. The beacon node should broadcast a newly constructed `SignedBeaconBlock` to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed `BeaconBlock`, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202). Before Bellatrix, this endpoint will accept a `SignedBeaconBlock`. The broadcast behaviour may be adjusted via the `broadcast_validation` query parameter. #### Parameters * `broadcast_validation` (string; query): level of validation that must be applied to a block before it is broadcast. Possible values:
* `gossip` (default): lightweight gossip checks only. * `consensus`: full consensus checks, including validation of all signatures and blocks fields except for the execution payload transactions. * `consensus_and_equivocation`: the same as `consensus`, with an extra equivocation check immediately before the block is broadcast. If the block is found to be an equivocation it fails validation. * `Eth-Consensus-Version` (string; header; required): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`, `capella`, `deneb`. * `` (required): The `SignedBlindedBeaconBlock` object composed of `BlindedBeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v2/beacon/blinded_blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. ```json "string" ``` * `Code 202`: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database. ```json "string" ``` * `Code 400`: The `SignedBlindedBeaconBlock` object is invalid or broadcast validation failed. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 415`: The supplied content-type is not supported. ```json { "code": 415, "message": "Cannot read the supplied content type." } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/beacon-p3/ title: Ethereum Beacon — Beacon (3/3) source: docs/rpc-service/chains/chains-api/eth-beacon/beacon-p3.mdx --- # Ethereum Beacon — Beacon (3/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/eth-beacon/beacon/) · [2](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/) · 3 ## Beacon ### `POST /eth/v1/beacon/blocks` > Publishes a signed block. Instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. A success response (20x) indicates that the block passed gossip validation and was successfully broadcast onto the network. The beacon node is also expected to integrate the block into state, but may broadcast it before doing so, thus to aid timely delivery of the block. Should the block fail full validation, a separate success response code (202) is used to indicate that the block was successfully broadcast but failed integration. After Deneb, this additionally instructs the beacon node to broadcast all given blobs. #### Parameters * `Eth-Consensus-Version` (string; header): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`, `capella`, `deneb`. * `` (required): the `SignedBeaconBlock` object composed of the `BeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. ```json "string" ``` * `Code 202`: The block could not be integrated into the beacon node's database as it failed validation, but was successfully broadcast. ```json "string" ``` * `Code 400`: The `SignedBeaconBlock` object is invalid and could not be broadcast. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 415`: The supplied content-type is not supported. ```json { "code": 415, "message": "Cannot read the supplied content type." } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v2/beacon/blocks` > Publishes a signed block. Instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. A success response (20x) indicates that the block passed gossip validation and was successfully broadcast onto the network. The beacon node is also expected to integrate the block into the state, but may broadcast it before doing so, so as to aid timely delivery of the block. Should the block fail full validation, a separate success response code (202) is used to indicate that the block was successfully broadcast but failed integration. After Deneb, this additionally instructs the beacon node to broadcast all given blobs. The broadcast behaviour may be adjusted via the `broadcast_validation` query parameter. #### Parameters * `broadcast_validation` (string; query): level of validation that must be applied to a block before it is broadcast. Possible values:
* `gossip` (default): lightweight gossip checks only. * `consensus`: full consensus checks, including validation of all signatures and blocks fields except for the execution payload transactions. * `consensus_and_equivocation`: the same as `consensus`, with an extra equivocation check immediately before the block is broadcast. If the block is found to be an equivocation it fails validation. * `Eth-Consensus-Version` (string; header): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`, `capella`, `deneb`. * `` (required): the `SignedBeaconBlock` object composed of the `BeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v2/beacon/blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. ```json "string" ``` * `Code 202`: The block could not be integrated into the beacon node's database as it failed validation, but was successfully broadcast. ```json "string" ``` * `Code 400`: The `SignedBeaconBlock` object is invalid or broadcast validation failed. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 415`: The supplied content-type is not supported. ```json { "code": 415, "message": "Cannot read the supplied content type." } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/beacon/ title: Ethereum Beacon — Beacon (1/3) source: docs/rpc-service/chains/chains-api/eth-beacon/beacon.mdx --- # Ethereum Beacon — Beacon (1/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/) · [3](/rpc-service/chains/chains-api/eth-beacon/beacon-p3/) ## Beacon ### `GET /eth/v1/beacon/genesis` > Retrieves the details of the chain's genesis. Returns the details of the chain's genesis which can be used to identify chain. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/genesis" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "data": { "genesis_time": "1590832934", "genesis_validators_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "genesis_fork_version": "0x00000000" } } ``` * `400`: Chain genesis info is not yet known. ```json { "code": 404, "message": "Chain genesis info is not yet known" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/root` > Retrieves the state SSZ HashTreeRoot. Calculates HashTreeRoot for state with given 'stateId'. If stateId is root, same value will be returned. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/root" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } ``` * `400`: Invalid state ID. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/fork` > Retrieves the Fork object for a requested state. Retrieves the [Fork](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/beacon-chain.md#fork) object for state with given 'stateId'. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/fork" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "data": { "previous_version": "0x00000000", "current_version": "0x00000000", "epoch": "1" } } ``` * `400`: Invalid state ID. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/finality_checkpoints` > Retrieves state finality checkpoints. Returns finality checkpoints for state with given 'stateId'. In case finality is not yet achieved, checkpoint should return epoch 0 and ZERO_HASH as root. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/finality_checkpoints" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "previous_justified": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "current_justified": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "finalized": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ``` * `400`: Invalid state ID. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/validators` > Retrieves validators from state. Returns filterable list of validators with their balance, status, and index. Information will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no information will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; both the index and public key are returned for each validator, and can be used to confirm for which inputs a response has been returned. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. * `id` (array[string]; query): either a hex encoded public key (any bytes48 with 0x prefix) or validator index. * `status` (array; query): see the [validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ). #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validators" \ -H "Accept: application/json" ``` #### Responses * `200`: Success ```json { "execution_optimistic": false, "finalized": false, "data": [ { "index": "1", "balance": "1", "status": "active_ongoing", "validator": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "effective_balance": "1", "slashed": false, "activation_eligibility_epoch": "1", "activation_epoch": "1", "exit_epoch": "1", "withdrawable_epoch": "1" } } ] } ``` * `400`: Invalid state or validator ID, or status. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `414`: Too many validator IDs. ```json { "code": 414, "message": "Too many validator IDs in request" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/states/{state_id}/validators` > Retrieves validators from state. Returns filterable list of validators with their balance, status and index. Information will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no information will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; both the index and public key are returned for each validator, and can be used to confirm for which inputs a response has been returned. The `POST` variant of this endpoint has the same semantics as the GET endpoint but passes the lists of IDs and statuses via a `POST` body in order to enable larger requests. * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. * `` (required): The lists of validator IDs and statuses to filter on. Either or both may be `null` to signal that no filtering on that attribute is desired. ```json { "ids": [ "string" ], "statuses": [ "active_ongoing" ] } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validators" \ -H "Accept: application/json" -d '{ "ids": [ "string" ], "statuses": [ "active_ongoing" ] }' ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": [ { "index": "1", "balance": "1", "status": "active_ongoing", "validator": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "effective_balance": "1", "slashed": false, "activation_eligibility_epoch": "1", "activation_epoch": "1", "exit_epoch": "1", "withdrawable_epoch": "1" } } ] } ``` * `400`: Invalid state or validator ID, or status. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}` > Retrieves the validator from state by ID. Returns validator specified by state and id or public key along with status and balance. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. * `validator_id` (string; path; required): either a hex encoded public key (any bytes48 with 0x prefix) or validator index. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validators/{validator_id}" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "index": "1", "balance": "1", "status": "active_ongoing", "validator": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "effective_balance": "1", "slashed": false, "activation_eligibility_epoch": "1", "activation_epoch": "1", "exit_epoch": "1", "withdrawable_epoch": "1" } } } ``` * `400`: Invalid state or validator ID, or status. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/validator_balances` > Retrieves validator balances from state. Returns filterable list of validators balances. Balances will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no balance will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; the index and is returned for each balance, and can be used to confirm for which inputs a response has been returned. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. * `id` (array[string]; query): either a hex encoded public key (any bytes48 with 0x prefix) or validator index. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validator_balances" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": [ { "index": "1", "balance": "1" } ] } ``` * `400`: Invalid state or validator ID, or status. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `414`: Too many validator IDs. ```json { "code": 414, "message": "Too many validator IDs in request" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/states/{state_id}/validator_balances` > Retrieves validator balances from state. Returns filterable list of validators balances. Balances will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no balance will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; the index is returned for each balance, and can be used to confirm for which inputs a response has been returned. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. * ``: an array of either hex encoded public key (any bytes48 with 0x prefix) or validator index. ```json [ "string" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validator_balances" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '[ "string" ]' ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": [ { "index": "1", "balance": "1" } ] } ``` * `400`: Invalid state or validator ID, or status. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/committees` > Retrieves all committees for a state. Retrieves the committees for the given state. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. * `epoch` (string; query): fetches committees for the given epoch; if not present then the committees for the epoch of the state will be obtained. * `index` (string; query): restricts returned values to those matching the supplied committee index. * `slot` (string; query): restricts returned values to those matching the supplied slot. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/committees" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": [ { "index": "1", "slot": "1", "validators": [ "1" ] } ] } ``` * `400`: Invalid state ID, index, epoch, slot, or combination thereof. ```json { "code": 400, "message": "Slot does not belong in epoch" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/sync_committees` > Retrieves sync committees for a state. Retrieves the current sync committee for the given state. Also returns the subcommittee assignments. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. * `epoch` (string; query): fetches sync committees for the given epoch; if not present then the sync committees for the epoch of the state will be obtained. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/sync_committees" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "validators": [ "1" ], "validator_aggregates": [ [ "1" ] ] } } ``` * `400`: Invalid state ID, index, epoch, slot, or combination thereof. ```json { "code": 400, "message": "Slot does not belong in epoch" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/randao` > Retrieves the RANDAO mix for some epoch in a specified state. Fetch the RANDAO mix for the requested epoch from the state identified by `state_id`. If an epoch is not specified then the RANDAO mix for the state's current epoch will be returned. By adjusting the `state_id` parameter you can query for any historic value of the RANDAO mix. Ordinarily states from the same epoch will mutate the RANDAO mix for that epoch as blocks are applied. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. * `epoch` (string; query): fetches sync committees for the given epoch; if not present then the sync committees for the epoch of the state will be obtained. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/randao" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } ``` * `400`: Invalid state ID or epoch. ```json { "code": 400, "message": "Epoch is out of range for the `randao_mixes` of the state" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/headers` > Retrieves block headers. Retrieves block headers matching given query. By default, it will fetch current head slot blocks. #### Parameters * `slot` (string; query): a slot. * `parent_root` (string, hex; query): a parent root. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/headers" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": [ { "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "canonical": true, "header": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ] } ``` * `400`: The block ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid block ID: current" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/builder-p2/ title: Ethereum Beacon — Builder, Config, Debug, Events, Node, Validator (2/3) source: docs/rpc-service/chains/chains-api/eth-beacon/builder-p2.mdx --- # Ethereum Beacon — Builder, Config, Debug, Events, Node, Validator (2/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/eth-beacon/builder/) · 2 · [3](/rpc-service/chains/chains-api/eth-beacon/builder-p3/) ## Node Endpoints to query node related information. ### `GET /eth/v1/node/identity` > Retrieves node network identity. Retrieves data about the node's network presence. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/identity" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "data": { "peer_id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N", "enr": "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8", "p2p_addresses": [ "/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N" ], "discovery_addresses": [ "/ip4/7.7.7.7/udp/30303/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N" ], "metadata": { "seq_number": "1", "attnets": "0x0000000000000000", "syncnets": "0x0f" } } } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/peers` > Retrieves node network peers. Retrieves data about the node's network peers. By default, this returns all peers. Multiple query params are combined using AND conditions. #### Parameters * `state` (array[string]; query): available values : `disconnected`, `connecting`, `connected`, `disconnecting`. * `direction` (array[string]; query): available values : `inbound`, `outbound`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/peers" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "peer_id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N", "enr": "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8", "last_seen_p2p_address": "/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N", "state": "disconnected", "direction": "inbound" } ], "meta": { "count": 1 } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/peers/{peer_id}` > Retrieves a peer. Retrieves data about the given peer. #### Parameters * `peer_id` (string; path; required): a peer ID; example: `QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/peers/{peer_id}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "peer_id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N", "enr": "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8", "last_seen_p2p_address": "/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N", "state": "disconnected", "direction": "inbound" } } ``` * `Code 400`: The peer ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid peer ID: localhost" } ``` * `Code 404`: Peer not found. ```json { "code": 404, "message": "Peer not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/peer_count` > Retrieves peer count. Retrieves number of known peers. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/peer_count" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "disconnected": "12", "connecting": "34", "connected": "56", "disconnecting": "5" } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/version` > Retrieves a version string of the running Beacon node. Requests that the beacon node identify information about its implementation in a format similar to an [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) field. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/version" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "version": "Lighthouse/v0.1.5 (Linux x86_64)" } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/syncing` > Retrieves a node syncing status. Requests the beacon node to describe if it's currently syncing or not, and if it is, what block it is up to. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/syncing" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "head_slot": "1", "sync_distance": "1", "is_syncing": true, "is_optimistic": true, "el_offline": true } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/health` > Retrieves health check. Returns node health status in http status codes. Useful for load balancers. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/health" ``` #### Responses * `Code 200`: Node is ready. * `Code 206`: Node is syncing but can serve incomplete data. * `Code 400`: Invalid syncing status code. * `Code 503`: Node not initialized or having issues. --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/builder-p3/ title: Ethereum Beacon — Builder, Config, Debug, Events, Node, Validator (3/3) source: docs/rpc-service/chains/chains-api/eth-beacon/builder-p3.mdx --- # Ethereum Beacon — Builder, Config, Debug, Events, Node, Validator (3/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/eth-beacon/builder/) · [2](/rpc-service/chains/chains-api/eth-beacon/builder-p2/) · 3 ## Validator Endpoints intended for validator clients. ### `POST /eth/v1/validator/duties/attester/{epoch}` > Retrieves attester duties. Requests the beacon node to provide a set of attestation duties, which should be performed by validators, for a particular epoch. Duties should only need to be checked once per epoch, however a chain reorganization (of > MIN_SEED_LOOKAHEAD epochs) could occur, resulting in a change of duties. For full safety, you should monitor head events and confirm the dependent root in this response matches: * event.previous_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch` * event.current_duty_dependent_root when `compute_epoch_at_slot(event.slot) + 1 == epoch` * event.block otherwise The dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)` or the genesis block root in the case of underflow. #### Parameters * `epoch` (string; path; required): should only be allowed one epoch ahead. * `` (required): an array of the validator indices for which to obtain the duties: ```json [ "1" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/attester/{epoch}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. ```json { "dependent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "committee_index": "1", "committee_length": "1", "committees_at_slot": "1", "validator_committee_index": "1", "slot": "1" } ] } ``` * `Code 400`: Invalid epoch or index. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/duties/proposer/{epoch}` > Retrieves block proposer duties. Request beacon node to provide all validators that are scheduled to propose a block in the given epoch. Duties should only need to be checked once per epoch, however a chain reorganization could occur that results in a change of duties. For full safety, you should monitor head events and confirm the dependent root in this response matches: * event.current_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch` * event.block otherwise The dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)` or the genesis block root in the case of underflow. #### Parameters * `epoch` (string; path; required); an epoch. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/proposer/{epoch}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "dependent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "slot": "1" } ] } ``` * `Code 400`: Invalid epoch. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/duties/sync/{epoch}` > Retrieves sync committee duties. Requests the beacon node to provide a set of sync committee duties for a particular epoch. #### Parameters * `epoch` (string; path; required): `epoch` // `EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch` // `EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1` * `` (required): an array of the validator indices for which to obtain the duties: ```json [ "1" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/sync/{epoch}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. ```json { "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "validator_sync_committee_indices": [ "1" ] } ] } ``` * `Code 400`: Invalid epoch or index. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v3/validator/blocks/{slot}` > Produces a new block, without signature. Requests a beacon node to produce a valid block, which can then be signed by a validator. The returned block may be blinded or unblinded, depending on the current state of the network as decided by the execution and beacon nodes. The beacon node must return an unblinded block if it obtains the execution payload from its paired execution node. It must only return a blinded block if it obtains the execution payload header from an MEV relay. Metadata in the response indicates the type of block produced, and the supported types of block will be added to as forks progress. #### Parameters * `slot` (string; path; required): the slot for which the block should be proposed. * `randao_reveal` (string; hex; query; required): the validator's randao reveal value. * `graffiti` (string; hex; query): an arbitrary data validator to include in the block. * `skip_randao_verification` (query): skip verification of the `randao_reveal` value. If this flag is set then the `randao_reveal` must be set to the point at infinity (`0xc0..00`). This query parameter is a flag and does not take a value. * `builder_boost_factor` (string; query): Percentage multiplier to apply to the builder's payload value when choosing between a builder payload header and payload from the paired execution node. This parameter is only relevant if the beacon node is connected to a builder, deems it safe to produce a builder payload, and receives valid responses from both the builder endpoint and the paired execution node. When these preconditions are met, the server MUST act as follows: * if `exec_node_payload_value >= builder_boost_factor * (builder_payload_value // 100)`, then return a full (unblinded) block containing the execution node payload. * otherwise, return a blinded block containing the builder payload header. Servers must support the following values of the boost factor which encode common preferences: * `builder_boost_factor=0`: prefer the execution node payload unless an error makes it unviable. * `builder_boost_factor=100`: default profit maximization mode; choose whichever payload pays more. * `builder_boost_factor=2**64 - 1`: prefer the builder payload unless an error or beacon node health check makes it unviable. Servers should use saturating arithmetic or another technique to ensure that large values of the `builder_boost_factor` do not trigger overflows or errors. If this parameter is provided and the beacon node is not configured with a builder then the beacon node MUST respond with a full block, which the caller can choose to reject if it wishes. If this parameter is not provided then it should be treated as having the default value of 100. If the value is provided but out of range for a 64-bit unsigned integer, then an error response with status code 400 MUST be returned. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v3/validator/blocks/{slot}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Note: The `Eth-Consensus-Version` header is required in response so client can deserialize returned json or ssz data more effectively. ```json { "version": "phase0", "data": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xbF0eF8805DE094355C99fD34Df183ADB5BB153f5dac2eD83bee6eEd2dEf05cFC", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } } } ``` * `Code 400`: Invalid block production request. ```json { "code": 400, "message": "Invalid request to produce a block" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/attestation_data` > Produces attestation data. Requests that the beacon node produce an AttestationData. A 503 error must be returned if the block identified by the response `beacon_block_root` is optimistic (i.e. the attestation attests to a block that has not been fully verified by an execution engine). #### Parameters * `slot` (string; query; required): the slot for which an attestation data should be created. * `committee_index` (string; query; required): the committee index for which an attestation data should be created. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/attestation_data" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/aggregate_attestation` > Retrieves aggregated attestation. Aggregates all attestations matching given attestation data root and slot. A 503 error must be returned if the block identified by the response `beacon_block_root` is optimistic (i.e. the aggregated attestation attests to a block that has not been fully verified by an execution engine). A 404 error must be returned if no attestation is available for the requested `attestation_data_root`. #### Parameters * `attestation_data_root` (string; query; required): HashTreeRoot of AttestationData that validator wants aggregated. * `slot` (string; query; required): a slot. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_attestation" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Returns aggregated `Attestation` object with same `AttestationData` root. ```json { "data": { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 404`: Not found. ```json { "code": 404, "message": "Requested item not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/builder/ title: Ethereum Beacon — Builder, Config, Debug, Events, Node, Validator (1/3) source: docs/rpc-service/chains/chains-api/eth-beacon/builder.mdx --- # Ethereum Beacon — Builder, Config, Debug, Events, Node, Validator (1/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/eth-beacon/builder-p2/) · [3](/rpc-service/chains/chains-api/eth-beacon/builder-p3/) ## Builder Set of endpoints specific to building blocks. ### `GET /eth/v1/builder/states/{state_id}/expected_withdrawals` > Retrieves the withdrawals that are to be included for the block built on the specified state. Gets the withdrawals computed from the specified state, that will be included in the block that gets built on the specified state. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. * `proposal_slot` (string; query): the slot that a block is being built for, with the specified state as the parent. Defaults to the slot after the parent state if not specified. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/builder/states/{state_id}/expected_withdrawals" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": [ { "index": "1", "validator_index": "1", "address": "0xAbcF8e0d4e9587369b2301D0790347320302cc09", "amount": "1" } ] } ``` * `400`: An error occurred preparing the withdrawals from the specified state for the proposal slot. ```json { "code": 400, "message": "The specified state is not a capella state." } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ## Config Endpoints to query chain configuration, specification, and fork schedules. ### `GET /eth/v1/config/fork_schedule` > Retrieves scheduled upcoming forks. Retrieve all forks, past present and future, of which this node is aware. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/config/fork_schedule" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "previous_version": "0x00000000", "current_version": "0x00000000", "epoch": "1" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/config/spec` > Retrieves spec parameters. Retrieve specification configuration used on this node. The configuration should include: * Constants for all hard forks known by the beacon node, for example the [phase 0](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/beacon-chain.md#constants) and [altair](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/beacon-chain.md#constants) values. * Presets for all hard forks supplied to the beacon node, for example the [phase 0](https://github.com/ethereum/consensus-specs/blob/v1.3.0/presets/mainnet/phase0.yaml) and [altair](https://github.com/ethereum/consensus-specs/blob/v1.3.0/presets/mainnet/altair.yaml) values. * Configuration for the beacon node, for example the [mainnet](https://github.com/ethereum/consensus-specs/blob/v1.3.0/configs/mainnet.yaml) values. Values are returned with the following format: * Any value starting with 0x in the spec is returned as a hex string. * Numeric values are returned as a quoted integer. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/config/spec" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "DEPOSIT_CONTRACT_ADDRESS": "0x00000000219ab540356cBB839Cbe05303d7705Fa", "DEPOSIT_NETWORK_ID": "1", "DOMAIN_AGGREGATE_AND_PROOF": "0x06000000", "INACTIVITY_PENALTY_QUOTIENT": "67108864", "INACTIVITY_PENALTY_QUOTIENT_ALTAIR": "50331648" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/config/deposit_contract` > Retrieves a deposit contract address. Retrieve Eth1 deposit contract address and chain ID. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/config/deposit_contract" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "chain_id": "1", "address": "0x1Db3439a222C519ab44bb1144fC28167b4Fa6EE6" } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ## Debug ### `GET /eth/v2/debug/beacon/states/{state_id}` > Retrieves the full BeaconState object. Returns full BeaconState object for given stateId. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v2/debug/beacon/states/{state_id}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Note: The `Eth-Consensus-Version` header is required in response so client can deserialize returned json or ssz data more effectively. ```json { "version": "phase0", "execution_optimistic": false, "data": { "genesis_time": "1", "genesis_validators_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "slot": "1", "fork": { "previous_version": "0x00000000", "current_version": "0x00000000", "epoch": "1" }, "latest_block_header": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "block_roots": [], "slashings": [], "previous_epoch_attestations": [ { "aggregation_bits": "0x2ccfbd524ECbedfc70c91BE08b5668fA4ebdfD773B1fFe1daAbfC912c3cD4b2C93E1", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } }, "inclusion_delay": "1", "proposer_index": "1" } ], "current_epoch_attestations": [ { "aggregation_bits": "0xF9DD8ABe17ae0baDA640Bb0d8c4e81a349D3a", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } }, "inclusion_delay": "1", "proposer_index": "1" } ], "justification_bits": "0x01", "previous_justified_checkpoint": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "current_justified_checkpoint": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "finalized_checkpoint": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ``` * `Code 400`: Invalid state ID. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `Code 404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v2/debug/beacon/heads` > Retrieves fork choice leaves. Retrieves all possible chain heads (leaves of fork choice tree). #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v2/debug/beacon/heads" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "slot": "1", "execution_optimistic": false } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/debug/fork_choice` > Retrieves fork choice array. Retrieves all current fork choice context. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/debug/fork_choice" \ -H "Accept: text/event-stream" ``` #### Responses * `200`: Success. ```json { "justified_checkpoint": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "finalized_checkpoint": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "fork_choice_nodes": [ { "slot": "1", "block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "justified_epoch": "1", "finalized_epoch": "1", "weight": "1", "validity": "valid", "execution_block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "extra_data": {} } ], "extra_data": {} } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ## Events Set of endpoints for event subscription. ### `GET /eth/v1/events` > Subscribes to Beacon node events. Provides endpoint to subscribe to beacon node Server-Sent-Events stream. Consumers should use [eventsource](https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface) implementation to listen on those events. Servers *may* send SSE comments beginning with `:` for any purpose, including to keep the event stream connection alive in the presence of proxy servers. #### Parameters * `topics` (array[string]; query; required): event types to subscribe to; available values : `head`, `block`, `block_gossip`, `attestation`, `voluntary_exit`, `bls_to_execution_change`, `proposer_slashing`, `attester_slashing`, `finalized_checkpoint`, `chain_reorg`, `contribution_and_proof`, `light_client_finality_update`, `light_client_optimistic_update`, `payload_attributes`, `blob_sidecar`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/events" \ -H "Accept: text/event-stream" ``` #### Responses * `Code 200`: Opened SSE stream. **Head event**: The node has finished processing, resulting in a new head. previous_duty_dependent_root is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)` and `current_duty_dependent_root` is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)`. Both dependent roots use the genesis block root in the case of underflow. ```text event: head data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch_transition":false, "previous_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "current_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "execution_optimistic": false} ``` **Block event**: The node has received a valid block (from P2P or API). ```text event: block data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "execution_optimistic": false} ``` **Block gossip event**: The node has received a block (from P2P or API) that passes validation rules of the `beacon_block` topic. ```text event: block_gossip data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf"} ``` **Attestation event**: The node has received a valid attestation (from P2P or API). ```text event: attestation data: {"aggregation_bits":"0x01", "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data":{"slot":"1", "index":"1", "beacon_block_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}, "target":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}} ``` **Voluntary exit event**: The node has received a valid voluntary exit (from P2P or API). ```text event: voluntary_exit data: {"message":{"epoch":"1", "validator_index":"1"}, "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"} ``` **Proposer slashing event**: The node has received a ProposerSlashing (from P2P or API) that passes validation rules of the `proposer_slashing` topic. ```text event: proposer_slashing data: {"signed_header_1":{"message":{"slot":"0","proposer_index":"0","parent_root":"0x0000000000000000000000000000000000000000000000000000000000000000","state_root":"0x0000000000000000000000000000000000000000000000000000000000000000","body_root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"signed_header_2":{"message":{"slot":"0","proposer_index":"0","parent_root":"0x0000000000000000000000000000000000000000000000000000000000000000","state_root":"0x0000000000000000000000000000000000000000000000000000000000000000","body_root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}} ``` **Attester slashing event**: The node has received an AttesterSlashing (from P2P or API) that passes validation rules of the `attester_slashing` topic. ```text event: attester_slashing data: {"attestation_1":{"attesting_indices":["0", "1"],"data":{"slot":"0","index":"0","beacon_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","source":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"target":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"}},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"attestation_2":{"attesting_indices":["0", "1"],"data":{"slot":"0","index":"0","beacon_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","source":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"target":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"}},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}} ``` **BLS to execution change event**: The node has received a SignedBLSToExecutionChange (from P2P or API) that passes validation rules of the `bls_to_execution_change` topic. ```text event: bls_to_execution_change data: {"message":{"validator_index":"1", "from_bls_pubkey":"0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f7329267a8811c397529dac52ae1342ba58c95", "to_execution_address":"0x9Be8d619c56699667c1feDCD15f6b14D8B067F72"}, "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"} ``` **Finalized checkpoint event**: Finalized checkpoint has been updated. ```text event: finalized_checkpoint data: {"block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch":"2", "execution_optimistic": false } ``` **Chain reorg event**: The node has reorganized its chain. ```text event: chain_reorg data: {"slot":"200", "depth":"50", "old_head_block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "new_head_block":"0x76262e91970d375a19bfe8a867288d7b9cde43c8635f598d93d39d041706fc76", "old_head_state":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "new_head_state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch":"2", "execution_optimistic": false} ``` **Contribution and proof event**: The node has received a valid sync committee SignedContributionAndProof (from P2P or API). ```text event: contribution_and_proof data: {"message": {"aggregator_index": "997", "contribution": {"slot": "168097", "beacon_block_root": "0x56f1fd4262c08fa81e27621c370e187e621a67fc80fe42340b07519f84b42ea1", "subcommittee_index": "0", "aggregation_bits": "0xffffffffffffffffffffffffffffffff", "signature": "0x85ab9018e14963026476fdf784cc674da144b3dbdb47516185438768774f077d882087b90ad642469902e782a8b43eed0cfc1b862aa9a473b54c98d860424a702297b4b648f3f30bdaae8a8b7627d10d04cb96a2cc8376af3e54a9aa0c8145e3"}, "selection_proof": "0x87c305f04bfe5db27c2b19fc23e00d7ac496ec7d3e759cbfdd1035cb8cf6caaa17a36a95a08ba78c282725e7b66a76820ca4eb333822bd399ceeb9807a0f2926c67ce67cfe06a0b0006838203b493505a8457eb79913ce1a3bcd1cc8e4ef30ed"}, "signature": "0xac118511474a94f857300b315c50585c32a713e4452e26a6bb98cdb619936370f126ed3b6bb64469259ee92e69791d9e12d324ce6fd90081680ce72f39d85d50b0ff977260a8667465e613362c6d6e6e745e1f9323ec1d6f16041c4e358839ac"} ``` **Light client finality update event**: The node's latest known `LightClientFinalityUpdate` has been updated. ```text event: light_client_finality_update data: {"version":"altair", "data": {"attested_header": {"beacon": {"slot":"1", "proposer_index":"1", "parent_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}, "finalized_header": {"beacon": {"slot":"1", "proposer_index":"1", "parent_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}, "finality_branch": ["0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"], "sync_aggregate": {"sync_committee_bits":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffbffffffffffffffffffffbffffffffffffff", "sync_committee_signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"}, "signature_slot":"1"}} ``` **Light client optimistic update event**: The node's latest known `LightClientOptimisticUpdate` has been updated. ```text event: light_client_optimistic_update data: {"version":"altair", "data": {"attested_header": {"beacon": {"slot":"1", "proposer_index":"1", "parent_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}, "sync_aggregate": {"sync_committee_bits":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffbffffffffffffffffffffbffffffffffffff", "sync_committee_signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"}, "signature_slot":"1"}} ``` **Payload attributes event**: The node has computed new payload attributes for execution payload building. This event gives block builders and relays sufficient information to construct or verify a block at proposal_slot. The meanings of the fields are: * `version`: the identifier of the beacon hard fork at proposal_slot, e.g. "bellatrix", "capella". * `proposal_slot`: the slot at which a block using these payload attributes may be built. * `parent_block_root`: the beacon block root of the parent block to be built upon. * `parent_block_number`: the execution block number of the parent block. * `parent_block_hash`: the execution block hash of the parent block. * `proposer_index`: the validator index of the proposer at `proposal_slot` on the chain identified by `parent_block_root`. * `payload_attributes`: beacon API encoding of `PayloadAttributesV` as defined by the execution-apis specification. The version `N` must match the payload attributes for the hard fork matching `version`. The beacon API encoded object must have equivalent fields to its counterpart in `execution-apis` with two differences: 1) `snake_case` identifiers must be used rather than `camelCase`; 2) integers must be encoded as quoted decimals rather than big-endian hex. The frequency at which this event is sent may depend on beacon node configuration. The fee recipient may also be set via beacon node config, but should likely be ignored by block builders and most other API consumers. ```text event: payload_attributes data: {"version": "capella", "data": {"proposer_index": "123", "proposal_slot": "10", "parent_block_number": "9", "parent_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "parent_block_hash": "0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "payload_attributes": {"timestamp": "123456", "prev_randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "suggested_fee_recipient": "0x0000000000000000000000000000000000000000", "withdrawals": [{"index": "5", "validator_index": "10", "address": "0x0000000000000000000000000000000000000000", "amount": "15640"}]}}} ``` **Blob sidecar event**: The node has received a BlobSidecar (from P2P or API) that passes all gossip validations on the `blob_sidecar_{subnet_id}` topic. ```text event: blob_sidecar data: {"block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "index": "1", "slot": "1", "kzg_commitment": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "versioned_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"} ``` * `Code 400`: The topics supplied could not be parsed. ```json { "code": 400, "message": "Invalid topic: weather_forecast" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/ title: Ethereum Beacon description: Ethereum Beacon — The Beacon Chain is a consensus layer that introduced a proof-of-stake to Ethereum. Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/eth-beacon/index.mdx --- # Ethereum Beacon
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Ethereum Beacon API is available on [Web3 API platform](https://www.ankr.com/rpc/eth) upon switching on the **Beacon** toggle. The *Beacon Chain* is a consensus layer that introduced a [proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) to Ethereum. The Beacon Chain mechanism is responsible for creating new blocks, making sure those new blocks are valid, and rewarding validators with ETH for keeping the network secure. In order for your Web3 application to interact with the Beacon Chain — either by reading blockchain data or sending transactions to the network — it must connect to a Beacon node. Developers interact with the blockchain using the methods provided by the API. Beacon API uses the REST interface for querying, responses come in [JSON format](https://www.json.org/json-en.html). ## Methods supported **Beacon**: * [`GET /eth/v1/beacon/genesis`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beacongenesis) — retrieves the details of the chain's genesis. * [`GET /eth/v1/beacon/states/{state_id}/root`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idroot) — retrieves the state SSZ HashTreeRoot. * [`GET /eth/v1/beacon/states/{state_id}/fork`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idfork) — retrieves the Fork object for a requested state. * [`GET /eth/v1/beacon/states/{state_id}/finality_checkpoints`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idfinality_checkpoints) — retrieves state finality checkpoints. * [`GET /eth/v1/beacon/states/{state_id}/validators`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idvalidators) — retrieves validators from state. * [`POST /eth/v1/beacon/states/{state_id}/validators`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idvalidators) — retrieves validators from state. * [`GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idvalidatorsvalidator_id) — retrieves the validator from state by ID. * [`GET /eth/v1/beacon/states/{state_id}/validator_balances`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idvalidator_balances) — retrieves validator balances from state. * [`GET /eth/v1/beacon/states/{state_id}/committees`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idcommittees) — retrieves all committees for a state. * [`GET /eth/v1/beacon/states/{state_id}/sync_committees`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idsync_committees) — retrieves sync committees for a state. * [`GET /eth/v1/beacon/headers`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconheaders) — retrieves block headers. * [`GET /eth/v1/beacon/headers/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/#get-ethv1beaconheadersblock_id) — retrieves a block header. * [`POST /eth/v1/beacon/blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p3/#post-ethv1beaconblocks) — publishes a signed block. * [`POST /eth/v1/beacon/blinded_blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/#post-ethv1beaconblinded_blocks) — publishes a signed block. * [`GET /eth/v2/beacon/blocks/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv2beaconblocksblock_id) — retrieves a block. * [`GET /eth/v1/beacon/blocks/{block_id}/root`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv1beaconblocksblock_idroot) — retrieves a block root. * [`GET /eth/v1/beacon/blocks/{block_id}/attestations`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv1beaconblocksblock_idattestations) — retrieves block attestations. * [`GET /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#get-ethv1beaconpoolattestations) — retrieves attestations from the operations pool. * [`POST /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolattestations) — submits attestation objects to the node. * [`GET /eth/v1/beacon/pool/attester_slashings`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#get-ethv1beaconpoolattester_slashings) — retrieves attester slashings from the operations pool. * [`POST /eth/v1/beacon/pool/attester_slashings`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolattester_slashings) — submits the AttesterSlashing object to the node's pool. * [`GET /eth/v1/beacon/pool/proposer_slashings`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#get-ethv1beaconpoolproposer_slashings) — retrieves proposer slashings from the operations pool. * [`POST /eth/v1/beacon/pool/proposer_slashings`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolproposer_slashings) — submits the ProposerSlashing object to the node's pool. * [`POST /eth/v1/beacon/pool/sync_committees`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolsync_committees) — submits sync committee signatures to the node. * [`GET /eth/v1/beacon/pool/voluntary_exits`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#get-ethv1beaconpoolvoluntary_exits) — retrieves SignedVoluntaryExit from the operations pool. * [`POST /eth/v1/beacon/pool/voluntary_exits`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolvoluntary_exits) — submits the SignedVoluntaryExit object to the node's pool. **Builder**: * [`GET /eth/v1/builder/states/{state_id}/expected_withdrawals`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1builderstatesstate_idexpected_withdrawals) — retrieves the withdrawals that are to be included for the block built on the specified state. **Config**: * [`GET /eth/v1/config/fork_schedule`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1configfork_schedule) — retrieves scheduled upcoming forks. * [`GET /eth/v1/config/spec`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1configspec) — retrieves spec parameters. * [`GET /eth/v1/config/deposit_contract`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1configdeposit_contract) — retrieves a deposit contract address. **Debug**: * [`GET /eth/v2/debug/beacon/states/{state_id}`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv2debugbeaconstatesstate_id) — retrieves the full BeaconState object. * [`GET /eth/v2/debug/beacon/heads`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv2debugbeaconheads) — retrieves fork choice leaves. * [`GET /eth/v1/debug/fork_choice`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1debugfork_choice) — retrieves fork choice array. **Events**: * [`GET /eth/v1/events`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1events) — subscribes to Beacon node events. **Node**: * [`GET /eth/v1/node/identity`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodeidentity) — retrieves node network identity. * [`GET /eth/v1/node/peers`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodepeers) — retrieves node network peers. * [`GET /eth/v1/node/peers/{peer_id}`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodepeerspeer_id) — retrieves a peer. * [`GET /eth/v1/node/peer_count`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodepeer_count) — retrieves peer count. * [`GET /eth/v1/node/version`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodeversion) — retrieves a version string of the running Beacon node. * [`GET /eth/v1/node/syncing`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodesyncing) — retrieves a node syncing status. * [`GET /eth/v1/node/health`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodehealth) — retrieves health check. **Validator**: * [`POST /eth/v1/validator/duties/attester/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#post-ethv1validatordutiesattesterepoch) — retrieves attester duties. * [`GET /eth/v1/validator/duties/proposer/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatordutiesproposerepoch) — retrieves block proposer duties. * [`POST /eth/v1/validator/duties/sync/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#post-ethv1validatordutiessyncepoch) — retrieves sync committee duties. * [`GET /eth/v3/validator/blocks/{slot}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv3validatorblocksslot) — produces a new block, without signature. * [`GET /eth/v1/validator/attestation_data`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatorattestation_data) — produces attestation data. * [`GET /eth/v1/validator/aggregate_attestation`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatoraggregate_attestation) — retrieves aggregated attestation. * [`POST /eth/v1/validator/aggregate_and_proofs`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatoraggregate_and_proofs) — publishes multiple aggregate and proofs. * [`POST /eth/v1/validator/beacon_committee_subscriptions`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorbeacon_committee_subscriptions) — signals the Beacon node to prepare for a committee subnet. * [`POST /eth/v1/validator/sync_committee_subscriptions`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorsync_committee_subscriptions) — subscribes to sync committee subnets. * [`POST /eth/v1/validator/beacon_committee_selections`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorbeacon_committee_selections) — determines if a distributed validator has been selected to aggregate attestations. * [`GET /eth/v1/validator/sync_committee_contribution`](/rpc-service/chains/chains-api/eth-beacon/validator/#get-ethv1validatorsync_committee_contribution) — produces a sync committee contribution. * [`POST /eth/v1/validator/sync_committee_selections`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorsync_committee_selections) — determines if a distributed validator has been selected to make a sync committee contribution. * [`POST /eth/v1/validator/contribution_and_proofs`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorcontribution_and_proofs) — publishes multiple contribution and proofs. * [`POST /eth/v1/validator/prepare_beacon_proposer`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorprepare_beacon_proposer) — provides the Beacon node with proposals for the given validators. * [`POST /eth/v1/validator/register_validator`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorregister_validator) — provides the Beacon node with registrations for the given validators to the external builder network. * [`POST /eth/v1/validator/liveness/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorlivenessepoch) — indicates if a validator has been observed on the network. **ValidatorRequiredApi**: * [`GET /eth/v1/beacon/genesis`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beacongenesis) — retrieves details of the chain's genesis. * [`GET /eth/v1/beacon/states/{state_id}/fork`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idfork) — retrieves the Fork object for a requested state. * [`GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idvalidatorsvalidator_id) — retrieves the validator from state by ID. * [`POST /eth/v1/beacon/blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p3/#post-ethv1beaconblocks) — publishes a signed block. * [`POST /eth/v2/beacon/blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p3/#post-ethv2beaconblocks) — publishes a signed block. * [`POST /eth/v1/beacon/blinded_blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/#post-ethv1beaconblinded_blocks) — publishes a signed block. * [`POST /eth/v2/beacon/blinded_blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/#post-ethv2beaconblinded_blocks) — publishes a signed block. * [`POST /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolattestations) — submits attestation objects to the node. * [`POST /eth/v1/beacon/pool/sync_committees`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolsync_committees) — submits sync committee signatures to the node. * [`GET /eth/v1/node/syncing`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodesyncing) — retrieves a node syncing status. * [`GET /eth/v1/config/spec`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1configspec) — retrieves spec parameters. * [`POST /eth/v1/validator/duties/attester/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#post-ethv1validatordutiesattesterepoch) — retrieves attester duties. * [`GET /eth/v1/validator/duties/proposer/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatordutiesproposerepoch) — retrieves block proposer duties. * [`POST /eth/v1/validator/duties/sync/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#post-ethv1validatordutiessyncepoch) — retrieves sync committee duties. * [`GET /eth/v3/validator/blocks/{slot}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv3validatorblocksslot) — produces a new block, without signature. * [`GET /eth/v1/validator/attestation_data`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatorattestation_data) — produces attestation data. * [`GET /eth/v1/validator/aggregate_attestation`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatoraggregate_attestation) — retrieves aggregated attestation. * [`POST /eth/v1/validator/aggregate_and_proofs`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatoraggregate_and_proofs) — publishes multiple aggregate and proofs. * [`POST /eth/v1/validator/beacon_committee_subscriptions`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorbeacon_committee_subscriptions) — signals the Beacon node to prepare for a committee subnet. * [`POST /eth/v1/validator/sync_committee_subscriptions`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorsync_committee_subscriptions) — subscribes to sync committee subnets. * [`GET /eth/v1/validator/sync_committee_contribution`](/rpc-service/chains/chains-api/eth-beacon/validator/#get-ethv1validatorsync_committee_contribution) — produces a sync committee contribution. * [`POST /eth/v1/validator/contribution_and_proofs`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorcontribution_and_proofs) — publishes multiple contribution and proofs. * [`POST /eth/v1/validator/prepare_beacon_proposer`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorprepare_beacon_proposer) — provides the Beacon node with proposals for the given validators. * [`GET /eth/v1/events`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1events) — subscribes to Beacon node events. **Rewards**: * [`POST /eth/v1/beacon/rewards/sync_committee/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#post-ethv1beaconrewardssync_committeeblock_id) — retrieves sync committee rewards. * [`GET /eth/v1/beacon/rewards/blocks/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv1beaconrewardsblocksblock_id) — retrieves sync committee rewards. * [`POST /eth/v1/beacon/rewards/attestations/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#post-ethv1beaconrewardsattestationsepoch) — retrieves attestations rewards. --- ## Methods ### Beacon - [`GET /eth/v1/beacon/genesis`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beacongenesis) - [`GET /eth/v1/beacon/states/{state_id}/root`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idroot) - [`GET /eth/v1/beacon/states/{state_id}/fork`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idfork) - [`GET /eth/v1/beacon/states/{state_id}/finality_checkpoints`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idfinality_checkpoints) - [`GET /eth/v1/beacon/states/{state_id}/validators`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idvalidators) - [`POST /eth/v1/beacon/states/{state_id}/validators`](/rpc-service/chains/chains-api/eth-beacon/beacon/#post-ethv1beaconstatesstate_idvalidators) - [`GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idvalidatorsvalidator_id) - [`GET /eth/v1/beacon/states/{state_id}/validator_balances`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idvalidator_balances) - [`POST /eth/v1/beacon/states/{state_id}/validator_balances`](/rpc-service/chains/chains-api/eth-beacon/beacon/#post-ethv1beaconstatesstate_idvalidator_balances) - [`GET /eth/v1/beacon/states/{state_id}/committees`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idcommittees) - [`GET /eth/v1/beacon/states/{state_id}/sync_committees`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idsync_committees) - [`GET /eth/v1/beacon/states/{state_id}/randao`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idrandao) - [`GET /eth/v1/beacon/headers`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconheaders) - [`GET /eth/v1/beacon/headers/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/#get-ethv1beaconheadersblock_id) - [`Responses`](/rpc-service/chains/chains-api/eth-beacon/validator/#responses-13) - [`POST /eth/v1/beacon/blinded_blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/#post-ethv1beaconblinded_blocks) - [`POST /eth/v2/beacon/blinded_blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/#post-ethv2beaconblinded_blocks) - [`POST /eth/v1/beacon/blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p3/#post-ethv1beaconblocks) - [`POST /eth/v2/beacon/blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p3/#post-ethv2beaconblocks) ### Beacon - [`GET /eth/v2/beacon/blocks/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv2beaconblocksblock_id) - [`GET /eth/v1/beacon/blocks/{block_id}/root`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv1beaconblocksblock_idroot) - [`GET /eth/v1/beacon/blocks/{block_id}/attestations`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv1beaconblocksblock_idattestations) - [`GET /eth/v1/beacon/blob_sidecars/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv1beaconblob_sidecarsblock_id) - [`POST /eth/v1/beacon/rewards/sync_committee/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#post-ethv1beaconrewardssync_committeeblock_id) - [`GET /eth/v1/beacon/deposit_snapshot`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv1beacondeposit_snapshot) - [`GET /eth/v1/beacon/rewards/blocks/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv1beaconrewardsblocksblock_id) - [`POST /eth/v1/beacon/rewards/attestations/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#post-ethv1beaconrewardsattestationsepoch) - [`GET /eth/v1/beacon/blinded_blocks/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p2/#get-ethv1beaconblinded_blocksblock_id) - [`GET /eth/v1/beacon/light_client/bootstrap/{block_root}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p2/#get-ethv1beaconlight_clientbootstrapblock_root) - [`GET /eth/v1/beacon/light_client/updates`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p2/#get-ethv1beaconlight_clientupdates) - [`GET /eth/v1/beacon/light_client/finality_update`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p2/#get-ethv1beaconlight_clientfinality_update) - [`GET /eth/v1/beacon/light_client/optimistic_update`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#get-ethv1beaconlight_clientoptimistic_update) - [`GET /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#get-ethv1beaconpoolattestations) - [`POST /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolattestations) - [`GET /eth/v1/beacon/pool/attester_slashings`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#get-ethv1beaconpoolattester_slashings) - [`POST /eth/v1/beacon/pool/attester_slashings`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolattester_slashings) - [`GET /eth/v1/beacon/pool/proposer_slashings`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#get-ethv1beaconpoolproposer_slashings) - [`POST /eth/v1/beacon/pool/proposer_slashings`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolproposer_slashings) - [`POST /eth/v1/beacon/pool/sync_committees`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolsync_committees) - [`GET /eth/v1/beacon/pool/voluntary_exits`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#get-ethv1beaconpoolvoluntary_exits) - [`POST /eth/v1/beacon/pool/voluntary_exits`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolvoluntary_exits) - [`GET /eth/v1/beacon/pool/bls_to_execution_changes`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#get-ethv1beaconpoolbls_to_execution_changes) - [`POST /eth/v1/beacon/pool/bls_to_execution_changes`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolbls_to_execution_changes) ### Builder, Config, Debug, Events, Node, Validator - [`GET /eth/v1/builder/states/{state_id}/expected_withdrawals`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1builderstatesstate_idexpected_withdrawals) - [`GET /eth/v1/config/fork_schedule`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1configfork_schedule) - [`GET /eth/v1/config/spec`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1configspec) - [`GET /eth/v1/config/deposit_contract`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1configdeposit_contract) - [`GET /eth/v2/debug/beacon/states/{state_id}`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv2debugbeaconstatesstate_id) - [`GET /eth/v2/debug/beacon/heads`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv2debugbeaconheads) - [`GET /eth/v1/debug/fork_choice`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1debugfork_choice) - [`GET /eth/v1/events`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1events) - [`GET /eth/v1/node/identity`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodeidentity) - [`GET /eth/v1/node/peers`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodepeers) - [`GET /eth/v1/node/peers/{peer_id}`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodepeerspeer_id) - [`GET /eth/v1/node/peer_count`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodepeer_count) - [`GET /eth/v1/node/version`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodeversion) - [`GET /eth/v1/node/syncing`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodesyncing) - [`GET /eth/v1/node/health`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodehealth) - [`POST /eth/v1/validator/duties/attester/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#post-ethv1validatordutiesattesterepoch) - [`GET /eth/v1/validator/duties/proposer/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatordutiesproposerepoch) - [`POST /eth/v1/validator/duties/sync/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#post-ethv1validatordutiessyncepoch) - [`GET /eth/v3/validator/blocks/{slot}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv3validatorblocksslot) - [`GET /eth/v1/validator/attestation_data`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatorattestation_data) - [`GET /eth/v1/validator/aggregate_attestation`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatoraggregate_attestation) ### Validator, ValidatorRequiredApi - [`POST /eth/v1/validator/aggregate_and_proofs`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatoraggregate_and_proofs) - [`POST /eth/v1/validator/beacon_committee_subscriptions`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorbeacon_committee_subscriptions) - [`POST /eth/v1/validator/sync_committee_subscriptions`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorsync_committee_subscriptions) - [`POST /eth/v1/validator/beacon_committee_selections`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorbeacon_committee_selections) - [`GET /eth/v1/validator/sync_committee_contribution`](/rpc-service/chains/chains-api/eth-beacon/validator/#get-ethv1validatorsync_committee_contribution) - [`POST /eth/v1/validator/sync_committee_selections`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorsync_committee_selections) - [`POST /eth/v1/validator/contribution_and_proofs`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorcontribution_and_proofs) - [`POST /eth/v1/validator/prepare_beacon_proposer`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorprepare_beacon_proposer) - [`POST /eth/v1/validator/register_validator`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorregister_validator) - [`POST /eth/v1/validator/liveness/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorlivenessepoch) - [`GET /eth/v1/beacon/genesis`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beacongenesis) - [`GET /eth/v1/beacon/states/{state_id}/fork`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idfork) - [`GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon/#get-ethv1beaconstatesstate_idvalidatorsvalidator_id) - [`POST /eth/v1/beacon/blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p3/#post-ethv1beaconblocks) - [`POST /eth/v2/beacon/blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p3/#post-ethv2beaconblocks) ### ValidatorRequiredApi - [`POST /eth/v1/beacon/blinded_blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/#post-ethv1beaconblinded_blocks) - [`POST /eth/v2/beacon/blinded_blocks`](/rpc-service/chains/chains-api/eth-beacon/beacon-p2/#post-ethv2beaconblinded_blocks) - [`POST /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolattestations) - [`POST /eth/v1/beacon/pool/sync_committees`](/rpc-service/chains/chains-api/eth-beacon/beacon-2-p3/#post-ethv1beaconpoolsync_committees) - [`GET /eth/v1/node/syncing`](/rpc-service/chains/chains-api/eth-beacon/builder-p2/#get-ethv1nodesyncing) - [`GET /eth/v1/config/spec`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1configspec) - [`POST /eth/v1/validator/duties/attester/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#post-ethv1validatordutiesattesterepoch) - [`GET /eth/v1/validator/duties/proposer/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatordutiesproposerepoch) - [`POST /eth/v1/validator/duties/sync/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#post-ethv1validatordutiessyncepoch) - [`GET /eth/v3/validator/blocks/{slot}`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv3validatorblocksslot) - [`GET /eth/v1/validator/attestation_data`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatorattestation_data) - [`GET /eth/v1/validator/aggregate_attestation`](/rpc-service/chains/chains-api/eth-beacon/builder-p3/#get-ethv1validatoraggregate_attestation) - [`POST /eth/v1/validator/aggregate_and_proofs`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatoraggregate_and_proofs) - [`POST /eth/v1/validator/beacon_committee_subscriptions`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorbeacon_committee_subscriptions) - [`POST /eth/v1/validator/sync_committee_subscriptions`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorsync_committee_subscriptions) - [`GET /eth/v1/validator/sync_committee_contribution`](/rpc-service/chains/chains-api/eth-beacon/validator/#get-ethv1validatorsync_committee_contribution) - [`POST /eth/v1/validator/contribution_and_proofs`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorcontribution_and_proofs) - [`POST /eth/v1/validator/prepare_beacon_proposer`](/rpc-service/chains/chains-api/eth-beacon/validator/#post-ethv1validatorprepare_beacon_proposer) ### ValidatorRequiredApi, Rewards - [`GET /eth/v1/events`](/rpc-service/chains/chains-api/eth-beacon/builder/#get-ethv1events) - [`POST /eth/v1/beacon/rewards/sync_committee/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#post-ethv1beaconrewardssync_committeeblock_id) - [`GET /eth/v1/beacon/rewards/blocks/{block_id}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#get-ethv1beaconrewardsblocksblock_id) - [`POST /eth/v1/beacon/rewards/attestations/{epoch}`](/rpc-service/chains/chains-api/eth-beacon/beacon-2/#post-ethv1beaconrewardsattestationsepoch) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/validator/ title: Ethereum Beacon — Validator, ValidatorRequiredApi source: docs/rpc-service/chains/chains-api/eth-beacon/validator.mdx --- # Ethereum Beacon — Validator, ValidatorRequiredApi > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) ### `POST /eth/v1/validator/aggregate_and_proofs` > Publishes multiple aggregate and proofs. Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic. #### Parameters * `` (required): ```json [ { "message": { "aggregator_index": "1", "aggregate": { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_and_proofs" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/beacon_committee_subscriptions` > Signals the Beacon node to prepare for a committee subnet. After beacon node receives this request, search using discv5 for peers related to this subnet and replace current peers with those ones if necessary. If validator `is_aggregator`, beacon node must: * Announce subnet topic subscription on gossipsub. * Aggregate attestations received on that subnet. #### Parameters * ``: ```json [ { "validator_index": "1", "committee_index": "1", "committees_at_slot": "1", "slot": "1", "is_aggregator": true } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/beacon_committee_subscriptions" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. Slot signature is valid and beacon node has prepared the attestation subnet. Note that we cannot be certain the Beacon node will find peers for that subnet for various reasons. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/sync_committee_subscriptions` > Subscribes to sync committee subnets. Subscribe to a number of sync committee subnets. Sync committees are not present in phase0, but are required for Altair networks. Subscribing to sync committee subnets is an action performed by VC to enable network participation in Altair networks, and only required if the VC has an active validator in an active sync committee. #### Parameters * ``: ```json [ { "validator_index": "1", "sync_committee_indices": [ "1" ], "until_epoch": "1" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_subscriptions" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/beacon_committee_selections` > Determines if a distributed validator has been selected to aggregate attestations. This endpoint should be used by a validator client running as part of a distributed validator cluster, and is implemented by a distributed validator middleware client. This endpoint is used to exchange partial selection proofs for combined/aggregated selection proofs to allow a validator client to correctly determine if any of its validators has been selected to perform an attestation aggregation duty in a slot. Validator clients running in a distributed validator cluster must query this endpoint at the start of an epoch for the current and lookahead (next) epochs for all validators that have attester duties in the current and lookahead epochs. Consensus clients need not support this endpoint and may return a 501. #### Parameters * `` (required): ```json [ { "validator_index": "1", "slot": "1", "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/beacon_committee_selections" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `200`: Returns the threshold aggregated beacon committee selection proofs. ```json { "data": [ { "validator_index": "1", "slot": "1", "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } ``` * `400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `501`: Endpoint not implemented. ```json { "code": 501, "message": "Endpoint not implemented" } ``` * `503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/sync_committee_contribution` > Produces a sync committee contribution. Requests that the beacon node produce a sync committee contribution. A 503 error must be returned if the block identified by the response `beacon_block_root` is optimistic (i.e. the sync committee contribution refers to a block that has not been fully verified by an execution engine). #### Parameters * `slot` (string; query; required): the slot for which a sync committee contribution should be created. * `subcommittee_index` (string; query; required): the subcommittee index for which to produce the contribution. * `beacon_block_root` (string; query; required): the block root for which to produce the contribution. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_contribution" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "subcommittee_index": "1", "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 404`: Not found. ```json { "code": 404, "message": "Requested item not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/sync_committee_selections` > Determines if a distributed validator has been selected to make a sync committee contribution. Submit sync committee selections to a DVT middleware client. It returns the threshold aggregated sync committee selection. This endpoint should be used by a validator client running as part of a distributed validator cluster, and is implemented by a distributed validator middleware client. This endpoint is used to exchange partial selection proofs (slot signatures) for combined/aggregated selection proofs to allow a validator client to correctly determine if any of its validators has been selected to perform a sync committee contribution (sync aggregation) duty in a slot. Validator clients running in a distributed validator cluster must query this endpoint at the start of each slot for all validators that are included in the current sync committee. Consensus clients need not support this endpoint and may return a 501. #### Parameters * `` (required): ```json [ { "validator_index": "1", "slot": "1", "subcommittee_index": "1", "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_selections" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `200`: Returns the threshold aggregated sync committee selection proofs. ```json { "data": [ { "validator_index": "1", "slot": "1", "subcommittee_index": "1", "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } ``` * `400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `501`: Endpoint not implemented. ```json { "code": 501, "message": "Endpoint not implemented" } ``` * `503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/contribution_and_proofs` > Publishes multiple contribution and proofs. Publishes multiple signed sync committee contribution and proofs. #### Parameters * ``: ```json [ { "message": { "aggregator_index": "1", "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "contribution": { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "subcommittee_index": "1", "aggregation_bits": "0xffffffffffffffffffffffffffffffff", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/contribution_and_proofs" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/prepare_beacon_proposer` > Provides the Beacon node with proposals for the given validators. Prepares the beacon node for potential proposers by supplying information required when proposing blocks for the given validators. The information supplied for each validator index will persist through the epoch in which the call is submitted and for a further two epochs after that, or until the beacon node restarts. It is expected that validator clients will send this information periodically, for example each epoch, to ensure beacon nodes have correct and timely fee recipient information. Note that there is no guarantee that the beacon node will use the supplied fee recipient when creating a block proposal, so on receipt of a proposed block the validator should confirm that it finds the fee recipient within the block acceptable before signing it. Also note that requests containing currently inactive or unknown validator indices will be accepted, as they may become active at a later epoch. #### Parameters * ``: ```json [ { "validator_index": "1", "fee_recipient": "0xAbcF8e0d4e9587369b2301D0790347320302cc09" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/prepare_beacon_proposer" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. Preparation information has been received. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/register_validator` > Provides the Beacon node with registrations for the given validators to the external builder network. Prepares the beacon node for engaging with external builders. The information must be sent by the beacon node to the builder network. It is expected that the validator client will send this information periodically to ensure the beacon node has correct and timely registration information to provide to builders. The validator client should not sign blinded beacon blocks that do not adhere to their latest fee recipient and gas limit preferences. Note that only registrations for active or pending validators must be sent to the builder network. Registrations for unknown or exited validators must be filtered out and not sent to the builder network. #### Parameters * ``: ```json [ { "message": { "fee_recipient": "0xAbcF8e0d4e9587369b2301D0790347320302cc09", "gas_limit": "1", "timestamp": "1", "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/register_validator" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. Registration information has been received. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/liveness/{epoch}` > Indicates if a validator has been observed on the network. Requests the beacon node to indicate if a validator has been observed to be live in a given epoch. The beacon node might detect liveness by observing messages from the validator on the network, in the beacon chain, from its API or from any other source. A beacon node SHOULD support the current and previous epoch, however it MAY support earlier epoch. It is important to note that the values returned by the beacon node are not canonical; they are best-effort and based upon a subjective view of the network. A beacon node that was recently started or suffered a network partition may indicate that a validator is not live when it actually is. #### Parameters * `epoch` (string; path; required): the epoch for which liveness is being queried. * `` (required): an array of the validator indices for which to detect liveness. ```json [ "1" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/liveness/{epoch}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `200`: Success. ```json { "data": [ { "index": "1", "is_live": true } ] } ``` * `400`: Invalid epoch or index. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ## ValidatorRequiredApi Minimal set of endpoints to enable a working validator implementation. ### `GET /eth/v1/beacon/genesis` > Retrieves the details of the chain's genesis. Returns the details of the chain's genesis which can be used to identify chain. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/genesis" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "data": { "genesis_time": "1606824023", "genesis_validators_root": "0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95", "genesis_fork_version": "0x00000000" } } ``` * `404`: Chain genesis info is not yet known. ```json { "code": 404, "message": "Chain genesis info is not yet known" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/fork` > Retrieves the Fork object for a requested state. Retrieves the [Fork](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/beacon-chain.md#fork) object for state with given 'stateId'. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/state/{state_id}/fork" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "data": { "previous_version": "0x00000000", "current_version": "0x00000000", "epoch": "1" } } ``` * `400`: Invalid state ID. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}` > Retrieves the validator from state by ID. Returns validator specified by state and id or public key along with status and balance. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``. * `validator_id` (string; path; required): either a hex encoded public key (any bytes48 with 0x prefix) or validator index. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validators/{validator_id}" \ -H "Accept: application/json" ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "data": { "index": "1", "balance": "1", "status": "active_ongoing", "validator": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "effective_balance": "1", "slashed": false, "activation_eligibility_epoch": "1", "activation_epoch": "1", "exit_epoch": "1", "withdrawable_epoch": "1" } } } ``` * `400`: Invalid state or validator ID. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `404`: Not found. ```json { "code": 404, "message": "State not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/blocks` > Publishes a signed block. Instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. A success response (20x) indicates that the block passed gossip validation and was successfully broadcast onto the network. The beacon node is also expected to integrate the block into state, but may broadcast it before doing so, thus to aid timely delivery of the block. Should the block fail full validation, a separate success response code (202) is used to indicate that the block was successfully broadcast but failed integration. After Deneb, this additionally instructs the beacon node to broadcast all given blobs. #### Parameters * `Eth-Consensus-Version` (header): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`. * `` (required): the `SignedBeaconBlock` object composed of the `BeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xdEFeAFdc312b725d00Dd16b4A627fCBfa6B8aAF1d8AF7bCfd82bbFca700A0645", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. * `Code 202`: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database. * `Code 400`: The `SignedBeaconBlock` object is invalid. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 415`: The supplied content-type is not supported. ```json { "code": 415, "message": "Cannot read the supplied content type." } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v2/beacon/blocks` > Publishes a signed block. Instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. A success response (20x) indicates that the block passed gossip validation and was successfully broadcast onto the network. The beacon node is also expected to integrate the block into the state, but may broadcast it before doing so, thus to aid timely delivery of the block. Should the block fail full validation, a separate success response code (202) is used to indicate that the block was successfully broadcast but failed integration. After Deneb, this additionally instructs the beacon node to broadcast all given blobs. The broadcast behaviour may be adjusted via the broadcast_validation query parameter. #### Parameters * `broadcast_validation` (string; query): Level of validation that must be applied to a block before it is broadcast. Possible values: * `gossip` (default): lightweight gossip checks only. * `consensus`: full consensus checks, including validation of all signatures and blocks fields except for the execution payload transactions. * `consensus_and_equivocation`: the same as `consensus`, with an extra equivocation check immediately before the block is broadcast. If the block is found to be an equivocation it fails validation. * `Eth-Consensus-Version` (header; required): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`, `capella`, `deneb`. * `` (required): the `SignedBeaconBlock` object composed of the `BeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xdEFeAFdc312b725d00Dd16b4A627fCBfa6B8aAF1d8AF7bCfd82bbFca700A0645", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v2/beacon/blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. * `Code 202`: The block could not be integrated into the beacon node's database as it failed validation, but was successfully broadcast. * `Code 400`: The `SignedBeaconBlock` object is invalid or broadcast validation failed. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 415`: The supplied content-type is not supported. ```json { "code": 415, "message": "Cannot read the supplied content type." } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi-2/ title: Ethereum Beacon — ValidatorRequiredApi, Rewards source: docs/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi-2.mdx --- # Ethereum Beacon — ValidatorRequiredApi, Rewards > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) ### `GET /eth/v1/events` > Subscribes to Beacon node events. Provides endpoint to subscribe to beacon node Server-Sent-Events stream. Consumers should use [eventsource](https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface) implementation to listen on those events. Servers *may* send SSE comments beginning with `:` for any purpose, including to keep the event stream connection alive in the presence of proxy servers. #### Parameters * `topics` (array[string]; query; required): event types to subscribe to; available values : `head`, `block`, `block_gossip`, `attestation`, `voluntary_exit`, `bls_to_execution_change`, `proposer_slashing`, `attester_slashing`, `finalized_checkpoint`, `chain_reorg`, `contribution_and_proof`, `light_client_finality_update`, `light_client_optimistic_update`, `payload_attributes`, `blob_sidecar`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/events" \ -H "Accept: text/event-stream" ``` #### Responses * `Code 200`: Opened SSE stream. **Head event**: The node has finished processing, resulting in a new head. previous_duty_dependent_root is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)` and `current_duty_dependent_root` is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)`. Both dependent roots use the genesis block root in the case of underflow. ```text event: head data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch_transition":false, "previous_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "current_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "execution_optimistic": false} ``` **Block event**: The node has received a valid block (from P2P or API). ```text event: block data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "execution_optimistic": false} ``` **Block gossip event**: The node has received a block (from P2P or API) that passes validation rules of the `beacon_block` topic. ```text event: block_gossip data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf"} ``` **Attestation event**: The node has received a valid attestation (from P2P or API). ```text event: attestation data: {"aggregation_bits":"0x01", "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data":{"slot":"1", "index":"1", "beacon_block_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}, "target":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}} ``` **Voluntary exit event**: The node has received a valid voluntary exit (from P2P or API). ```text event: voluntary_exit data: {"message":{"epoch":"1", "validator_index":"1"}, "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"} ``` **Proposer slashing event**: The node has received a ProposerSlashing (from P2P or API) that passes validation rules of the `proposer_slashing` topic. ```text event: proposer_slashing data: {"signed_header_1":{"message":{"slot":"0","proposer_index":"0","parent_root":"0x0000000000000000000000000000000000000000000000000000000000000000","state_root":"0x0000000000000000000000000000000000000000000000000000000000000000","body_root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"signed_header_2":{"message":{"slot":"0","proposer_index":"0","parent_root":"0x0000000000000000000000000000000000000000000000000000000000000000","state_root":"0x0000000000000000000000000000000000000000000000000000000000000000","body_root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}} ``` **Attester slashing event**: The node has received an AttesterSlashing (from P2P or API) that passes validation rules of the `attester_slashing` topic. ```text event: attester_slashing data: {"attestation_1":{"attesting_indices":["0", "1"],"data":{"slot":"0","index":"0","beacon_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","source":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"target":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"}},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"attestation_2":{"attesting_indices":["0", "1"],"data":{"slot":"0","index":"0","beacon_block_root":"0x0000000000000000000000000000000000000000000000000000000000000000","source":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"},"target":{"epoch":"0","root":"0x0000000000000000000000000000000000000000000000000000000000000000"}},"signature":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}} ``` **BLS to execution change event**: The node has received a SignedBLSToExecutionChange (from P2P or API) that passes validation rules of the `bls_to_execution_change` topic. ```text event: bls_to_execution_change data: {"message":{"validator_index":"1", "from_bls_pubkey":"0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f7329267a8811c397529dac52ae1342ba58c95", "to_execution_address":"0x9Be8d619c56699667c1feDCD15f6b14D8B067F72"}, "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"} ``` **Finalized checkpoint event**: Finalized checkpoint has been updated. ```text event: finalized_checkpoint data: {"block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch":"2", "execution_optimistic": false } ``` **Chain reorg event**: The node has reorganized its chain. ```text event: chain_reorg data: {"slot":"200", "depth":"50", "old_head_block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "new_head_block":"0x76262e91970d375a19bfe8a867288d7b9cde43c8635f598d93d39d041706fc76", "old_head_state":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "new_head_state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch":"2", "execution_optimistic": false} ``` **Contribution and proof event**: The node has received a valid sync committee SignedContributionAndProof (from P2P or API). ```text event: contribution_and_proof data: {"message": {"aggregator_index": "997", "contribution": {"slot": "168097", "beacon_block_root": "0x56f1fd4262c08fa81e27621c370e187e621a67fc80fe42340b07519f84b42ea1", "subcommittee_index": "0", "aggregation_bits": "0xffffffffffffffffffffffffffffffff", "signature": "0x85ab9018e14963026476fdf784cc674da144b3dbdb47516185438768774f077d882087b90ad642469902e782a8b43eed0cfc1b862aa9a473b54c98d860424a702297b4b648f3f30bdaae8a8b7627d10d04cb96a2cc8376af3e54a9aa0c8145e3"}, "selection_proof": "0x87c305f04bfe5db27c2b19fc23e00d7ac496ec7d3e759cbfdd1035cb8cf6caaa17a36a95a08ba78c282725e7b66a76820ca4eb333822bd399ceeb9807a0f2926c67ce67cfe06a0b0006838203b493505a8457eb79913ce1a3bcd1cc8e4ef30ed"}, "signature": "0xac118511474a94f857300b315c50585c32a713e4452e26a6bb98cdb619936370f126ed3b6bb64469259ee92e69791d9e12d324ce6fd90081680ce72f39d85d50b0ff977260a8667465e613362c6d6e6e745e1f9323ec1d6f16041c4e358839ac"} ``` **Light client finality update event**: The node's latest known `LightClientFinalityUpdate` has been updated. ```text event: light_client_finality_update data: {"version":"altair", "data": {"attested_header": {"beacon": {"slot":"1", "proposer_index":"1", "parent_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}, "finalized_header": {"beacon": {"slot":"1", "proposer_index":"1", "parent_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}, "finality_branch": ["0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"], "sync_aggregate": {"sync_committee_bits":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffbffffffffffffffffffffbffffffffffffff", "sync_committee_signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"}, "signature_slot":"1"}} ``` **Light client optimistic update event**: The node's latest known `LightClientOptimisticUpdate` has been updated. ```text event: light_client_optimistic_update data: {"version":"altair", "data": {"attested_header": {"beacon": {"slot":"1", "proposer_index":"1", "parent_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}, "sync_aggregate": {"sync_committee_bits":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffbffffffffffffffffffffbffffffffffffff", "sync_committee_signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"}, "signature_slot":"1"}} ``` **Payload attributes event**: The node has computed new payload attributes for execution payload building. This event gives block builders and relays sufficient information to construct or verify a block at proposal_slot. The meanings of the fields are: * `version`: the identifier of the beacon hard fork at proposal_slot, e.g. "bellatrix", "capella". * `proposal_slot`: the slot at which a block using these payload attributes may be built. * `parent_block_root`: the beacon block root of the parent block to be built upon. * `parent_block_number`: the execution block number of the parent block. * `parent_block_hash`: the execution block hash of the parent block. * `proposer_index`: the validator index of the proposer at `proposal_slot` on the chain identified by `parent_block_root`. * `payload_attributes`: beacon API encoding of `PayloadAttributesV` as defined by the execution-apis specification. The version `N` must match the payload attributes for the hard fork matching `version`. The beacon API encoded object must have equivalent fields to its counterpart in `execution-apis` with two differences: 1) `snake_case` identifiers must be used rather than `camelCase`; 2) integers must be encoded as quoted decimals rather than big-endian hex. The frequency at which this event is sent may depend on beacon node configuration. The fee recipient may also be set via beacon node config, but should likely be ignored by block builders and most other API consumers. ```text event: payload_attributes data: {"version": "capella", "data": {"proposer_index": "123", "proposal_slot": "10", "parent_block_number": "9", "parent_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "parent_block_hash": "0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "payload_attributes": {"timestamp": "123456", "prev_randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "suggested_fee_recipient": "0x0000000000000000000000000000000000000000", "withdrawals": [{"index": "5", "validator_index": "10", "address": "0x0000000000000000000000000000000000000000", "amount": "15640"}]}}} ``` **Blob sidecar event**: The node has received a BlobSidecar (from P2P or API) that passes all gossip validations on the `blob_sidecar_{subnet_id}` topic. ```text event: blob_sidecar data: {"block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "index": "1", "slot": "1", "kzg_commitment": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "versioned_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"} ``` * `Code 400`: The topics supplied could not be parsed. ```json { "code": 400, "message": "Invalid topic: weather_forecast" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ## Rewards Endpoints to query rewards and penalties for validators. ### `POST /eth/v1/beacon/rewards/sync_committee/{block_id}` > Retrieves sync committee rewards. Retrieves the rewards info for sync committee members specified by array of public keys or validator index. If no array is provided, return reward info for every committee member. #### Parameters * `block_id` (string; path; required): Block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. * ``: an array of either hex encoded public key (any bytes48 with 0x prefix) or validator index. ```json [ "string" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/rewards/sync_committee/{block_id}" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{request_body}' ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": [ { "validator_index": "0", "reward": "2000" } ] } ``` * `400`: Invalid get sync committee rewards request. ```json { "code": 400, "message": "Invalid request to retrieve sync committee rewards info" } ``` * `404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/rewards/blocks/{block_id}` > Retrieves sync committee rewards. Retrieves the rewards info for sync committee members specified by array of public keys or validator index. If no array is provided, return reward info for every committee member. #### Parameters * `block_id` (string; path; required): Block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/rewards/blocks/{block_id}" \ -H 'Accept: application/json' ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "proposer_index": "123", "total": "123", "attestations": "123", "sync_aggregate": "123", "proposer_slashings": "123", "attester_slashings": "123" } } ``` * `400`: Invalid get block rewards request. ```json { "code": 400, "message": "Invalid request to retrieve sync committee rewards info" } ``` * `404`: Block or required state not found. ```json { "code": 404, "message": "Block not found" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/rewards/attestations/{epoch}` > Retrieves attestations rewards. Retrieves attestation reward info for validators specified by array of public keys or validator index. If no array is provided, return reward info for every validator. #### Parameters * `epoch` (string; path; required): the epoch to get rewards info from. * ``: an array of either hex encoded public key (any bytes48 with 0x prefix) or validator index. ```json [ "string" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/rewards/attestations/{epoch}" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{request_body}' ``` #### Responses * `200`: Success. ```json { "execution_optimistic": false, "finalized": false, "data": { "ideal_rewards": [ { "effective_balance": "1000000000", "head": "2500", "target": "5000", "source": "5000", "inclusion_delay": "5000", "inactivity": "5000" } ], "total_rewards": [ { "validator_index": "0", "head": "2000", "target": "2000", "source": "4000", "inclusion_delay": "2000", "inactivity": "2000" } ] } } ``` * `400`: Invalid get attestations rewards request. ```json { "code": 400, "message": "Invalid request to retrieve attestations rewards info" } ``` * `404`: Epoch not known or required data not available. ```json { "code": 404, "message": "Epoch not known or required data not available" } ``` * `500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi-p2/ title: Ethereum Beacon — ValidatorRequiredApi (2/3) source: docs/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi-p2.mdx --- # Ethereum Beacon — ValidatorRequiredApi (2/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi/) · 2 · [3](/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi-p3/) ### `POST /eth/v1/beacon/pool/attestations` > Submits Attestation objects to the node. Submits Attestation objects to the node. Each attestation in the request body is processed individually. If an attestation is validated successfully the node MUST publish that attestation on the appropriate subnet. If one or more attestations fail validation the node MUST return a 400 error with details of which attestations have failed, and why. #### Parameters * `` (required): ```json [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attestations" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Attestations are stored in pool and broadcast on appropriate subnet. * `Code 400`: Errors with one or more attestations. ```json { "code": 400, "message": "some failures", "failures": [ { "index": 3, "message": "invalid signature" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/sync_committees` > Submits sync committee signatures to the node. Submits sync committee signature objects to the node. Sync committee signatures are not present in phase0, but are required for Altair networks. If a sync committee signature is validated successfully the node MUST publish that sync committee signature on all applicable subnets. If one or more sync committee signatures fail validation the node MUST return a 400 error with details of which sync committee signatures have failed, and why. #### Parameters * `` (required): ```json [ { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "validator_index": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/sync_committees" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Sync committee signatures are stored in pool and broadcast on appropriate subnet. * `Code 400`: Errors with one or more sync committee signatures. ```json { "code": 400, "message": "some failures", "failures": [ { "index": 3, "message": "invalid signature" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/syncing` > Retrieves a node syncing status. Requests the beacon node to describe if it's currently syncing or not, and if it is, what block it is up to. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/syncing" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "head_slot": "1", "sync_distance": "1", "is_syncing": true, "is_optimistic": true } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/config/spec` > Retrieves spec parameters. Retrieve specification configuration used on this node. The configuration should include: * Constants for all hard forks known by the beacon node, for example the [phase 0](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/beacon-chain.md#constants) and [altair](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/beacon-chain.md#constants) values. * Presets for all hard forks supplied to the beacon node, for example the [phase 0](https://github.com/ethereum/consensus-specs/blob/v1.3.0/presets/mainnet/phase0.yaml) and [altair](https://github.com/ethereum/consensus-specs/blob/v1.3.0/presets/mainnet/altair.yaml) values. * Configuration for the beacon node, for example the [mainnet](https://github.com/ethereum/consensus-specs/blob/v1.3.0/configs/mainnet.yaml) values. Values are returned with the following format: * Any value starting with 0x in the spec is returned as a hex string. * Numeric values are returned as a quoted integer. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/config/spec" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "DEPOSIT_CONTRACT_ADDRESS": "0x00000000219ab540356cBB839Cbe05303d7705Fa", "DEPOSIT_NETWORK_ID": "1", "DOMAIN_AGGREGATE_AND_PROOF": "0x06000000", "INACTIVITY_PENALTY_QUOTIENT": "67108864", "INACTIVITY_PENALTY_QUOTIENT_ALTAIR": "50331648" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/duties/attester/{epoch}` > Retrieves attester duties. Requests the beacon node to provide a set of attestation duties, which should be performed by validators, for a particular epoch. Duties should only need to be checked once per epoch, however a chain reorganization (of > MIN_SEED_LOOKAHEAD epochs) could occur, resulting in a change of duties. For full safety, you should monitor head events and confirm the dependent root in this response matches: * event.previous_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch` * event.current_duty_dependent_root when `compute_epoch_at_slot(event.slot) + 1 == epoch` * event.block otherwise The dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)` or the genesis block root in the case of underflow. #### Parameters * `epoch` (string; path; required): should only be allowed one epoch ahead. * `` (required): an array of the validator indices for which to obtain the duties: ```json [ "1" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/attester/{epoch}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. ```json { "dependent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "committee_index": "1", "committee_length": "1", "committees_at_slot": "1", "validator_committee_index": "1", "slot": "1" } ] } ``` * `Code 400`: Invalid epoch or index. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/duties/proposer/{epoch}` > Retrieves block proposer duties. Request beacon node to provide all validators that are scheduled to propose a block in the given epoch. Duties should only need to be checked once per epoch, however a chain reorganization could occur that results in a change of duties. For full safety, you should monitor head events and confirm the dependent root in this response matches: * event.current_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch` * event.block otherwise The dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)` or the genesis block root in the case of underflow. #### Parameters * `epoch` (string; path; required); an epoch. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/proposer/{epoch}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "dependent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "slot": "1" } ] } ``` * `Code 400`: Invalid epoch. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/duties/sync/{epoch}` > Retrieves sync committee duties. Requests the beacon node to provide a set of sync committee duties for a particular epoch. #### Parameters * `epoch` (string; path; required): `epoch` // `EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch` // `EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1` * `` (required): an array of the validator indices for which to obtain the duties: ```json [ "1" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/sync/{epoch}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. ```json { "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "validator_sync_committee_indices": [ "1" ] } ] } ``` * `Code 400`: Invalid epoch or index. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v3/validator/blocks/{slot}` > Produces a new block, without signature. Requests a beacon node to produce a valid block, which can then be signed by a validator. The returned block may be blinded or unblinded, depending on the current state of the network as decided by the execution and beacon nodes. The beacon node must return an unblinded block if it obtains the execution payload from its paired execution node. It must only return a blinded block if it obtains the execution payload header from an MEV relay. Metadata in the response indicates the type of block produced, and the supported types of block will be added to as forks progress. #### Parameters * `slot` (string; path; required): the slot for which the block should be proposed. * `randao_reveal` (string; hex; query; required): the validator's randao reveal value. * `graffiti` (string; hex; query): an arbitrary data validator to include in the block. * `skip_randao_verification` (query): skip verification of the `randao_reveal` value. If this flag is set then the `randao_reveal` must be set to the point at infinity (`0xc0..00`). This query parameter is a flag and does not take a value. * `builder_boost_factor` (string; query): percentage multiplier to apply to the builder's payload value when choosing between a builder payload header and payload from the paired execution node. This parameter is only relevant if the beacon node is connected to a builder, deems it safe to produce a builder payload, and receives valid responses from both the builder endpoint and the paired execution node. When these preconditions are met, the server MUST act as follows: * if `exec_node_payload_value >= builder_boost_factor * (builder_payload_value // 100)`, then return a full (unblinded) block containing the execution node payload. * otherwise, return a blinded block containing the builder payload header. Servers must support the following values of the boost factor which encode common preferences: * `builder_boost_factor=0`: prefer the execution node payload unless an error makes it unviable. * `builder_boost_factor=100`: default profit maximization mode; choose whichever payload pays more. * `builder_boost_factor=2**64 - 1`: prefer the builder payload unless an error or beacon node health check makes it unviable. Servers should use saturating arithmetic or another technique to ensure that large values of the `builder_boost_factor` do not trigger overflows or errors. If this parameter is provided and the beacon node is not configured with a builder then the beacon node MUST respond with a full block, which the caller can choose to reject if it wishes. If this parameter is not provided then it should be treated as having the default value of 100. If the value is provided but out of range for a 64-bit unsigned integer, then an error response with status code 400 MUST be returned. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v3/validator/blocks/{slot}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Note: The `Eth-Consensus-Version`, `Eth-Execution-Payload-Blinded`, `Eth-Execution-Payload-Value`, `Eth-Consensus-Block-Value` header is required in response so client can deserialize returned json or ssz data more effectively. ```json { "version": "phase0", "data": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xbF0eF8805DE094355C99fD34Df183ADB5BB153f5dac2eD83bee6eEd2dEf05cFC", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } } } ``` * `Code 400`: Invalid block production request. ```json { "code": 400, "message": "Invalid request to produce a block" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi-p3/ title: Ethereum Beacon — ValidatorRequiredApi (3/3) source: docs/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi-p3.mdx --- # Ethereum Beacon — ValidatorRequiredApi (3/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi/) · [2](/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi-p2/) · 3 ### `GET /eth/v1/validator/attestation_data` > Produces attestation data. Requests that the beacon node produce an AttestationData. A 503 error must be returned if the block identified by the response `beacon_block_root` is optimistic (i.e. the attestation attests to a block that has not been fully verified by an execution engine). #### Parameters * `slot` (string; query; required): the slot for which an attestation data should be created. * `committee_index` (string; query; required): the committee index for which an attestation data should be created. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/attestation_data" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/aggregate_attestation` > Retrieves aggregated attestation. Aggregates all attestations matching given attestation data root and slot. A 503 error must be returned if the block identified by the response `beacon_block_root` is optimistic (i.e. the aggregated attestation attests to a block that has not been fully verified by an execution engine). A 404 error must be returned if no attestation is available for the requested `attestation_data_root`. #### Parameters * `attestation_data_root` (string, hex; query; required): HashTreeRoot of AttestationData that validator wants aggregated. * `slot` (string; query; required): a slot. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_attestation" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Returns aggregated `Attestation` object with same `AttestationData` root. ```json { "data": { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 404`: Not found. ```json { "code": 404, "message": "Requested item not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/aggregate_and_proofs` > Publishes multiple aggregate and proofs. Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic. #### Parameters * `` (required): ```json [ { "message": { "aggregator_index": "1", "aggregate": { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_and_proofs" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/beacon_committee_subscriptions` > Signals the Beacon node to prepare for a committee subnet. After beacon node receives this request, search using discv5 for peers related to this subnet and replace current peers with those ones if necessary. If validator `is_aggregator`, beacon node must: * Announce subnet topic subscription on gossipsub. * Aggregate attestations received on that subnet. #### Parameters * `` (required): ```json [ { "validator_index": "1", "committee_index": "1", "committees_at_slot": "1", "slot": "1", "is_aggregator": true } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/beacon_committee_subscriptions" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. Slot signature is valid and beacon node has prepared the attestation subnet. Note that we cannot be certain the Beacon node will find peers for that subnet for various reasons. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/sync_committee_subscriptions` > Subscribes to sync committee subnets. Subscribe to a number of sync committee subnets. Sync committees are not present in phase0, but are required for Altair networks. Subscribing to sync committee subnets is an action performed by VC to enable network participation in Altair networks, and only required if the VC has an active validator in an active sync committee. #### Parameters * `` (required): ```json [ { "validator_index": "1", "sync_committee_indices": [ "1" ], "until_epoch": "1" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_subscriptions" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/validator/sync_committee_contribution` > Produces a sync committee contribution. Requests that the beacon node produce a sync committee contribution. A 503 error must be returned if the block identified by the response `beacon_block_root` is optimistic (i.e. the sync committee contribution refers to a block that has not been fully verified by an execution engine). #### Parameters * `slot` (string; query; required): the slot for which a sync committee contribution should be created. * `subcommittee_index` (string; query; required): the subcommittee index for which to produce the contribution. * `beacon_block_root` (string, hex; query; required): the block root for which to produce the contribution. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_contribution" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "subcommittee_index": "1", "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 404`: Not found. ```json { "code": 404, "message": "Requested item not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/contribution_and_proofs` > Publishes multiple contribution and proofs. Publishes multiple signed sync committee contribution and proofs. #### Parameters * `` (required): ```json [ { "message": { "aggregator_index": "1", "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "contribution": { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "subcommittee_index": "1", "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/contribution_and_proofs" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/prepare_beacon_proposer` > Provides the Beacon node with proposals for the given validators. Prepares the beacon node for potential proposers by supplying information required when proposing blocks for the given validators. The information supplied for each validator index will persist through the epoch in which the call is submitted and for a further two epochs after that, or until the beacon node restarts. It is expected that validator clients will send this information periodically, for example each epoch, to ensure beacon nodes have correct and timely fee recipient information. Note that there is no guarantee that the beacon node will use the supplied fee recipient when creating a block proposal, so on receipt of a proposed block the validator should confirm that it finds the fee recipient within the block acceptable before signing it. Also note that requests containing currently inactive or unknown validator indices will be accepted, as they may become active at a later epoch. #### Parameters * `` (required): ```json [ { "validator_index": "1", "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/prepare_beacon_proposer" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. Preparation information has been received. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi/ title: Ethereum Beacon — ValidatorRequiredApi (1/3) source: docs/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi.mdx --- # Ethereum Beacon — ValidatorRequiredApi (1/3) > API reference for [Ethereum Beacon](/rpc-service/chains/chains-api/eth-beacon/). [All methods ->](/rpc-service/chains/chains-api/eth-beacon/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi-p2/) · [3](/rpc-service/chains/chains-api/eth-beacon/validatorrequiredapi-p3/) ### `POST /eth/v1/beacon/blinded_blocks` > Publishes a signed block. Instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct and publish a `SignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`. The beacon node should broadcast a newly constructed `SignedBeaconBlock` to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed `BeaconBlock`, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202). Before Bellatrix, this endpoint will accept a `SignedBeaconBlock`. #### Parameters * `Eth-Consensus-Version` (string; header): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`, `capella`, `deneb`. * `` (required): the `SignedBlindedBeaconBlock` object composed of `BlindedBeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0x81cdF3DbaE67fBbE10CAc8Bcd8B28d4DDDc65D9a74f3921693676fccF8BeCe9B", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blinded_blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. * `Code 202`: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database. * `Code 400`: The `SignedBlindedBeaconBlock` object is invalid. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 415`: The supplied content-type is not supported. ```json { "code": 415, "message": "Cannot read the supplied content type." } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v2/beacon/blinded_blocks` > Publishes a signed block. Instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct and publish a `SignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`. The beacon node should broadcast a newly constructed `SignedBeaconBlock` to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed `BeaconBlock`, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202). Before Bellatrix, this endpoint will accept a `SignedBeaconBlock`. The broadcast behaviour may be adjusted via the `broadcast_validation` query parameter. #### Parameters * `broadcast_validation` (string; query): level of validation that must be applied to a block before it is broadcast. Possible values: * `gossip` (default): lightweight gossip checks only. * `consensus`: full consensus checks, including validation of all signatures and blocks fields except for the execution payload transactions. * `consensus_and_equivocation`: the same as `consensus`, with an extra equivocation check immediately before the block is broadcast. If the block is found to be an equivocation it fails validation. * `Eth-Consensus-Version` (string; header, required): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`, `capella`, `deneb`. * `` (required): The `SignedBlindedBeaconBlock` object composed of `BlindedBeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v2/beacon/blinded_blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. * `Code 202`: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database. * `Code 400`: The `SignedBlindedBeaconBlock` object is invalid or broadcast validation failed. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 415`: The supplied content-type is not supported. ```json { "code": 415, "message": "Cannot read the supplied content type." } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ethereum/history-p2/ title: Ethereum — History, eth, Trace and debug (2/3) source: docs/rpc-service/chains/chains-api/ethereum/history-p2.mdx --- # Ethereum — History, eth, Trace and debug (2/3) > API reference for [Ethereum](/rpc-service/chains/chains-api/ethereum/). [All methods ->](/rpc-service/chains/chains-api/ethereum/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/ethereum/history/) · 2 · [3](/rpc-service/chains/chains-api/ethereum/history-p3/) ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- ## `trace_filter` > Retrieve traces that match filter criteria. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `fromBlock` (string, optional): the starting block number, given as a hexadecimal string. Example: "0x1" for the first block. * `toBlock` (string, optional): the ending block number, given as a hexadecimal string. Example: "latest" for the most recent block. * `fromAddress` (array of strings, optional): an array of addresses that initiated the transactions. Example: ["0xAddress1", "0xAddress2"]. * `toAddress` (array of strings, optional): an array of addresses that received the transactions. Example: ["0xAddress1", "0xAddress2"]. * `after` (integer, optional): the offset for pagination. Example: 0. * `count` (integer, optional): the number of results to return. Example: 100. * `topics` (array of arrays of strings, optional): an array of log topics to filter by. Each inner array represents a set of possible values for that topic. Example: [["0xTopic1", "0xTopic2"], ["0xTopic3"]]. ### Returns
* `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For `call`: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_filter", "params": [{ "fromBlock": "0x3ff718", "toBlock": "0x3ff720", "fromAddress": ["0x1234567890abcdef1234567890abcdef12345678"], "toAddress": ["0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"], "topics": [["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"]] }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `trace_transaction` > Retrieves the traces created during the execution of a given transaction. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `transactionHash` (string; required): the hash of the transaction for which you want to retrieve the traces. ### Returns
* `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For call: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_transaction", "params": ["0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "action": { "callType": "call", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x38025", "input": "0x3161b7f60000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a50000000000000000000000000000000000000000000123a8d6d9f1c9e741075000000000000000000000000000000000000000000000000000000000017d78400000000000000000000000000000000000000000000000000000000000000010", "value": "0x0", "to": "0x2d61dcdd36f10b22176e0433b86f74567d529aaa" }, "result": { "gasUsed": "0x38025", "output": "0x" }, "subtraces": 1, "traceAddress": [], "type": "call", "blockHash": "0xb20d0897ac3567d603afb646238b66e455bf28d234ce96cdbbe86ddc8d27c9e9", "blockNumber": 344366750, "transactionHash": "0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e", "transactionPosition": 0 } ] } ``` --- ## `trace_replayTransaction` > Replays a transaction and returns the traces produced by its execution along with the state changes. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `transactionHash` (string): the hash of the transaction to be replayed. * `traceTypes` (array of strings): the types of traces to be included in the response. Possible value: `trace`. ### Returns The method returns an object that can include the following fields: * `trace` (array): an array of trace objects, similar to those returned by `trace_transaction` and `trace_filter`: * `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For call: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_replayTransaction", "params": ["0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e", ["trace"]], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "output": "0x", "stateDiff": null, "trace": [ { "action": { "callType": "call", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x38025", "input": "0x3161b7f60000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a50000000000000000000000000000000000000000000123a8d6d9f1c9e741075000000000000000000000000000000000000000000000000000000000017d78400000000000000000000000000000000000000000000000000000000000000010", "value": "0x0", "to": "0x2d61dcdd36f10b22176e0433b86f74567d529aaa" }, "result": { "gasUsed": "0x38025", "output": "0x" }, "subtraces": 1, "traceAddress": [], "type": "call" } ], "vmTrace": null } } ``` --- ## `trace_replayBlockTransactions` > Replays all the transactions in a given block and returns the traces produced by their execution along with the state changes. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `blockHash` (string): the hash of the block whose transactions you want to replay. * `traceTypes` (array of strings): the types of traces to be included in the response. Possible value: `trace`. ### Returns The method returns an object that can include the following fields: * `trace` (array): an array of trace objects, similar to those returned by `trace_transaction` and `trace_filter`: * `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For call: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_replayBlockTransactions", "params": ["0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e", ["trace"]], "id": 1 }' ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ethereum/history-p3/ title: Ethereum — History, eth, Trace and debug (3/3) source: docs/rpc-service/chains/chains-api/ethereum/history-p3.mdx --- # Ethereum — History, eth, Trace and debug (3/3) > API reference for [Ethereum](/rpc-service/chains/chains-api/ethereum/). [All methods ->](/rpc-service/chains/chains-api/ethereum/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/ethereum/history/) · [2](/rpc-service/chains/chains-api/ethereum/history-p2/) · 3 ## `trace_block` > Retrieves a detailed trace of all the transactions in a specific block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `blockNumber` (string): the number of the block you want to trace, given as a hexadecimal string. ### Returns The method returns an array of trace objects, each of which contains detailed information about a particular operation. These trace objects include the following fields: * `action` (object): describes the action that was performed. The structure of this object varies based on the type of action. * For `call` actions: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create` actions: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward` actions: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide` actions: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): the number of the block containing the transaction. * `result` (object): describes the result of the action. * For `call` actions: * `gasUsed` (string): the amount of gas used by the call. * `output` (string): the output data from the call. * For `create` actions: * `address` (string): the address of the created contract. * `code` (string): the runtime code of the created contract. * `gasUsed` (string): the amount of gas used by the creation. * For `reward` actions: no additional fields. * For `suicide` actions: no additional fields. * `subtraces` (integer): the number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): the address within the trace hierarchy, indicating the position of the trace in the call stack. * `transactionHash` (string): the hash of the transaction containing the trace. * `transactionPosition` (integer): the index position of the transaction within the block. * `type` (string): the type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_block", "params": ["0x14869E9E"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0x33fae588909af0e48e0e70e799c366206d98e27a4b31c818324a5c95d5d9fe1b", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "result": { "type": "CALL", "from": "0x12090c459a10757e4debaa114a46c082c22bdc70", "to": "0x8018de591a0593bf856ffcff675ad87c39b8e633", "value": "0x3bcb33300e37dc0000", "gas": "0x0", "gasUsed": "0x0", "input": "0x", "output": "0x" } } ] } ``` --- ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0x2A5D33", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "result": { "type": "CALL", "from": "0x12090c459a10757e4debaa114a46c082c22bdc70", "to": "0x8018de591a0593bf856ffcff675ad87c39b8e633", "value": "0x3bcb33300e37dc0000", "gas": "0x0", "gasUsed": "0x0", "input": "0x", "output": "0x" } } ] } ``` --- ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ethereum/history/ title: Ethereum — History, eth, Trace and debug (1/3) source: docs/rpc-service/chains/chains-api/ethereum/history.mdx --- # Ethereum — History, eth, Trace and debug (1/3) > API reference for [Ethereum](/rpc-service/chains/chains-api/ethereum/). [All methods ->](/rpc-service/chains/chains-api/ethereum/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/ethereum/history-p2/) · [3](/rpc-service/chains/chains-api/ethereum/history-p3/) ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xc5043f", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa917fcc721a5465a484e9be17cda0cc5493933dd3bc70c9adbee192cb419c9d7", "blockNumber": "0xc5043f", "from": "0x829bd824b016326a401d083b33d092293333a830", "gas": "0x33450", "gasPrice": "0x0", "hash": "0xdf8d8677c9cd5f81d8ee3663a4a64ce7fe93d35fcb46004529e77394630f8e11", "input": "0x", "nonce": "0xa16562", "to": "0x6e2edc2af25cd5704d99ba73ac7ece701f50192d", "transactionIndex": "0x2", "value": "0x20b9632b7dc0a3e", "type": "0x0", "v": "0x26", "r": "0x6fd8d85d440c87e894898ce7c12725eb994d416b0843ae5ddb0f188bc21ac9a2", "s": "0x47fe6bc7bb3ddc8d579509fed960934ab8ed6004152e62b2abca6639393b8e77" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ethereum/ title: Ethereum description: In order for your Web3 application to interact with the Ethereum blockchain — either by reading blockchain data… 32 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/ethereum/index.mdx --- # Ethereum
> Ethereum API is available on [Web3 API platform](https://www.ankr.com/rpc/ethereum). In order for your Web3 application to interact with the Ethereum blockchain — either by reading blockchain data or sending transactions to the network — it must connect to an Ethereum node. For this purpose, every [Ethereum client](https://ethereum.org/en/developers/docs/nodes-and-clients/#execution-clients) implements a [JSON-RPC specification](https://github.com/ethereum/execution-apis), so there are a uniform set of methods that applications can rely on regardless of the specific node or client implementation. [JSON-RPC](https://www.jsonrpc.org/specification) is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format. ## Gossip, State, History A handful of core JSON-RPC methods query data from the Ethereum network, and fall neatly into three main categories: Gossip, State, and History. Use the links in these sections to jump to each method, or use the table of contents to explore the whole list of methods. ### Gossip methods These methods track the head of the chain. This is how transactions make their way around the network, find their way into blocks, and how clients find out about new blocks. * [`eth_blockNumber`](/rpc-service/chains/chains-api/ethereum/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. ### State methods Methods that report the current state of all the data stored. The "state" is like one big shared piece of RAM, and includes account balances, contract data, and gas estimations. * [`eth_getBalance`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/ethereum/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getCode`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getcode) — returns code at an address specified. * [`eth_call`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_simulateV1`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_simulatev1) — simulates multiple blocks and transactions without creating transactions or blocks on the blockchain. ### History methods Fetches historical records of every block back to genesis. This is like one large append-only file, and includes all block headers, block bodies, uncle blocks, and transaction receipts. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/ethereum/web3-p3/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/ethereum/history/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/ethereum/history/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/ethereum/history/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/ethereum/history/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/ethereum/history/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/ethereum/history/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. ### Trace and debug methods Available on archive nodes for Premium and Enterprise plans, and priced the same as standard calls. These methods return internal execution traces for historical transactions and blocks. * [`trace_filter`](/rpc-service/chains/chains-api/ethereum/history-p2/#trace_filter) — retrieve traces that match filter criteria. * [`trace_transaction`](/rpc-service/chains/chains-api/ethereum/history-p2/#trace_transaction) — retrieves the traces created during the execution of a given transaction. * [`trace_replayTransaction`](/rpc-service/chains/chains-api/ethereum/history-p2/#trace_replaytransaction) — replays a transaction and returns the traces produced by its execution along with the state changes. * [`trace_replayBlockTransactions`](/rpc-service/chains/chains-api/ethereum/history-p2/#trace_replayblocktransactions) — replays all the transactions in a given block and returns the traces produced by their execution along with the state changes. * [`trace_block`](/rpc-service/chains/chains-api/ethereum/history-p3/#trace_block) — retrieves a detailed trace of all the transactions in a specific block. * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/ethereum/history-p3/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/ethereum/history-p3/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/ethereum/history-p3/#debug_traceblock) — traces the execution of all transactions within a block. ## Trace and debug methods The `trace_*` and `debug_*` families are served on the Ethereum **archive** node and are available on the **Premium** and **Enterprise** plans. They are priced the same as standard calls. Each API key has a **block-range cap** for these methods. A request whose block range exceeds the cap returns error [`-32602` (invalid params)](/rpc-service/errors/overview/); narrow the block range or contact support to raise the cap for your key. See [Per-chain & method quirks](/rpc-service/errors/per-chain-quirks/#block-range-limits-on-eth_getlogs-and-trace_) for the current limits. --- ## Methods ### web3, net, eth, Gossip, State, History - [`web3_clientVersion`](/rpc-service/chains/chains-api/ethereum/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/ethereum/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/ethereum/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/ethereum/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/ethereum/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/ethereum/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/ethereum/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/ethereum/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/ethereum/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/ethereum/web3/#eth_getcode) - [`eth_sign`](/rpc-service/chains/chains-api/ethereum/web3/#eth_sign) - [`eth_signTransaction`](/rpc-service/chains/chains-api/ethereum/web3/#eth_signtransaction) - [`eth_sendTransaction`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_sendtransaction) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_estimategas) - [`eth_simulateV1`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_simulatev1) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/ethereum/web3-p3/#eth_getblockbynumber) ### History, eth, Trace and debug - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/ethereum/history/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/ethereum/history/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/ethereum/history/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/ethereum/history/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/ethereum/history/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/ethereum/history/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/ethereum/history-p2/#eth_getlogs) - [`trace_filter`](/rpc-service/chains/chains-api/ethereum/history-p2/#trace_filter) - [`trace_transaction`](/rpc-service/chains/chains-api/ethereum/history-p2/#trace_transaction) - [`trace_replayTransaction`](/rpc-service/chains/chains-api/ethereum/history-p2/#trace_replaytransaction) - [`trace_replayBlockTransactions`](/rpc-service/chains/chains-api/ethereum/history-p2/#trace_replayblocktransactions) - [`trace_block`](/rpc-service/chains/chains-api/ethereum/history-p3/#trace_block) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/ethereum/history-p3/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/ethereum/history-p3/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/ethereum/history-p3/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ethereum/web3-p2/ title: Ethereum — web3, net, eth, Gossip, State, History (2/3) source: docs/rpc-service/chains/chains-api/ethereum/web3-p2.mdx --- # Ethereum — web3, net, eth, Gossip, State, History (2/3) > API reference for [Ethereum](/rpc-service/chains/chains-api/ethereum/). [All methods ->](/rpc-service/chains/chains-api/ethereum/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/ethereum/web3/) · 2 · [3](/rpc-service/chains/chains-api/ethereum/web3-p3/) ## `eth_sendTransaction` > Signs and submits a transaction. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; required): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional for contract creation): the address the transaction is directed to. * `gas` (string; quantity; optional; default: 90000): the gas provided for the transaction execution. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data): the compiled code of a contract OR the hash of the invoked method signature and encoded parameters. * `nonce` (string; quantity; optional): a nonce; allows to overwrite your own pending transactions that use the same nonce. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendTransaction", "params": [ { "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a" } ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/ethereum/history/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5de2" } ``` --- ## `eth_simulateV1` > Simulates multiple blocks and transactions without creating transactions or blocks on the blockchain. The `eth_simulateV1` method allows the simulation of multiple blocks and transactions without creating transactions or blocks on the blockchain. It functions similarly to `eth_call`, but offers more control. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the simulation payload: * `blockStateCalls` (array): an array of the block state call objects. * `blockOverrides` (object; optional): an object to override block-level parameters. * `baseFeePerGas` (string): the base fee per gas for the block, encoded as hexadecimal. * `stateOverrides` (object; optional): an object to override account states. * `address` (object): the address of the account to override. * `balance` (string; optional): the balance to set for the account, encoded as hexadecimal. * `calls` (array): an array of transaction call objects: * `from` (string; optional): the address from which the transaction is sent. * `to` (string): the address to which the transaction is sent. * `maxFeePerGas` (string; optional): the maximum fee per gas the sender is going to pay. * `value` (string; optional): the value sent with the transaction, encoded as hexadecimal. * `validation` (boolean; optional): indicates whether to perform validation checks. * `traceTransfers` (boolean; optional): indicates whether to trace value transfers. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns On a successful `eth_simulateV1` call, an array of generated full blocks is returned (the same object that you would get with `eth_getBlockByHash`, except for an added calls field), otherwise an error is returned. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_simulateV1", "params": "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" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "baseFeePerGas": "0x9", "blobGasUsed": "0x0", "calls": [ { "returnData": "0x", "logs": [ { "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000c000000000000000000000000000000000000000", "0x000000000000000000000000c000000000000000000000000000000000000001" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "blockNumber": "0x13d2747", "transactionHash": "0xe7217784e0c3f7b35d39303b1165046e9b7e8af9b9cf80d5d5f96c3163de8f51", "transactionIndex": "0x0", "blockHash": "0x5e28f54a56dc9df973a058cd54b3eeef8c67a1a613cb5db1df8a0a434c931d56", "logIndex": "0x0", "removed": false } ], "gasUsed": "0x5208", "status": "0x1" }, { "returnData": "0x", "logs": [ { "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000c000000000000000000000000000000000000000", "0x000000000000000000000000c000000000000000000000000000000000000002" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "blockNumber": "0x13d2747", "transactionHash": "0xf0182201606ec03701ba3a07d965fabdb4b7d06b424f226ea7ec3581802fc6fa", "transactionIndex": "0x1", "blockHash": "0x5e28f54a56dc9df973a058cd54b3eeef8c67a1a613cb5db1df8a0a434c931d56", "logIndex": "0x1", "removed": false } ], "gasUsed": "0x5208", "status": "0x1" } ], "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0x", "gasLimit": "0x1c9c380", "gasUsed": "0xa410", "hash": "0x5e28f54a56dc9df973a058cd54b3eeef8c67a1a613cb5db1df8a0a434c931d56", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x4838b106fce9647bdf1e7877bf73ce8b0bad5f97", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x13d2747", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "parentHash": "0xd24222b93a05a066cf79dc20e333f5aa6bb06d36eb50eb2b6b0b744b937e7975", "receiptsRoot": "0x75308898d571eafb5cd8cde8278bf5b3d13c5f6ec074926de3bb895b519264e1", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x298", "stateRoot": "0xbb0740745211507e2a2a6cdb627dfa171ef5050ad2a01e5401c2e3df4be5b919", "timestamp": "0x66ec2853", "totalDifficulty": "0xc70d815d562d3cfa955", "transactions": [ "0xe7217784e0c3f7b35d39303b1165046e9b7e8af9b9cf80d5d5f96c3163de8f51", "0xf0182201606ec03701ba3a07d965fabdb4b7d06b424f226ea7ec3581802fc6fa" ], "transactionsRoot": "0x9bdb74f3ce41f5893a02a631e904ae0d21ae8c4e416786d8dbd9cb5c54f1dc0f", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } ] } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ethereum/web3-p3/ title: Ethereum — web3, net, eth, Gossip, State, History (3/3) source: docs/rpc-service/chains/chains-api/ethereum/web3-p3.mdx --- # Ethereum — web3, net, eth, Gossip, State, History (3/3) > API reference for [Ethereum](/rpc-service/chains/chains-api/ethereum/). [All methods ->](/rpc-service/chains/chains-api/ethereum/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/ethereum/web3/) · [2](/rpc-service/chains/chains-api/ethereum/web3-p2/) · 3 ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ethereum/web3/ title: Ethereum — web3, net, eth, Gossip, State, History (1/3) source: docs/rpc-service/chains/chains-api/ethereum/web3.mdx --- # Ethereum — web3, net, eth, Gossip, State, History (1/3) > API reference for [Ethereum](/rpc-service/chains/chains-api/ethereum/). [All methods ->](/rpc-service/chains/chains-api/ethereum/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/ethereum/web3-p2/) · [3](/rpc-service/chains/chains-api/ethereum/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Geth/v1.10.26-stable-e5eb32ac/linux-amd64/go1.18.5" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or FALSE, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2b2a3ec91" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xf5f277" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2c85c3ecfcb5fb" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xb6" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0xc5043f"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sign` > Returns an EIP-191 signature over the provided data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (data, N bytes): a message to sign. ### Returns
* `` (data): an EIP-191 signature. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sign", "params": ["0x9b2055d370f73ec7d8a03e965129118dc8f5bf83", "0xdeadbeaf"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b" } ``` --- ## `eth_signTransaction` > Signs a transaction that can be submitted to the network at a later time using with [eth_sendRawTransaction](/rpc-service/chains/chains-api/ethereum/web3-p2/#eth_sendrawtransaction). ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; required): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional for contract creation): the address the transaction is directed to. * `gas` (string; quantity; optional; default: 90000): the gas provided for the transaction execution. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data): the compiled code of a contract OR the hash of the invoked method signature and encoded parameters. * `nonce` (string; quantity; optional): a nonce; allows to overwrite your own pending transactions that use the same nonce. ### Returns
* `` (data): a signed transaction. ### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_signTransaction", "params": [ { "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a", "nonce": "0x689056015818adbe" } ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/etherlink/eth/ title: Etherlink — eth source: docs/rpc-service/chains/chains-api/etherlink/eth.mdx --- # Etherlink — eth > API reference for [Etherlink](/rpc-service/chains/chains-api/etherlink/). [All methods ->](/rpc-service/chains/chains-api/etherlink/#methods) ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xf9cc7eca8ec48421df80657bd1bf2c856161a965cacfc23a68e2a9a9fb8545b8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "transactionHash": "0xf9cc7eca8ec48421df80657bd1bf2c856161a965cacfc23a68e2a9a9fb8545b8", "transactionIndex": "0x1", "blockHash": "0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "blockNumber": "0x143e555", "from": "0x97f6e5458e83a4dc31020056213d44d0abeff46d", "to": "0x1f8e735f424b7a49a885571a2fa104e8c13c26c7", "cumulativeGasUsed": "0x64a9d8", "effectiveGasPrice": "0x3b9aca00", "gasUsed": "0x225535", "logs": [ { "address": "0x2c03058c8afc06713be23e58d2febc8337dbfe6a", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000097f6e5458e83a4dc31020056213d44d0abeff46d", "0x0000000000000000000000000000000000000000000000000000000000000000" ], "data": "0x00000000000000000000000000000000000000000000000000000000001e8480", "blockNumber": "0x143e555", "transactionHash": "0xf9cc7eca8ec48421df80657bd1bf2c856161a965cacfc23a68e2a9a9fb8545b8", "transactionIndex": "0x1", "blockHash": "0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "logIndex": "0x2", "removed": false }, { "address": "0xcb566e3b6934fa77258d68ea18e931fa75e1aaaa", "topics": [ "0xdf21c415b78ed2552cc9971249e32a053abce6087a0ae0fbf3f78db5174a3493" ], "data": "0x00000000000000000000000000000000000000000000000058fdd3accbe2ac2b", "blockNumber": "0x143e555", "transactionHash": "0xf9cc7eca8ec48421df80657bd1bf2c856161a965cacfc23a68e2a9a9fb8545b8", "transactionIndex": "0x1", "blockHash": "0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "logIndex": "0x3", "removed": false } ], "logsBloom": "0x00000000000000000000200000000000000040000000000008000000000800000000000000000000000002000000000000000000000000040000000000000000004000000000000000000008000000002000000000800000000000000000000000040000020000004000000000000800020040000000000000000010000000000000000040000000000000000000000000000200280000000000100000000000000000000000020000000000000100000200000000000000000000000000000400003042000008000000008000000000000000000008000001000000000020001000000000000000400000000100020000000000000000000000000000000000", "type": "0x2", "status": "0x1", "contractAddress": null }, "id": 1 } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "0x1"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x143E555", "0x1"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "fromBlock": "0x143E555", "toBlock": "0x143E556" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": [ { "address": "0x79052ab3c166d4899a1e0dd033ac3b379af0b1fd", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000003ef3d8ba38ebe18db133cec108f4d14ce00dd9ae", "0x0000000000000000000000007fe17f2f2e3837b94eaa1f4835acbe499403f4cf" ], "data": "0x000000000000000000000000000000000000000000000000016345785d8a0000", "blockNumber": "0x143e555", "transactionHash": "0x5cf0a322447e1f5b1fea4d973ab33fd7feee65e6ad3d251dbc4b458ed286a7ef", "transactionIndex": "0x0", "blockHash": "0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "logIndex": "0x0", "removed": false }, { "address": "0x3ef3d8ba38ebe18db133cec108f4d14ce00dd9ae", "topics": [ "0xf7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd3992683", "0x0000000000000000000000007fe17f2f2e3837b94eaa1f4835acbe499403f4cf", "0x00000000000000000000000079052ab3c166d4899a1e0dd033ac3b379af0b1fd" ], "data": "0x000000000000000000000000000000000000000000000000016345785d8a0000", "blockNumber": "0x143e555", "transactionHash": "0x5cf0a322447e1f5b1fea4d973ab33fd7feee65e6ad3d251dbc4b458ed286a7ef", "transactionIndex": "0x0", "blockHash": "0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "logIndex": "0x1", "removed": false } ], "id": 1 } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/etherlink/ title: Etherlink description: Etherlink is an EVM-compatible, non-custodial Layer 2 blockchain powered by Tezos Smart Rollup technology. 27 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/etherlink/index.mdx --- # Etherlink
> Etherlink API is available on [Web3 API platform](https://www.ankr.com/rpc/etherlink). *Etherlink* is an EVM-compatible, non-custodial Layer 2 blockchain powered by [Tezos Smart Rollup technology](https://tezos.com/developers/smart-rollups/). It enables seamless integration with existing Ethereum tools, including wallets and indexers, and facilitates asset transfers to and from other EVM-compatible chains. Built upon the secure foundation of Tezos layer 1, Etherlink delivers a fast, fair, and (nearly) free experience. This permissionless and censorship-resistant environment empowers developers to actively create and participate in the next generation of decentralized applications. In order for your Web3 application to interact with Etherlink — either by reading blockchain data or sending transactions to the network — it must connect to an Etherlink node. Developers interact with the blockchain using the methods provided by the API. Responses come in [JSON format](https://www.json.org/json-en.html). ## EVM JSON-RPC methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/etherlink/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/etherlink/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/etherlink/web3/#net_version) — returns the current network ID. * [`eth_gasPrice`](/rpc-service/chains/chains-api/etherlink/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/etherlink/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/etherlink/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/etherlink/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/etherlink/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_sendRawTransactionSync`](/rpc-service/chains/chains-api/etherlink/web3/#eth_sendrawtransactionsync) — submits a transaction and retrieves the transaction receipt. * [`eth_call`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/etherlink/web3-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/etherlink/eth/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/etherlink/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/etherlink/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/etherlink/eth/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/etherlink/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/etherlink/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/etherlink/web3/#net_version) - [`eth_gasPrice`](/rpc-service/chains/chains-api/etherlink/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/etherlink/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/etherlink/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/etherlink/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/etherlink/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/etherlink/web3/#eth_sendrawtransaction) - [`eth_sendRawTransactionSync`](/rpc-service/chains/chains-api/etherlink/web3/#eth_sendrawtransactionsync) - [`eth_call`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/etherlink/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/etherlink/web3-p3/#eth_gettransactionbyblocknumberandindex) ### eth - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/etherlink/eth/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/etherlink/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/etherlink/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/etherlink/eth/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/etherlink/web3-p2/ title: Etherlink — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/etherlink/web3-p2.mdx --- # Etherlink — web3, net, eth (2/3) > API reference for [Etherlink](/rpc-service/chains/chains-api/etherlink/). [All methods ->](/rpc-service/chains/chains-api/etherlink/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/etherlink/web3/) · 2 · [3](/rpc-service/chains/chains-api/etherlink/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x98FDFB4CF568E11Aed0b5180452aa2Fc3401b5d8", "data": "0x70a08231000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf9" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0x97F6e5458e83A4dc31020056213d44D0abeFf46d", "to": "0xd7e6B324eE4D34BcC3c830b654c286AB9EEC0226", "data": "0xa9059cbb000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf90000000000000000000000000000000000000000000000000000000000000064" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xdad5e" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "number": "0x143e555", "hash": "0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "parentHash": "0x1e7ed48c4969daeb201b04b12f16022be7dc5dd04aa920e70745980f352a9c12", "nonce": "0x0000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x40000000000000000000200002000000000040000000000008000000000800000000000000000000000002000000000000000200000000040000000000000000004000000080001000000009080000002000000000800000000000100000000000040000020000004000000000000800020040000000000000000110000000000000000060000000000000000000000000000200280000000000100000000000000000410000020200000000000100000200000000000000000000000000000400003042000008800000008000000000000000100008000001000000000020001004000000000000400000010100020000000000000000000000000040000000", "transactionsRoot": "0x705fa8110132fac5946737f2a68b9cc2190bf27ac474b50758dd4cbdf55678f5", "stateRoot": "0x0583a7266bec97d8596da30666271e9e838de685b85a461ee77fef9bca4fbf58", "receiptsRoot": "0x15746c393ff5d8fa47b8bd7ffb430f315a5fe3f5c20812c75d45201a8b95dc56", "miner": "0xcf02b9ca488f8f6f4e28e37aa1bdd16b3f1b2ad8", "difficulty": "0x0", "totalDifficulty": "0x0", "extraData": "0x", "size": "0x29b", "gasLimit": "0x4000000000000", "gasUsed": "0x64a9d8", "timestamp": "0x6878e301", "transactions": [ "0x5cf0a322447e1f5b1fea4d973ab33fd7feee65e6ad3d251dbc4b458ed286a7ef", "0xf9cc7eca8ec48421df80657bd1bf2c856161a965cacfc23a68e2a9a9fb8545b8" ], "uncles": [], "baseFeePerGas": "0x3b9aca00", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0", "excessBlobGas": "0x0", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" }, "id": 1 } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "number": "0x143e600", "hash": "0x80fb97297c1f0df6a984c1b3250937c1ea1700aab6d8f61df01dde09d0de0c5d", "parentHash": "0x6679d135b0cc81321a600ce6e3c8748fe13da92f83742819a46f9c5ee64ee6bf", "nonce": "0x0000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "transactionsRoot": "0x1ef322c2a6b66dadcee102996f9e38345688c779475f4ba4f31de6fe81485888", "stateRoot": "0x374518508855beb94f7ea459e3b348a2c62a0a087e1d1eaa79824204288b58d2", "receiptsRoot": "0x5251f0e2f1e9e85badc7e612ccd6b1d454dbc7d36d4cfef8ac431574e5bed6b8", "miner": "0xcf02b9ca488f8f6f4e28e37aa1bdd16b3f1b2ad8", "difficulty": "0x0", "totalDifficulty": "0x0", "extraData": "0x", "size": "0x279", "gasLimit": "0x4000000000000", "gasUsed": "0x174d0b", "timestamp": "0x6878e432", "transactions": [ "0xf1be17dbf364de850f8d8f22052cf29d222082e258b6125c23e2e1776e40b6fa" ], "uncles": [], "baseFeePerGas": "0x3b9aca00", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0", "excessBlobGas": "0x0", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" }, "id": 1 } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xf9cc7eca8ec48421df80657bd1bf2c856161a965cacfc23a68e2a9a9fb8545b8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "type": "0x2", "chainId": "0xa729", "hash": "0xf9cc7eca8ec48421df80657bd1bf2c856161a965cacfc23a68e2a9a9fb8545b8", "nonce": "0x1f", "blockHash": "0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "blockNumber": "0x143e555", "transactionIndex": "0x1", "from": "0x97f6e5458e83a4dc31020056213d44d0abeff46d", "to": "0x1f8e735f424b7a49a885571a2fa104e8c13c26c7", "value": "0x6b3aeb905b929ad6", "gas": "0x25fdd0", "maxFeePerGas": "0x77359400", "maxPriorityFeePerGas": "0x77359400", "accessList": [], "input": "0x879762e20000000000000000000000002c03058c8afc06713be23e58d2febc8337dbfe6a000000000000000000000000000000000000000000000000000000000000006500000000000000000000000000000000000000000000000000000000001e848000000000000000000000000097f6e5458e83a4dc31020056213d44d0abeff46d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000097f6e5458e83a4dc31020056213d44d0abeff46d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000220001000000000000000000000000000000000000000000000000000000000001e848000000000000000000000000000000000000000000000000000000000000", "v": "0x1", "r": "0x24e603e5c44fbd515416ad5816f3acbde95bc54fc87fab8b16c873256de54244", "s": "0x265a1cf3c1b9fd5fc7b5a3b7e3be60a7ff2d58b668b08b04bc23a184d3ffe2ac" }, "id": 1 } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "0x1" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "type": "0x2", "chainId": "0xa729", "hash": "0xf9cc7eca8ec48421df80657bd1bf2c856161a965cacfc23a68e2a9a9fb8545b8", "nonce": "0x1f", "blockHash": "0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "blockNumber": "0x143e555", "transactionIndex": "0x1", "from": "0x97f6e5458e83a4dc31020056213d44d0abeff46d", "to": "0x1f8e735f424b7a49a885571a2fa104e8c13c26c7", "value": "0x6b3aeb905b929ad6", "gas": "0x25fdd0", "maxFeePerGas": "0x77359400", "maxPriorityFeePerGas": "0x77359400", "accessList": [], "input": "0x879762e20000000000000000000000002c03058c8afc06713be23e58d2febc8337dbfe6a000000000000000000000000000000000000000000000000000000000000006500000000000000000000000000000000000000000000000000000000001e848000000000000000000000000097f6e5458e83a4dc31020056213d44d0abeff46d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000097f6e5458e83a4dc31020056213d44d0abeff46d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000220001000000000000000000000000000000000000000000000000000000000001e848000000000000000000000000000000000000000000000000000000000000", "v": "0x1", "r": "0x24e603e5c44fbd515416ad5816f3acbde95bc54fc87fab8b16c873256de54244", "s": "0x265a1cf3c1b9fd5fc7b5a3b7e3be60a7ff2d58b668b08b04bc23a184d3ffe2ac" }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/etherlink/web3-p3/ title: Etherlink — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/etherlink/web3-p3.mdx --- # Etherlink — web3, net, eth (3/3) > API reference for [Etherlink](/rpc-service/chains/chains-api/etherlink/). [All methods ->](/rpc-service/chains/chains-api/etherlink/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/etherlink/web3/) · [2](/rpc-service/chains/chains-api/etherlink/web3-p2/) · 3 ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x143E555", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "type": "0x2", "chainId": "0xa729", "hash": "0xf9cc7eca8ec48421df80657bd1bf2c856161a965cacfc23a68e2a9a9fb8545b8", "nonce": "0x1f", "blockHash": "0x74075370eba6036bef4f0e02f7dd6d3a59adefe26d0c218c1f8960f6a89fd1de", "blockNumber": "0x143e555", "transactionIndex": "0x1", "from": "0x97f6e5458e83a4dc31020056213d44d0abeff46d", "to": "0x1f8e735f424b7a49a885571a2fa104e8c13c26c7", "value": "0x6b3aeb905b929ad6", "gas": "0x25fdd0", "maxFeePerGas": "0x77359400", "maxPriorityFeePerGas": "0x77359400", "accessList": [], "input": "0x879762e20000000000000000000000002c03058c8afc06713be23e58d2febc8337dbfe6a000000000000000000000000000000000000000000000000000000000000006500000000000000000000000000000000000000000000000000000000001e848000000000000000000000000097f6e5458e83a4dc31020056213d44d0abeff46d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000097f6e5458e83a4dc31020056213d44d0abeff46d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000220001000000000000000000000000000000000000000000000000000000000001e848000000000000000000000000000000000000000000000000000000000000", "v": "0x1", "r": "0x24e603e5c44fbd515416ad5816f3acbde95bc54fc87fab8b16c873256de54244", "s": "0x265a1cf3c1b9fd5fc7b5a3b7e3be60a7ff2d58b668b08b04bc23a184d3ffe2ac" }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/etherlink/web3/ title: Etherlink — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/etherlink/web3.mdx --- # Etherlink — web3, net, eth (1/3) > API reference for [Etherlink](/rpc-service/chains/chains-api/etherlink/). [All methods ->](/rpc-service/chains/chains-api/etherlink/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/etherlink/web3-p2/) · [3](/rpc-service/chains/chains-api/etherlink/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "octez-evm-node/octez-evm-node 0.29-b42b360a/Unix/ocamlc.5.2.1" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "42793" } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3b9aca00" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x143e45f" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xd7e6B324eE4D34BcC3c830b654c286AB9EEC0226", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3c978fa2e776edc2c" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xA2cCa359C43839040cF3D230DeB1689AB8db2dac", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000001" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xd7e6B324eE4D34BcC3c830b654c286AB9EEC0226", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x26" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x2a014d2f605a0088ea65a60b8ca6f3f8f95b2575d696f5a41ff51c3ab895e5e1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x143E45D"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x2a014d2f605a0088ea65a60b8ca6f3f8f95b2575d696f5a41ff51c3ab895e5e1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x143E45D"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xA2cCa359C43839040cF3D230DeB1689AB8db2dac", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x60806040523661001357610011610017565b005b6100115b61001f6101b7565b6001600160a01b0316336001600160a01b0316141561016f5760606001600160e01b031960003516631b2ce7f360e11b8114156100655761005...", "id": 1 } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/etherlink/eth/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_tx_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_sendRawTransactionSync` > Submits a transaction and retrieves the transaction receipt. Synchronous transaction submission; waits for transaction to be included in a block before returning. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data; required): the valid hex-encoded, RLP-encoded signed transaction. 2. `` (quantity; optional): maximum wait time in milliseconds. MUST be a positive integer not greater than the node-configured maximum timeout. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example (no timeout) ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransactionSync", "params": [ "0xf86c808504a817c80082520894ab... (signed tx hex)" ], "id": 1 }' ``` ### Request example (with timeout) ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransactionSync", "params": [ "0xf86c808504a817c80082520894ab... (signed tx hex)", 5000 ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x1234abcd...", "blockHash": "0xabcd1234...", "blockNumber": "0x10d4f", "cumulativeGasUsed": "0x5208", "gasUsed": "0x5208", "contractAddress": null, "logs": [], "status": "0x1" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/fantom/ title: Fantom description: Fantom is a secure platform to build DApps. 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/fantom/index.mdx --- # Fantom
> Fantom API is available on [Web3 API platform](https://www.ankr.com/rpc/fantom). *Fantom* is a secure platform to build DApps. It is fully permissionless and open-source. Powered by Fantom’s [aBFT consensus algorithm](https://docs.fantom.foundation/technology/lachesis-abft), it leverages its speed to produce real-world applications with no risks of congestion or long confirmation times. The Fantom Opera mainnet is compatible with the Ethereum Virtual Machine (EVM) and provides full smart contracts support through Solidity. In order for your Web3 application to interact with Fantom — either by reading blockchain data or sending transactions to the network — it must connect to a Fantom node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format. ## EVM methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/fantom/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/fantom/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/fantom/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/fantom/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/fantom/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/fantom/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/fantom/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/fantom/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/fantom/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/fantom/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/fantom/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/fantom/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/fantom/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/fantom/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/fantom/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/fantom/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/fantom/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/fantom/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/fantom/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/fantom/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/fantom/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/fantom/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/fantom/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/fantom/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/fantom/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/fantom/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/fantom/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/fantom/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/fantom/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/fantom/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/fantom/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/fantom/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/fantom/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/fantom/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/fantom/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/fantom/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/fantom/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/fantom/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/fantom/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/fantom/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/fantom/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/fantom/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/fantom/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/fantom/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/fantom/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/fantom/web3-p2/ title: Fantom — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/fantom/web3-p2.mdx --- # Fantom — web3, net, eth (2/3) > API reference for [Fantom](/rpc-service/chains/chains-api/fantom/). [All methods ->](/rpc-service/chains/chains-api/fantom/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/fantom/web3/) · 2 · [3](/rpc-service/chains/chains-api/fantom/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53b8" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x0", "epoch": "0x6", "extraData": "0x", "gasLimit": "0xffffffffffff", "gasUsed": "0x0", "hash": "0x00000006000000b549fb006ed66b590c0a71a4a486bc01356690b2cb21aaff6a", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x1b4", "parentHash": "0x00000006000000ae9dde43db2a404307096de54f792c6401d497e486f091bead", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x221", "stateRoot": "0x336556149d94c7a7c9733e84acf23d22a4c175beb3d7fcb6be09cbf3ff4a78c9", "timestamp": "0x5e070f9b", "timestampNano": "0x15e47b09e1aa9224", "totalDifficulty": "0x0", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xc5043f", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x00005a74000000fec7bf1f56c60d8fc0903da29d13b8e151c768c8630b999b4c", "blockNumber": "0xc5043f", "from": "0xc473ba887c10ec39533fa734d95be5712c556bb1", "gas": "0x445c0", "gasPrice": "0x2e90edd000", "hash": "0x37c19dd4771fd81cd2d0f3379e47dc4c11ff31f74b771ef631b162db0e0b5167", "input": "0xb3d16931000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000003e63e6ae34fcb270f19fdbe83d506e803fdc402ef650000000000000000000003e5971d049b7bde4ca9192a461708ebb54c8ebc08430000000b53affd05137f800021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000000000000000000000000000000000000000000400000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c8300000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d", "nonce": "0xcd", "to": "0xc6e3567cc9cef8cc243343186cb64b4fc9d7cd0c", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "v": "0x218", "r": "0x6bfc4a999f4f3aeea39a872d3b1a44b5f9dae0ffb27c4bb1e1bbb77a473742ff", "s": "0x5ea8bc05b9de3617dd7242ef263defaea92fa239e0f8695d51e5ae335c21de31" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/fantom/web3-p3/ title: Fantom — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/fantom/web3-p3.mdx --- # Fantom — web3, net, eth (3/3) > API reference for [Fantom](/rpc-service/chains/chains-api/fantom/). [All methods ->](/rpc-service/chains/chains-api/fantom/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/fantom/web3/) · [2](/rpc-service/chains/chains-api/fantom/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3c9329b765d88c03d18f87dc1f2b5138c89d9a415d5c73dc7827b87aca176c8e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/fantom/web3/ title: Fantom — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/fantom/web3.mdx --- # Fantom — web3, net, eth (1/3) > API reference for [Fantom](/rpc-service/chains/chains-api/fantom/). [All methods ->](/rpc-service/chains/chains-api/fantom/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/fantom/web3-p2/) · [3](/rpc-service/chains/chains-api/fantom/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "go-opera/v1.1.2-rc.5-81e30d16-1675120259/linux-amd64/go1.19.5" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "250" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or FALSE, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xc502c7c3d" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x34b4728" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2c85c3ecfcb5fb" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x36c1d18"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xb6" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0xc5043f"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/fantom/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/filecoin/chain-p2/ title: Filecoin — Chain, Client, Gas, Mpool, State (2/2) source: docs/rpc-service/chains/chains-api/filecoin/chain-p2.mdx --- # Filecoin — Chain, Client, Gas, Mpool, State (2/2) > API reference for [Filecoin](/rpc-service/chains/chains-api/filecoin/). [All methods ->](/rpc-service/chains/chains-api/filecoin/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/filecoin/chain/) · 2 ### `Filecoin.ChainStatObj` > Returns statistics about the graph referenced by ‘obj’. If ‘base’ is also specified, then the returned stat will be a diff between the two objects. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainStatObj", "params": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Size": 42, "Links": 42 }, "id": 1 } ``` --- ### `Filecoin.ChainTipSetWeight` > Computes weight for the specified tipset. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainTipSetWeight", "params": [ [ { "/": "bafy2bzacea5dwduzwi4n4wjvdw4s4dsablhnqp3kujrmgqgxnxwz3m4gght4s" }, { "/": "bafy2bzaceci4q5qljz5rzglddqrtipyrv6i72zbecv5xzpqy43ptreqyj3s3e" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "63667007179", "id": 1 } ``` --- ## Client The Client methods all have to do with interacting with the storage and retrieval markets as a client. ### `Filecoin.ClientQueryAsk` > Returns a signed StorageAsk from the specified miner. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ClientQueryAsk", "params": [ "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", "f01234" ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Price": "0", "VerifiedPrice": "0", "MinPieceSize": 1032, "MaxPieceSize": 1032, "Miner": "f01234", "Timestamp": 10101, "Expiry": 10101, "SeqNo": 42 }, "id": 1 } ``` --- ## Gas The Gas methods are used for gas estimation. ### `Filecoin.GasEstimateFeeCap` > Estimates gas fee cap. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.GasEstimateFeeCap", "params": [ { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 0, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": "bafy2bzaceatjqvmrqlta7gouetgltx3ezw23xyh2ahy2h5zqvhcleo6rttmqw" }, 9, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "1269908302", "id": 1 } ``` --- ### `Filecoin.GasEstimateGasLimit` > Estimates gas used by the message and returns it. It fails if message fails to execute. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.GasEstimateGasLimit", "params": [ { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 0, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": "bafy2bzacediy5wtkxs46shn7d56hyzn6zl4mepfm3j4u25xtun5742u6de6h6" }, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "2392839", "id": 1 } ``` --- ### `Filecoin.GasEstimateGasPremium` > Estimates what gas price should be used for a message to have high likelihood of inclusion in `nblocksincl` epochs. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.GasEstimateGasPremium", "params": [ 42, "f01234", 9, [ { "/": "bafy2bzaceb5c256p6xkn4eaksxgmu3cszzeimrcs6643qwlxrwcnpehhzzdyo" }, { "/": "bafy2bzacebpan6qb7k2xgjdyp2fcnirwdc2xmvzh7em6ntvsxqa5l7ejpfw64" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "3352604", "id": 1 } ``` --- ### `Filecoin.GasEstimateMessageGas` > Estimates gas values for unset message gas fields. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.GasEstimateMessageGas", "params": [ { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzaceaele6zvcnuvzkwxvespae7qozzcs6brtgnvywnxqkxq2z67cgmyg" } }, { "MaxFee": "0" }, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "3023506976", "GasPremium": "3352018", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacedxnoclckkyz3nrnf7xe2pnaojvtr4hzpdagbfxkkfr5o5ry5x57y" } }, "id": 1 } ``` --- ## Mpool The Mpool methods are used for interacting with the message pool. The message pool manages all incoming and outgoing ‘messages’ going over the network. ### `Filecoin.MpoolGetNonce` > Gets next nonce for the specified sender. Note that this method may not be atomic. Use MpoolPushMessage instead. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.MpoolGetNonce", "params": [ "f01234" ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": 42, "id": 1 } ``` --- ### `Filecoin.MpoolPending` > Returns pending mempool messages. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.MpoolPending", "params": [ [ { "/": "bafy2bzacect7cxrcmvbvbwwe2gxbjd4kwb5f4kmk34yecq5lzqzuntb3xlxve" }, { "/": "bafy2bzaceb7upir45mhrpwljphikxkg257pxat5e6mztrt4ywd6rkv5byd2vg" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "Message": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "Signature": { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" }, "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } } ], "id": 1 } ``` --- ### `Filecoin.MpoolPush` > Pushes a signed message to mempool. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `write` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.MpoolPush", "params": [ { "Message": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzaceclufzjmo6tm2h6v3zykdl7cabgynfbbdwsrmcwn5ef77qjbar5jg" } }, "Signature": { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" }, "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "id": 1 } ``` --- ### `Filecoin.MpoolSub` [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.MpoolSub", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Type": 0, "Message": { "Message": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "Signature": { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" }, "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } } }, "id": 1 } ``` --- ## State The State methods are used to query, inspect, and interact with chain state. Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset. A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used. ### `Filecoin.StateAccountKey` > Returns the public key address of the given ID address. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateAccountKey", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "f01234", "id": 1 } ``` --- ### `Filecoin.StateAllMinerFaults` > Returns all non-expired Faults that occur within lookback epochs of the given tipset. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateAllMinerFaults", "params": [ 10101, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "Miner": "f01234", "Epoch": 10101 } ], "id": 1 } ``` --- ### `Filecoin.StateCall` > Runs the given message and returns its result without any persisted changes. StateCall applies the message to the tipset’s parent state. The message is not applied on-top-of the messages in the passed-in tipset. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateCall", "params": [ { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "MsgCid": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Msg": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "GasCost": { "Message": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "GasUsed": "0", "BaseFeeBurn": "0", "OverEstimationBurn": "0", "MinerPenalty": "0", "MinerTip": "0", "Refund": "0", "TotalCost": "0" }, "ExecutionTrace": { "Msg": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "Error": "string value", "Duration": 60000000000, "GasCharges": [ { "Name": "string value", "loc": [ { "File": "string value", "Line": 123, "Function": "string value" } ], "tg": 9, "cg": 9, "sg": 9, "vtg": 9, "vcg": 9, "vsg": 9, "tt": 60000000000, "ex": {} } ], "Subcalls": [ { "Msg": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "Error": "string value", "Duration": 60000000000, "GasCharges": [ { "Name": "string value", "loc": [ { "File": "string value", "Line": 123, "Function": "string value" } ], "tg": 9, "cg": 9, "sg": 9, "vtg": 9, "vcg": 9, "vsg": 9, "tt": 60000000000, "ex": {} } ], "Subcalls": null } ] }, "Error": "string value", "Duration": 60000000000 }, "id": 1 } ``` --- ### `Filecoin.StateChangedActors` > Returns all the actors whose states change between the two given state CIDs. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Response example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateChangedActors", "params": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "t01236": { "Code": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Head": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Nonce": 42, "Balance": "0" } }, "id": 1 } ``` --- ### `Filecoin.StateCirculatingSupply` > Returns the exact circulating supply of Filecoin at the given tipset. This is not used anywhere in the protocol itself, and is only for external consumption. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateCirculatingSupply", "params": [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0", "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/filecoin/chain/ title: Filecoin — Chain, Client, Gas, Mpool, State (1/2) source: docs/rpc-service/chains/chains-api/filecoin/chain.mdx --- # Filecoin — Chain, Client, Gas, Mpool, State (1/2) > API reference for [Filecoin](/rpc-service/chains/chains-api/filecoin/). [All methods ->](/rpc-service/chains/chains-api/filecoin/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/filecoin/chain-p2/) ### `Filecoin.ChainGetMessage` > Reads a message referenced by the specified CID from the chain blockstore. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetMessage", "params": [ { "/": "bafy2bzacedhxkyr5qwilac37vrdzr6wllxszrjhqrkiwjahoo45y4ihrtboqg" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Version": 0, "To": "f02028138", "From": "f3rqkaccyhdce5tzsvjbpxqgpi75aozdqcazvknr737hb4y7fon6tievirc63rywtvpbvqxsoihgxkcf7ygkna", "Nonce": 15420, "Value": "0", "GasLimit": 210764850, "GasFeeCap": "237231208", "GasPremium": "1833106", "Method": 7, "Params": "ghkiv1kHgJNuEGP9kyySXgeR9wHbpEZ/CMrU0fZ1EcozdrC9jIwPy4k+54mQTEDR6tfR8U6LS5MmoYJO1gwmKDSXiHXQScO+ZfSb6cBi7PyXkoXmlfqjRQMskEA2fUfnrnYV7DK3FhkbtR6a4zKpEubtMkVh9GBZ4dQC+A5/4LSL+huaacWXIZIZF6tYyqU+N9qNUe60CaXPhREUwYoI/COfCrBJNXuj27vvMlnyh7AaiRPlI8JsyTTUsaZHzce8icJ47r6mnIOlycBvW4W1IcUzkc/DPDOg9JR0NHEzt97cPyG3ZeRHNyCFN5eXTwmemX9Z30zmlo01LVakpDK4Ioecbx5kJ01zCdVV7DIXRBSJ9g9sTH1V94CIT8ffP69BGYKVMEQDgBjApA4lE6QGpRiOADjldwoHyi5WrXhgj2gt8yF3Y+H2/mTRFRKKV8HGIK5E99qKuYo3cVDmXsK7ey42OazN54dW+V3bUVU87ejHQCcstwCWUwwO+rZDqXc7na0O6DmwFJDpWxQZvOGcDO0B8vaw2krGxDr4JwhJTxAHeyIpVFDgjtibEvTKwnStWqn32v9vqbK6LdUG9P3Qln8qVtVtIBf3LR/gPCnCwxaJ1R3taHilJQdea9BvXWMqM5vkdj6ZEwvFm8Y8HBqe6MHCp7RHgShfKo/FgjGCaXg5/nvP1z7VUwjFnMbdqjKtc4hwOzjrhYtMo5CBX4sP0SdIdvCU1NPhQwPr7Csb7/k1ucr5ppw855wfahrYTiTXGLphlTBMw6AOSZNv48qEZg62MNgMzvSF5zZUVDmgQN4qOF5fP8MBMyjqTyFvkZMJ+H+CToEj8K8UPX6J9qjMjt0t9BYfz+gccqAHCU+iUpUxc9OqEEXqmqZDnyZoZiOVRP1ACxJ2QgMRSwy03vgve2rFUw+WDmpTUSfcSikTWq2q01pUTDf7l5+af/CyhQOlCpdURz1XRLYrRRAOa69+c2hRtkZEZfk7yp9EDzeEIKHJSdljnkX/0hPi7q1oMA2C0daFOcJefY0zAtycNvm96Po6hh1k0NDlUyfgAU+U/96X3eCzMFvDErL7GKi+yV0QN7BZlHdKsZDBKsMSHa9Mkp2q1h3dmx5BbBJ6RIxZBo0zYPSAF6/sh4uQj9hHnqeV/lIk9n+7mQA7VKM89lJnUvlAj8EOoWBNS4RQXGcfQppAfBmZfU5Tl7jGymsiegLXri+WMkOIt7bQUzkoLJM8670OGmh6WqVwIsOEyBrYAtDhaUMNhR+C4kN7NeADF0p3Vwm+Tzk4ialmfiHOnKJ18lTP9kVJHxLdOoPJGmffBhQ40OMg4Z1/T2xEjtmFboIO7tAtqOqP/4f5wfOCuQn4Dq8E9hOAotHmInkOPcQylq7CH37l5eqQYlLSSiUekHaj0NLIc5B3uxDg3tEPmn2/Wkt33IEUdUTdbfhkMiLt8KVjYchUIFkDrwRpYBZvxwF9JsAm5YcYWLAHKvFW3+vv85V36nClOyNexuXCv1VU+fM7HHRjJrwzDbh2WdYlBq2l696dfYqM3KqHPmHJxIZOgT3GT3f0jZsdrMUiFGQdmeKEDZHFihK8lomo2d3k0B++PdyZg7hb26RW62hkLcxxNh6OcbcIUVHUkIKtUI00XkrPd7+JKqJxcAgSc0zXW54qSyhB0OT1KBXQPONHk0Q6h4t7qk/zx2VRKCu0T4okkKoB0jZTBscmTIB/qAvnKllakPpqtrFZGalbQKKUfeuINJ1Er3mqTcpQ1fiiRhOeIm2PFRqHnAWAvgBh6H3kBdLqWUr2aw3xZYWDL0tYeJmsSAWlPHAKGyX8qdQQ/xrdtvgo3ZtZ3lIVR/jAXX3cLUFwOnIKV0FlKJZiqPF+LAnoBKhIvDoLUEvELg6Y9DKU96zIAhroCaOpRglOGSmpgwlkG95xPSdPngIN0zin2h+Og7lLg8wBbNhwznYorYPzVYoOCypZHZoxjGp6X4QItMcHypuvTX0dprM7OdkKjx53WTj5QlWik8R+TjEtwTp8+IIMJMsX8XdNV4pTpUS57TOJ60jMn0odabGLIGWCs73JNT9XpBkvuwlMFJ06qfGViMA/DAjOU1n76jBeufXJCeQuO8xjVFJbQoPlazhYDKoQva5pbC8261K6jbjwWPpYoXlCdLOO2QqpQmbGLHEcgvMm3dZ0fpz4vBNmipNq7BwfR3Rcj/PoF5VHLpxadTaJ6ob6VheCYHD1YSf3TiVZDGsCenQwTVYIYrRtPsN7QVMX0ONBQLOZ4/r8HZi3D1fXuRCscsDTkOy3nraU9L0yUeURalchP7BsvoMO5kT2O5Wyy83Oh7Beap9xdGcJrQ6j7qdNlYjluOZPI6kZUfkdrzs3KVYC5wpERJmjv2XmhhowfFjtgO66JqqJXehV20AvBMPNnHvLshBAR40fKVlpE8kHMlffSCpBexQSFt1ixUkBOsG18iZOsc2tqDDi/oz0su5OgpPKq/2U2lK2Cm1RhHTgvq3faa+4fq2XUU3exLfezkyLWXb/1m7nJxdd/B1i5n9or1AX7AhH2VSWl6wZUyQW5OXloR1r6Q==", "CID": { "/": "bafy2bzacedhxkyr5qwilac37vrdzr6wllxszrjhqrkiwjahoo45y4ihrtboqg" } }, "id": 1 } ``` --- ### `Filecoin.ChainGetParentMessages` > Returns the messages stored in a parent tipset of the specified block. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetParentMessages", "params": [ { "/": "bafy2bzacedfsum47y4l2b6qbkacknqqy2glny3kcpvz4ejzgyktz7jiaxqs52" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "Cid": { "/": "bafy2bzacedfsum47y4l2b6qbkacknqqy2glny3kcpvz4ejzgyktz7jiaxqs52" }, "Message": { "Version": 0, "To": "f0144952", "From": "f3r57nuqjq3clxj7kcvzap4enamxjdqqine3zoa44e57724hnlrzgza7okwq5jkijey7ggrf5z72su2ijmaona", "Nonce": 96476, "Value": "0", "GasLimit": 69299801, "GasFeeCap": "851888851", "GasPremium": "175944425", "Method": 5, "Params": "hQmCggBAggFAgYIJWQGAtAUBh5SvpDsoMrtMI8Ym2rcqLwMsGrJjK9lgxJo81of5mwwXupoBzi0lJkrJQ4dcpojsqU87DpVsdOe+CECSXivSx2dQS2NpkktMX7m009ZbBdr8fWKlmqvDvfm4CCAYBOEMwtewimxECC48sBwe2n2m1DWwNHSw9F7CpjLWazW17nzJnrTQoPYXTZaXHE/hhDBPR53PpDgaCrgqpVvrFyqaS8pumo/AEKHKBgXvVqmV29YwGtDFONHAitsnIA4RuD9elRYxMnevfoms4UwNofb7eeFTfxCnguKwiFXMDh5b3gU7lzsaGJ/I31oiwWizhAICiR2nTICoM5PSpQ6sgfYDa8wqbuyN/f5RqmjdqnYfEM134rmM+B6LYv2lvyVhCXOrNTIS3F4foQMCQvRQu/15duFvaRijHOwnx2ZmF+EAzZPF30LPGZ5HHxn0Ag1IoW6TKtnd+LntvJXIh+KSG7FnodAQcHb3HxLrzgGkabP4Vjj8W405KVApUqWzB8gHGgApM7dYIMdg2Tt314GyEAoENWioh3g+e1eynIjei+J4jIOboAgt", "CID": { "/": "bafy2bzacedfsum47y4l2b6qbkacknqqy2glny3kcpvz4ejzgyktz7jiaxqs52" } } } ] } ``` --- ### `Filecoin.ChainGetParentReceipts` > Returns the receipts for messages in a parent tipset of the specified block. The receipts in the list returned is one-to-one with the messages returned by a call to FilecoinChainGetParentMessages with the same `blockCid`. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetParentReceipts", "params": [ { "/": "bafy2bzaceb5cniilj3iwjldztqqrizyred3qmfzqheav4awhrskkufkgkxegw" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "ExitCode": 0, "Return": null, "GasUsed": 57225646, "EventsRoot": null } ], "id": 1 } ``` --- ### `Filecoin.ChainGetPath` > Returns a set of revert/apply operations needed to get from one tipset to another. For example: ``` to ^ from tAA ^ ^ tBA tAB ^---*--^ ^ tRR ``` Would return `[revert(tBA), apply(tAB), apply(tAA)]` [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetPath", "params": [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "Type": "string value", "Val": { "Cids": null, "Blocks": null, "Height": 0 } } ], "id": 1 } ``` --- ### `Filecoin.ChainGetTipSet` > Returns the tipset specified by the given TipSetKey. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetTipSet", "params": [ [ { "/": "bafy2bzacec7fhpigs5q22hvfbgsilu7pyxrho3ribd74wka53vezjufpd4u3a" }, { "/": "bafy2bzacecdokusaktiqx2xnex2o7n6wgidbtxhnweakkn5oiund7hovvf7w2" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Cids": [ { "/": "bafy2bzacec7fhpigs5q22hvfbgsilu7pyxrho3ribd74wka53vezjufpd4u3a" }, { "/": "bafy2bzacecdokusaktiqx2xnex2o7n6wgidbtxhnweakkn5oiund7hovvf7w2" } ], "Blocks": [ { "Miner": "f01754403", "Ticket": { "VRFProof": "ldBoeUhQP09lH+YUAjC6WAQ4a4yTq0cLQ9wYPOGILhP4iBKnNfQdrqJsIMsg60MJCB8CYFe2Nt8MxKctpJt/wDj1vUuf9m75s3vwgrAWN85EDypnWW/XK/LgO8ddGCgB" }, "ElectionProof": { "WinCount": 1, "VRFProof": "uDr6N8LoH6ArwyR97yAlPvMDutFtGp7ErkYc85o+uVxBdONIOawoeFEL1JvhQ2g3FtWZZsDcVhvGOLzlPAXYs9fvVlJB5hU4XenGv2/Wq8WeaWb6/9jAuE1FJ/3TUsmj" }, "BeaconEntries": [ { "Round": 2798928, "Data": "gOPMgJQ07/JtWfBTyE2uIukZ/m4eJh1tNE1K9IRd3lbHjlotD6HiDQ5+BoKZJvm6DVp2jdAMgEU3PDaoEvIVBlrgRe/5cwuLlC2u+tDU33Prg/qdCGRik3P1J+nFIZh3" } ], "WinPoStProof": [ { "PoStProof": 3, "ProofBytes": "mZDPZ+4BXGbwGT5js2Moh0lvQkVXrzr/Bo93GlWTEzeAVlHNnt4//TYxdNxcHwGBldpg4u/Q2TvTcX9MfNyUbZZ4YI+JHKtYEWQAcBjOaZC0ayOUT+ciSqSAfBBmel82E5HruU1V8aOMaBlQqbLp5wkGmpZB5SFsWi79MY47NovtnkLU51GZnrCEGNfOqLlHl4fMjGVgOesKxZ6X4BfCXF2BSPHn+7Rfx/5OoXVU2fkUQ3Ws01acfHknX7HL1gC+" } ], "Parents": [ { "/": "bafy2bzacec3neqtqc5os4hej5u3v34wdvitd7zroolf2s5fkbnscyqvznddgy" }, { "/": "bafy2bzacec6mhuuoqieiif5cey435hjouesst374myepjmi6wvrurrxkzsjjk" }, { "/": "bafy2bzaceawvnovcw7yymak3i5ww3frouz7sii46rcjsahrkcabztegpxfd3s" } ], "ParentWeight": "63664567644", "Height": 2703083, "ParentStateRoot": { "/": "bafy2bzaced3ozdd6gnok6346jnmfr2oxm6s77hoyecfylk2ru6brjtuvrycng" }, "ParentMessageReceipts": { "/": "bafy2bzaced6hbdv3nqre77ssevjukh5rvmh6fdjrby3j2roaggfxrw2kfrqs6" }, "Messages": { "/": "bafy2bzaceaqkeppyjtn7bfnmnms2qudoyhboqxrfagj5nbwurhezx4rk5bbfw" }, "BLSAggregate": { "Type": 2, "Data": "kz1Tg9escAznXjko9VM7S/8celHuyqOJoW4SNH5GIlZjp2/fgFwjTYl6gzQVmaO/EC9DuMIYMiNnl6IBnDwQtwxQQEyG5cN9Ua9B3SqQc8b+8/9XWtxNGklX1A+1pnQa" }, "Timestamp": 1679398890, "BlockSig": { "Type": 2, "Data": "oTlXYBCX8KNvsrE863LmTlUeGSDzgT/x/wYXY9awK6pQNR03d+schbhLVsi1t1mjF5XeH8+O1uLUGQbqpNMeTuzqKOAwVCXbYP0WE4gcPrmy0j7ErPqzyxn/iHXH8dnO" }, "ForkSignaling": 0, "ParentBaseFee": "261138717" } ], "Height": 2703083 }, "id": 1 } ``` --- ### `Filecoin.ChainGetTipSetByHeight` > Looks back for a tipset at the specified epoch. If there are no blocks at the specified epoch, a tipset at an earlier epoch will be returned. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetTipSetByHeight", "params": [ 2703083, [ { "/": "bafy2bzacec7fhpigs5q22hvfbgsilu7pyxrho3ribd74wka53vezjufpd4u3a" }, { "/": "bafy2bzacecdokusaktiqx2xnex2o7n6wgidbtxhnweakkn5oiund7hovvf7w2" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Cids": [ { "/": "bafy2bzacec7fhpigs5q22hvfbgsilu7pyxrho3ribd74wka53vezjufpd4u3a" }, { "/": "bafy2bzacecdokusaktiqx2xnex2o7n6wgidbtxhnweakkn5oiund7hovvf7w2" } ], "Blocks": [ { "Miner": "f01754403", "Ticket": { "VRFProof": "ldBoeUhQP09lH+YUAjC6WAQ4a4yTq0cLQ9wYPOGILhP4iBKnNfQdrqJsIMsg60MJCB8CYFe2Nt8MxKctpJt/wDj1vUuf9m75s3vwgrAWN85EDypnWW/XK/LgO8ddGCgB" }, "ElectionProof": { "WinCount": 1, "VRFProof": "uDr6N8LoH6ArwyR97yAlPvMDutFtGp7ErkYc85o+uVxBdONIOawoeFEL1JvhQ2g3FtWZZsDcVhvGOLzlPAXYs9fvVlJB5hU4XenGv2/Wq8WeaWb6/9jAuE1FJ/3TUsmj" }, "BeaconEntries": [ { "Round": 2798928, "Data": "gOPMgJQ07/JtWfBTyE2uIukZ/m4eJh1tNE1K9IRd3lbHjlotD6HiDQ5+BoKZJvm6DVp2jdAMgEU3PDaoEvIVBlrgRe/5cwuLlC2u+tDU33Prg/qdCGRik3P1J+nFIZh3" } ], "WinPoStProof": [ { "PoStProof": 3, "ProofBytes": "mZDPZ+4BXGbwGT5js2Moh0lvQkVXrzr/Bo93GlWTEzeAVlHNnt4//TYxdNxcHwGBldpg4u/Q2TvTcX9MfNyUbZZ4YI+JHKtYEWQAcBjOaZC0ayOUT+ciSqSAfBBmel82E5HruU1V8aOMaBlQqbLp5wkGmpZB5SFsWi79MY47NovtnkLU51GZnrCEGNfOqLlHl4fMjGVgOesKxZ6X4BfCXF2BSPHn+7Rfx/5OoXVU2fkUQ3Ws01acfHknX7HL1gC+" } ], "Parents": [ { "/": "bafy2bzacec3neqtqc5os4hej5u3v34wdvitd7zroolf2s5fkbnscyqvznddgy" }, { "/": "bafy2bzacec6mhuuoqieiif5cey435hjouesst374myepjmi6wvrurrxkzsjjk" }, { "/": "bafy2bzaceawvnovcw7yymak3i5ww3frouz7sii46rcjsahrkcabztegpxfd3s" } ], "ParentWeight": "63664567644", "Height": 2703083, "ParentStateRoot": { "/": "bafy2bzaced3ozdd6gnok6346jnmfr2oxm6s77hoyecfylk2ru6brjtuvrycng" }, "ParentMessageReceipts": { "/": "bafy2bzaced6hbdv3nqre77ssevjukh5rvmh6fdjrby3j2roaggfxrw2kfrqs6" }, "Messages": { "/": "bafy2bzaceaqkeppyjtn7bfnmnms2qudoyhboqxrfagj5nbwurhezx4rk5bbfw" }, "BLSAggregate": { "Type": 2, "Data": "kz1Tg9escAznXjko9VM7S/8celHuyqOJoW4SNH5GIlZjp2/fgFwjTYl6gzQVmaO/EC9DuMIYMiNnl6IBnDwQtwxQQEyG5cN9Ua9B3SqQc8b+8/9XWtxNGklX1A+1pnQa" }, "Timestamp": 1679398890, "BlockSig": { "Type": 2, "Data": "oTlXYBCX8KNvsrE863LmTlUeGSDzgT/x/wYXY9awK6pQNR03d+schbhLVsi1t1mjF5XeH8+O1uLUGQbqpNMeTuzqKOAwVCXbYP0WE4gcPrmy0j7ErPqzyxn/iHXH8dnO" }, "ForkSignaling": 0, "ParentBaseFee": "261138717" } ], "Height": 2703083 }, "id": 1 } ``` --- ### `Filecoin.ChainHasObj` > Checks if a given CID exists in the chain blockstore. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainHasObj", "params": [ { "/": "bafy2bzaceblynopdwvbewq7fbod6bh366uaevdmcaqivygmjyowgptg54jti2" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": true, "id": 1 } ``` --- ### `Filecoin.ChainHead` > Returns the current head of the chain. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainHead", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Cids": [ { "/": "bafy2bzacedv3b5pwefqexzvpwiry7w6wakrbyssdhsgp5c33rm5dgyj5khgbg" }, { "/": "bafy2bzacedd7y77bk44nm7rok2nwvne3trnolpzasy3y3z6od6axyg7uiert4" }, { "/": "bafy2bzacearxvzcu2ypwauyyy4oqsfwetx3qojtvaorjmxgb2im4k5tddxqiu" }, { "/": "bafy2bzacedgcwhuvkzk7iagl2mkxyp6qblk3gprtlqamkq67knb7ykrhqymgg" }, { "/": "bafy2bzaceajcpcyjksojvh4ai7wzwnizeshpey27cmodjkee2q4nhyhrid6b4" }, { "/": "bafy2bzaceb4wyiih3szexdsljmsfddbm4smse7nshxxu2eky4q3w67hqxtvmm" } ], "Blocks": [ { "Miner": "f01895783", "Ticket": { "VRFProof": "kcWn6V1EhLUKaRMLqYN42SewNWguCDc5F+ZIk9exfBJkaaocOb9uGIbB2KNCxywAGd8wHpYjkgfZWw1nbule0fd5pJwSMp4LQwQm2FWp9QpHK3XvkjcY/KC/mSfP/lHi" }, "ElectionProof": { "WinCount": 1, "VRFProof": "haD99IerMQWOYh3JGordctFVBnM3sk3LmpezrIJJt+pSwTe+eRer32fOebTRA64QCwHD6lAB38PfQm1djelrKb5I6bzmKma50LPLjdclWiLbmKUXQ7A9msu/T1Yoghjw" }, "BeaconEntries": [ { "Round": 2798977, "Data": "rVZpSi/6bB86qEK+xZ5KoQ9TxQs0S8GO/aTBTLIIiNooHHZcY7X45tMJnLYK8dN+ET7mYX6Wry0c3CIW6a2RI03iBlckwmiJlzM9LhI2HnWo5B7fol0ocXXJ0MkRkl9d" } ], "WinPoStProof": [ { "PoStProof": 3, "ProofBytes": "g6gO0PjQB8JIcqu2ICQownNoPdryQq3kkshOzTPF1oW1XkXXI9kwejExKYK4xwrotxZHLVeFEF/qnCCnxiNZgUJm/PSYoQwFQu20e0YC5/qCPwCfTr8A2PQZc966la3QFXgq05XIdMNh0F782QkTJyscsl9doWhntQEcqY5kHpcxdtKQucVqGJcOc0/SuAtmpCHH5St2qXOyxSmm287GxUtvpVI9MwO/yQa9dDkapSFFUHuncxhAQf+sAvy2ksNe" } ], "Parents": [ { "/": "bafy2bzaced5o6oawg5o6rx3obkj6cuzkyjahz2lpk6qvy5xvq2rjyvygi65bq" }, { "/": "bafy2bzacecaxvtk5ckni7awdbynfbifj24oi3eymjc3b44ux3asnpxvpm7rea" }, { "/": "bafy2bzacea64cscz2rjm7tr3c55bojpq5nwqq55sxon7hrxkbtzag3ekbgojs" }, { "/": "bafy2bzacebw22qt7nay7c4yyp3msay2fgw5anoio4gv3pu4g2mketipy72rcs" }, { "/": "bafy2bzacecl4fvgm3tn6opwmdibedcpkw2wk43ufqxsqijuolwvpx5obsoti6" } ], "ParentWeight": "63665812806", "Height": 2703132, "ParentStateRoot": { "/": "bafy2bzacec5d2mxtnfswv7fq3fx7beg2s2xdcwjj3szgpjhnj3pu3ople7vrm" }, "ParentMessageReceipts": { "/": "bafy2bzacebponxrcdicmhh2mlzrihmq7iinq73liojcykakrto27gkaexxrdi" }, "Messages": { "/": "bafy2bzacebqx7ajoaiuqrw56xd56fkasmicptv5v7wpfe4o7rl77wtvywwfuk" }, "BLSAggregate": { "Type": 2, "Data": "sseDTsMGghVci2Wf1ZHQqAl1igaEhcaUm6Uebl/NsQ7frZkaS3cG8gfEb5xUZnIwDvNTRzfR8RibNq2wQ7dTgn9PgZEskBLdisdNsGyOakbu3g+en4c1Uuqe7WjtwJeo" }, "Timestamp": 1679400360, "BlockSig": { "Type": 2, "Data": "rfECxuyJJHwTO4GAr2yY01PLk0AiL8IV+N+U8XLbgmANEXcUYebHSIxtwyqTV6jNAZbJf6wqILMx+VV8OMqxaRs6PBEYt2uT5aQ8QVnsrl6UonDhORfn6Y+w/lS7SAdy" }, "ForkSignaling": 0, "ParentBaseFee": "279330655" } ], "Height": 2703132 }, "id": 1 } ``` --- ### `Filecoin.ChainReadObj` > Reads ipld nodes referenced by the specified CID from chain blockstore and returns raw bytes. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainReadObj", "params": [ { "/": "bafy2bzacecdcexybh5urgevm3vsqypphvtaphfkbrp5ypailznwsesxex4inc" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "kEQA269rgVhgkeRpEukXUprHdFngflEOVICJPzoKvN9ylKtAF87LGaMrA2NUROxHjhViBCBRw6UGF1kArbMcXNAx5TJ7cl5POUfdm99scOY/fxy4fwnWXkCaqID24zSh42191IPkxy2fggFYYI/x67542bcmsoRTdjL/XQEx2st/pgzD8JWLsniDau7JYu1X3zZ9ndBtluodw7jKtRCqxsHBYV/PtRuyEESvY5qd1wBJYRJBso7pwstQh/QGQ7YXSkLx4RpklGhTBTuAfYGCGgAqtXlYYLBj5/MRmpNwrEjO6wX4JnCLenOJ9fM/7Y3LkT3JH3O65f+AKHWmLQKnPE2P+wTcChipDoZ1IX33QWEZUVsRVd4dQceHTJi8JzE79KEhtwmHAlm6DZa23NynGHFspBPIGIGCA1jAmAMkXyq47em8jpqzQ2F+3XCvH8nGljQjIl6IKs45ma/Gx5H4LzXrJYsQH84EyQ2howEQ4OA7JYx4nlm0XqMgGYLEib/gh8PgspMJ/xtOMxamV7PGhoLxYzDqzXsEidHvDdX3vHAa9/V3e+gC+eJoYuJK1cJNf4NaGYBOC8He7F1EKPFOPztSbmU2f/KKEejOkKV3dpu5TNQJiY5ZpREgorJBe/s6t4rEuPTNsdjN+3w0dt/jigDHYrdOgBwpTca4idgqWCcAAXGg5AIgdh+kSsOAv/b6v2EDrgze60ckuI1Jg1cMgAR8opaTu5TYKlgnAAFxoOQCIFeGueO1QktD5QuH4J9+9QBKjYIEEVwZicOsZ8zd4maN2CpYJwABcaDkAiBiWxgVs8cHQ71BJFt2vB+zvvhC6dp2yCXhZ61nFkUzP9gqWCcAAXGg5AIgJNmip0/8BY0OEfcvO6q5+eK6r3joTsQFnVEdSBm+B43YKlgnAAFxoOQCIHmVb5Tv73UW74QRwYd5ceaz+IBCDrsyaGn1yxlAV9G12CpYJwABcaDkAiCSR23BHqr7K91w5T98zqNqRkv8E+mToztQiCOyHkJwStgqWCcAAXGg5AIgz3zVjzDaJt5Xgbr9bMMgXPEbyv3GyD8iQhqIOl9DwoXYKlgnAAFxoOQCICWF9cTUreiW5yT884pyehwHsjRqskmp57PfNQO+d1ZP2CpYJwABcaDkAiAbY+i6KT89/8UjW9pXxAxVV5UNJTN0sHxsoTOLxRPCvUYADtLEG7AaACk/FNgqWCcAAXGg5AIgZ8DuWPK1t7ssKJweNNqxAdcMGqWM7EMnoG7QazPhQgTYKlgnAAFxoOQCIKiyng3LPYVIEL8IIaqui4dVwM+7xo+0sBmbbi8GOUkx2CpYJwABcaDkAiBf6+uFCb6YH92/pHwEDfTrpTYoljkqvFh06spSBAd9kVhhArKn1tzPM7kt93dhHbfrudJ8FDTZb1IRGQ2F6lApEdH2YTtgyAMj2oiqgFyyPola1xl5vKeGf7LdbMI1QeUiPb0MiC9cwrl8kYYMrM4ceTATvue+fF5YbDleLBBOYOk7uBpkGZy4WGECsx+OTbv3WplM4gzAxGIBw6GpvO5t7oVxhAt13ZyiOj0Zot5q5MhM0wQa91x+9hkvBgFm2cNGGBMVM4AjuQ3o7a9R1AKwTHBUpz7MC3MqVpSBkeFRau8mF82tVkQlPmTdAEUAEEaVYQ==", "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/filecoin/ title: Filecoin description: Filecoin is a peer-to-peer network that stores files, with built-in economic incentives and cryptography to… 21 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/filecoin/index.mdx --- # Filecoin
> Filecoin API is available on [Web3 API platform](https://www.ankr.com/rpc/filecoin). *Filecoin* is a peer-to-peer network that stores files, with built-in economic incentives and cryptography to ensure files are stored reliably over time. Filecoin is built on top of the same software powering [IPFS](https://docs.ipfs.tech/concepts/what-is-ipfs/) protocol, which is a peer-to-peer distributed storage network that leverages [content addressing](https://docs.ipfs.tech/concepts/content-addressing/) to allow permanent references to the data, and avoids relying on specific devices or cloud servers for addressing the content. Filecoin is different from IPFS because it has an incentive layer on top to incentivize contents to be reliably stored and accessed. In order for your Web3 application to interact with Filecoin — either by reading blockchain data or sending transactions to the network — it must connect to a Filecoin node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. Filecoin API supports interaction via the following methods: * [Filecoin EVM methods](/rpc-service/chains/chains-api/filecoin/#filecoin-evm-methods) * [Filecoin native methods](/rpc-service/chains/chains-api/filecoin/#filecoin-native-methods) --- ## Filecoin EVM methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/filecoin/methods/#web3_clientversion) — returns the current client version. * [`net_version`](/rpc-service/chains/chains-api/filecoin/methods/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/filecoin/methods/#net_listening) — returns true if client is actively listening for network connections. * [`eth_protocolVersion`](/rpc-service/chains/chains-api/filecoin/methods/#eth_protocolversion) — returns the current protocol version. * [`eth_gasPrice`](/rpc-service/chains/chains-api/filecoin/methods/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/filecoin/methods/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/filecoin/methods/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/filecoin/methods/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getCode`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/filecoin/methods/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/filecoin/methods/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/filecoin/methods/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/filecoin/methods-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/filecoin/methods-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/filecoin/methods-p2/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getLogs`](/rpc-service/chains/chains-api/filecoin/methods-p2/#eth_getlogs) — returns logs matching the parameters specified. --- ## Filecoin native methods **Chain**: * [`Filecoin.ChainGetBlock`](/rpc-service/chains/chains-api/filecoin/methods-p3/#filecoinchaingetblock) — returns the block specified by the given CID. * [`Filecoin.ChainGetBlockMessages`](/rpc-service/chains/chains-api/filecoin/methods-p3/#filecoinchaingetblockmessages) — returns messages stored in the specified block. * [`Filecoin.ChainGetGenesis`](/rpc-service/chains/chains-api/filecoin/methods-p3/#filecoinchaingetgenesis) — returns the genesis tipset. * [`Filecoin.ChainGetMessage`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingetmessage) — reads a message referenced by the specified CID from the chain blockstore. * [`Filecoin.ChainGetParentMessages`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingetparentmessages) — returns messages stored in parent tipset of the specified block. * [`Filecoin.ChainGetParentReceipts`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingetparentreceipts) — returns receipts for messages in parent tipset of the specified block. * [`Filecoin.ChainGetPath`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingetpath) — returns a set of revert/apply operations needed to get from one tipset to another. * [`Filecoin.ChainGetTipSet`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingettipset) — returns the tipset specified by the given TipSetKey. * [`Filecoin.ChainGetTipSetByHeight`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingettipsetbyheight) — looks back for a tipset at the specified epoch. * [`Filecoin.ChainHasObj`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchainhasobj) — checks if a given CID exists in the chain blockstore. * [`Filecoin.ChainHead`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchainhead) — returns the current head of the chain. * [`Filecoin.ChainReadObj`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchainreadobj) — reads ipld nodes referenced by the specified CID from chain blockstore and returns raw bytes. * [`Filecoin.ChainStatObj`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinchainstatobj) — returns statistics about the graph referenced by ‘obj’. * [`Filecoin.ChainTipSetWeight`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinchaintipsetweight) — computes weight for the specified tipset. **Client**: * [`Filecoin.ClientQueryAsk`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinclientqueryask) — returns a signed StorageAsk from the specified miner. **Gas**: * [`Filecoin.GasEstimateFeeCap`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoingasestimatefeecap) — estimates gas fee cap. * [`Filecoin.GasEstimateGasLimit`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoingasestimategaslimit) — estimates gas used by the message and returns it. * [`Filecoin.GasEstimateGasPremium`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoingasestimategaspremium) — estimates what gas price should be used for a message to have high likelihood of inclusion in `nblocksincl` epochs. * [`Filecoin.GasEstimateMessageGas`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoingasestimatemessagegas) — estimates gas values for unset message gas fields. **Mpool**: * [`Filecoin.MpoolGetNonce`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinmpoolgetnonce) — gets next nonce for the specified sender. * [`Filecoin.MpoolPending`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinmpoolpending) — returns pending mempool messages. * [`Filecoin.MpoolPush`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinmpoolpush) — pushes a signed message to mempool. * [`Filecoin.MpoolSub`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinmpoolsub) **State**: * [`Filecoin.StateAccountKey`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinstateaccountkey) — returns the public key address of the given ID address. * [`Filecoin.StateAllMinerFaults`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinstateallminerfaults) — returns all non-expired Faults that occur within lookback epochs of the given tipset. * [`Filecoin.StateCall`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinstatecall) — runs the given message and returns its result without any persisted changes. * [`Filecoin.StateChangedActors`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinstatechangedactors) — returns all the actors whose states change between the two given state CIDs. * [`Filecoin.StateCirculatingSupply`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinstatecirculatingsupply) — returns the exact circulating supply of Filecoin at the given tipset. * [`Filecoin.StateCompute`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatecompute) — applies the given messages on the given tipset. * [`Filecoin.StateDealProviderCollateralBounds`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatedealprovidercollateralbounds) — returns the min and max collateral a storage provider can issue. * [`Filecoin.StateDecodeParams`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatedecodeparams) — attempts to decode the provided params, based on the recipient actor address and method number. * [`Filecoin.StateGetActor`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstategetactor) — returns the indicated actor’s nonce and balance. * [`Filecoin.StateGetReceipt`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstategetreceipt) — returns the message receipt for the given message or for a matching gas-repriced replacing message. * [`Filecoin.StateListActors`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatelistactors) — returns the addresses of every actor in the state. * [`Filecoin.StateListMessages`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatelistmessages) — looks back and returns all messages with a matching to or from address, stopping at the given height. * [`Filecoin.StateListMiners`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatelistminers) — returns the addresses of every miner that has claimed power in the Power Actor. * [`Filecoin.StateLookupID`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatelookupid) — retrieves the ID address of the given address. * [`Filecoin.StateMarketBalance`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatemarketbalance) — looks up the Escrow and Locked balances of the given address in the Storage Market. * [`Filecoin.StateMarketDeals`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatemarketdeals) — returns information about every deal in the Storage Market. * [`Filecoin.StateMarketParticipants`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatemarketparticipants) — returns the Escrow and Locked balances of every participant in the Storage Market. * [`Filecoin.StateMarketStorageDeal`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatemarketstoragedeal) — returns information about the indicated deal. * [`Filecoin.StateMinerActiveSectors`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatemineractivesectors) — returns info about sectors that a given miner is actively proving. * [`Filecoin.StateMinerAvailableBalance`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatemineravailablebalance) — returns the portion of a miner’s balance that can be withdrawn or spent. * [`Filecoin.StateMinerDeadlines`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerdeadlines) — returns all the proving deadlines for the given miner. * [`Filecoin.StateMinerFaults`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerfaults) — returns a bitfield indicating the faulty sectors of the given miner. * [`Filecoin.StateMinerInfo`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerinfo) — returns info about the indicated miner. * [`Filecoin.StateMinerInitialPledgeCollateral`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerinitialpledgecollateral) — returns the initial pledge collateral for the specified miner’s sector. * [`Filecoin.StateMinerPartitions`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerpartitions) — returns all partitions in the specified deadline. * [`Filecoin.StateMinerPower`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerpower) — returns the power of the indicated miner. * [`Filecoin.StateMinerPreCommitDepositForPower`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerprecommitdepositforpower) — returns the pre-commit deposit for the specified miner’s sector. * [`Filecoin.StateMinerProvingDeadline`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerprovingdeadline) — calculates the deadline at some epoch for a proving period and returns the deadline-related calculations. * [`Filecoin.StateMinerRecoveries`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerrecoveries) — returns a bitfield indicating the recovering sectors of the given miner. * [`Filecoin.StateMinerSectorAllocated`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminersectorallocated) — checks if a sector is allocated. * [`Filecoin.StateMinerSectorCount`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminersectorcount) — returns the number of sectors in a miner’s sector set and proving set. * [`Filecoin.StateMinerSectors`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminersectors) — returns info about the given miner’s sectors. * [`Filecoin.StateNetworkName`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatenetworkname) — returns the name of the network the node is synced to. * [`Filecoin.StateNetworkVersion`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatenetworkversion) — returns the network version at the given tipset. * [`Filecoin.StateReadState`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatereadstate) — returns the indicated actor’s state. * [`Filecoin.StateReplay`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatereplay) — replays a given message, assuming it was included in a block in the specified tipset. * [`Filecoin.StateSearchMsg`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesearchmsg) — searches for a message in the chain, and returns its receipt and the tipset where it was executed. * [`Filecoin.StateSearchMsgLimited`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesearchmsglimited) — looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed. * [`Filecoin.StateSectorExpiration`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesectorexpiration) — returns epoch at which given sector will expire * [`Filecoin.StateSectorGetInfo`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesectorgetinfo) — returns the on-chain info for the specified miner’s sector. * [`Filecoin.StateSectorPartition`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesectorpartition) — finds deadline/partition with the specified sector. * [`Filecoin.StateSectorPreCommitInfo`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesectorprecommitinfo) — returns the PreCommit info for the specified miner’s sector. * [`Filecoin.StateVMCirculatingSupplyInternal`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatevmcirculatingsupplyinternal) — returns an approximation of the circulating supply of Filecoin at the given tipset. * [`Filecoin.StateVerifiedClientStatus`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstateverifiedclientstatus) — returns the data cap for the given address. * [`Filecoin.StateVerifiedRegistryRootKey`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstateverifiedregistryrootkey) — returns the address of the Verified Registry’s root key. * [`Filecoin.StateVerifierStatus`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstateverifierstatus) — returns the data cap for the given address. * [`Filecoin.StateWaitMsg`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatewaitmsg) — looks back in the chain for a message. * [`Filecoin.StateWaitMsgLimited`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatewaitmsglimited) — looks back up to limit epochs in the chain for a message. **Wallet**: * [`Filecoin.WalletBalance`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinwalletbalance) — returns the balance of the given address at the current head of the chain. * [`Filecoin.WalletValidateAddress`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinwalletvalidateaddress) — validates whether a given string can be decoded as a well-formed address. * [`Filecoin.WalletVerify`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinwalletverify) — takes an address, a signature, and some bytes, and indicates whether the signature is valid. ## Permissions Each method has specific permissions that must be met before you can receive a response from a Filecoin node. Methods with the read permission can be called by anyone at anytime, without the need for a token. All other permissions require you to send an authentication along with you request. * `read`: Read node state, no private data. * `write`: Write to local store / chain, and read permissions. * `sign`: Use private keys stored in wallet for signing, read and write permissions. * `admin`: Manage permissions, read, write, and sign permissions. --- ## Methods ### Methods, Chain - [`web3_clientVersion`](/rpc-service/chains/chains-api/filecoin/methods/#web3_clientversion) - [`net_version`](/rpc-service/chains/chains-api/filecoin/methods/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/filecoin/methods/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/filecoin/methods/#eth_protocolversion) - [`eth_gasPrice`](/rpc-service/chains/chains-api/filecoin/methods/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/filecoin/methods/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/filecoin/methods/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/filecoin/methods/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getblocktransactioncountbynumber) - [`eth_getCode`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/filecoin/methods/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/filecoin/methods/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/filecoin/methods/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/filecoin/methods/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/filecoin/methods-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/filecoin/methods-p2/#eth_gettransactionbyhash) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/filecoin/methods-p2/#eth_gettransactionreceipt) - [`eth_getLogs`](/rpc-service/chains/chains-api/filecoin/methods-p2/#eth_getlogs) - [`Filecoin.ChainGetBlock`](/rpc-service/chains/chains-api/filecoin/methods-p3/#filecoinchaingetblock) - [`Filecoin.ChainGetBlockMessages`](/rpc-service/chains/chains-api/filecoin/methods-p3/#filecoinchaingetblockmessages) - [`Filecoin.ChainGetGenesis`](/rpc-service/chains/chains-api/filecoin/methods-p3/#filecoinchaingetgenesis) ### Chain, Client, Gas, Mpool, State - [`Filecoin.ChainGetMessage`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingetmessage) - [`Filecoin.ChainGetParentMessages`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingetparentmessages) - [`Filecoin.ChainGetParentReceipts`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingetparentreceipts) - [`Filecoin.ChainGetPath`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingetpath) - [`Filecoin.ChainGetTipSet`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingettipset) - [`Filecoin.ChainGetTipSetByHeight`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingettipsetbyheight) - [`Filecoin.ChainHasObj`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchainhasobj) - [`Filecoin.ChainHead`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchainhead) - [`Filecoin.ChainReadObj`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchainreadobj) - [`Filecoin.ChainStatObj`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinchainstatobj) - [`Filecoin.ChainTipSetWeight`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinchaintipsetweight) - [`Filecoin.ClientQueryAsk`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinclientqueryask) - [`Filecoin.GasEstimateFeeCap`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoingasestimatefeecap) - [`Filecoin.GasEstimateGasLimit`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoingasestimategaslimit) - [`Filecoin.GasEstimateGasPremium`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoingasestimategaspremium) - [`Filecoin.GasEstimateMessageGas`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoingasestimatemessagegas) - [`Filecoin.MpoolGetNonce`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinmpoolgetnonce) - [`Filecoin.MpoolPending`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinmpoolpending) - [`Filecoin.MpoolPush`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinmpoolpush) - [`Filecoin.MpoolSub`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinmpoolsub) - [`Filecoin.StateAccountKey`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinstateaccountkey) - [`Filecoin.StateAllMinerFaults`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinstateallminerfaults) - [`Filecoin.StateCall`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinstatecall) - [`Filecoin.StateChangedActors`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinstatechangedactors) - [`Filecoin.StateCirculatingSupply`](/rpc-service/chains/chains-api/filecoin/chain-p2/#filecoinstatecirculatingsupply) ### State, Wallet - [`Filecoin.StateCompute`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatecompute) - [`Filecoin.StateDealProviderCollateralBounds`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatedealprovidercollateralbounds) - [`Filecoin.StateDecodeParams`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatedecodeparams) - [`Filecoin.StateGetActor`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstategetactor) - [`Filecoin.StateGetReceipt`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstategetreceipt) - [`Filecoin.StateListActors`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatelistactors) - [`Filecoin.StateListMessages`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatelistmessages) - [`Filecoin.StateListMiners`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatelistminers) - [`Filecoin.StateLookupID`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatelookupid) - [`Filecoin.StateMarketBalance`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatemarketbalance) - [`Filecoin.StateMarketDeals`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatemarketdeals) - [`Filecoin.StateMarketParticipants`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatemarketparticipants) - [`Filecoin.StateMarketStorageDeal`](/rpc-service/chains/chains-api/filecoin/state/#filecoinstatemarketstoragedeal) - [`Filecoin.StateMinerActiveSectors`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatemineractivesectors) - [`Filecoin.StateMinerAvailableBalance`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatemineravailablebalance) - [`Filecoin.StateMinerDeadlines`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerdeadlines) - [`Filecoin.StateMinerFaults`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerfaults) - [`Filecoin.StateMinerInfo`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerinfo) - [`Filecoin.StateMinerInitialPledgeCollateral`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerinitialpledgecollateral) - [`Filecoin.StateMinerPartitions`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerpartitions) - [`Filecoin.StateMinerPower`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerpower) - [`Filecoin.StateMinerPreCommitDepositForPower`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerprecommitdepositforpower) - [`Filecoin.StateMinerProvingDeadline`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerprovingdeadline) - [`Filecoin.StateMinerRecoveries`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminerrecoveries) - [`Filecoin.StateMinerSectorAllocated`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminersectorallocated) - [`Filecoin.StateMinerSectorCount`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminersectorcount) - [`Filecoin.StateMinerSectors`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstateminersectors) - [`Filecoin.StateNetworkName`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatenetworkname) - [`Filecoin.StateNetworkVersion`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatenetworkversion) - [`Filecoin.StateReadState`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatereadstate) - [`Filecoin.StateReplay`](/rpc-service/chains/chains-api/filecoin/state-p2/#filecoinstatereplay) - [`Filecoin.StateSearchMsg`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesearchmsg) - [`Filecoin.StateSearchMsgLimited`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesearchmsglimited) - [`Filecoin.StateSectorExpiration`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesectorexpiration) - [`Filecoin.StateSectorGetInfo`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesectorgetinfo) - [`Filecoin.StateSectorPartition`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesectorpartition) - [`Filecoin.StateSectorPreCommitInfo`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatesectorprecommitinfo) - [`Filecoin.StateVMCirculatingSupplyInternal`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatevmcirculatingsupplyinternal) - [`Filecoin.StateVerifiedClientStatus`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstateverifiedclientstatus) - [`Filecoin.StateVerifiedRegistryRootKey`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstateverifiedregistryrootkey) - [`Filecoin.StateVerifierStatus`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstateverifierstatus) - [`Filecoin.StateWaitMsg`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatewaitmsg) - [`Filecoin.StateWaitMsgLimited`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinstatewaitmsglimited) - [`Filecoin.WalletBalance`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinwalletbalance) - [`Filecoin.WalletValidateAddress`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinwalletvalidateaddress) - [`Filecoin.WalletVerify`](/rpc-service/chains/chains-api/filecoin/state-p3/#filecoinwalletverify) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/filecoin/methods-p2/ title: Filecoin — Methods, Chain (2/3) source: docs/rpc-service/chains/chains-api/filecoin/methods-p2.mdx --- # Filecoin — Methods, Chain (2/3) > API reference for [Filecoin](/rpc-service/chains/chains-api/filecoin/). [All methods ->](/rpc-service/chains/chains-api/filecoin/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/filecoin/methods/) · 2 · [3](/rpc-service/chains/chains-api/filecoin/methods-p3/) ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x2908F9", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "hash": "0xa6d88d748662760651aeda021375dea2fc8da8276e0b9eb661e85bb15b6253b6", "parentHash": "0x57074e1d45989f2063985f7f517c59cbd6ba714e144d2a2f946c0ef25567028d", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x0000000000000000000000000000000000000000", "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "logsBloom": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "difficulty": "0x0", "totalDifficulty": "0x0", "number": "0x2908f9", "gasLimit": "0x2540be400", "gasUsed": "0x3192b0549", "timestamp": "0x6413458e", "extraData": "0x", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "baseFeePerGas": "0x1d158e1b", "size": "0x0", "transactions": [ "0x8845248f560f7d02ba15a582e8da76c4dc5965d520dd2178306e502bf7f7e394", "0x080689e635a1248e36abf7c3e3dbc4190fa5a630739cfa957e216acb42210e8f", "0x1a89e7518275b7391fb45fd1dda061686f1d056857913349deba11d9b179fc23", "0xa1165df42cbe49926f871c40847fb10e7de71970023cd83ecc7308fd80e1afe4", "0x8873ece640d6007b731ef87e0bf2b4f26bcf3d52fc8a4459dda403666b0b061d", "0x35722a849b14c72aa501ae5fbe0899dbfcde63e3df8e8398770c3b588f6c0c8a", "0x956202e10917af43f32a3a0db44357636107eb0f2ac88d26fd04064858825c8c", "0xa4852ebc83b6e4f5f5db2c2411a56057149286da4ac0a8f2b45dbfa32f60e963", "0x26fb436430e539d411e34e92051e239a9b76f3f172f04e6b20ec7a2bfd4b6e7b", "0x4af52d5d7f3eb5dfbed0029916865e739a848e2962b99be46f170a9a725c9cb6", "0x15602585d7b4a18383f26774c4a270c3dc2e86496e7dcfd04a92dcd45f2d73a0" ], "uncles": [] }, "id": 1 } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x32388f6f06d525b77c881f6a7f5a139d859e8438f6d25d6460f0a10ce2fccc9a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "chainId": "0x13a", "nonce": "0x26", "hash": "0x32388f6f06d525b77c881f6a7f5a139d859e8438f6d25d6460f0a10ce2fccc9a", "blockHash": "0xa5a4ed12caffde7ff39b505d229759a193da11f4a5a087929df1973f3671b895", "blockNumber": "0x29111a", "transactionIndex": "0x31", "from": "0xcc84a1423537d7ac00b22d4a3ebc0fec5ff42205", "to": "0x7b90337f65faa2b2b8ed583ba1ba6eb0c9d7ea44", "value": "0x0", "type": "0x2", "input": "0xee1fe2ad000000000000000000000000cc84a1423537d7ac00b22d4a3ebc0fec5ff422050000000000000000000000009dfa970c5c985edec5795eb63921406e46c213cd", "gas": "0xbebc200", "maxFeePerGas": "0x63dafb8c", "maxPriorityFeePerGas": "0x1388", "accessList": [], "v": "0x0", "r": "0xe5e69359c36fb38aeff1bb8df275bc933ece12c7936ca90344cfa6c4f783811b", "s": "0x73e059244a4109dd40ce90187a402be33e61eb1726975a9b8a6102bdff1d6cb" }, "id": 1 } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x32388f6f06d525b77c881f6a7f5a139d859e8438f6d25d6460f0a10ce2fccc9a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "transactionHash": "0x32388f6f06d525b77c881f6a7f5a139d859e8438f6d25d6460f0a10ce2fccc9a", "transactionIndex": "0x31", "blockHash": "0xa5a4ed12caffde7ff39b505d229759a193da11f4a5a087929df1973f3671b895", "blockNumber": "0x29111a", "from": "0xcc84a1423537d7ac00b22d4a3ebc0fec5ff42205", "to": "0x7b90337f65faa2b2b8ed583ba1ba6eb0c9d7ea44", "root": "0x0000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "contractAddress": null, "cumulativeGasUsed": "0x0", "gasUsed": "0x72a953b", "effectiveGasPrice": "0x36d6a389", "logsBloom": "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "logs": [ { "address": "0x7b90337f65faa2b2b8ed583ba1ba6eb0c9d7ea44", "data": "0x0000000000000000000000000000000000000000000054b40b1f852bda000000", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000cc84a1423537d7ac00b22d4a3ebc0fec5ff42205" ], "removed": false, "logIndex": "0x0", "transactionIndex": "0x31", "transactionHash": "0x32388f6f06d525b77c881f6a7f5a139d859e8438f6d25d6460f0a10ce2fccc9a", "blockHash": "0xa5a4ed12caffde7ff39b505d229759a193da11f4a5a087929df1973f3671b895", "blockNumber": "0x29111a" }, { "address": "0x7b90337f65faa2b2b8ed583ba1ba6eb0c9d7ea44", "data": "0x000000000000000000000000000000000000000000016410589935ea3de00000", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000009dfa970c5c985edec5795eb63921406e46c213cd" ], "removed": false, "logIndex": "0x1", "transactionIndex": "0x31", "transactionHash": "0x32388f6f06d525b77c881f6a7f5a139d859e8438f6d25d6460f0a10ce2fccc9a", "blockHash": "0xa5a4ed12caffde7ff39b505d229759a193da11f4a5a087929df1973f3671b895", "blockNumber": "0x29111a" } ], "type": "0x2" }, "id": 1 } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x7b90337f65faa2b2b8ed583ba1ba6eb0c9d7ea44"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/filecoin/methods-p3/ title: Filecoin — Methods, Chain (3/3) source: docs/rpc-service/chains/chains-api/filecoin/methods-p3.mdx --- # Filecoin — Methods, Chain (3/3) > API reference for [Filecoin](/rpc-service/chains/chains-api/filecoin/). [All methods ->](/rpc-service/chains/chains-api/filecoin/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/filecoin/methods/) · [2](/rpc-service/chains/chains-api/filecoin/methods-p2/) · 3 ## Chain The Chain method group contains methods for interacting with the blockchain, but that do not require any form of state computation. ### `Filecoin.ChainGetBlock` > Returns the block specified by the given CID. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetBlock", "params": [ { "/": "bafy2bzacecbzs3i5qubhgozauss4nvifgty5zvyvf6cy6frnnznojdmfl6phe" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Miner": "f0427989", "Ticket": { "VRFProof": "pbmP9mctFpH6BoFFh22uvzv8Ixx0rJq9YanJLFTRsgIWDibuomloU2UTWiN8007KBYAnB5Xj1jw7o81VJzKrUByqHUpZHWZM34CgVkuzcHPoSJpM8XGxs2GQkfNAncK2" }, "ElectionProof": { "WinCount": 1, "VRFProof": "oLSLThMoFfGX4E8cDIEULGmUteJY/10nCfun3hiRE1PDIpkPOnoBACmto7/SCz1yFixgQaysEcKK6RCx1ImUW2Q9dlrj3MCbjRQtNiumTXviDqAWgoxYU55QSBDpLbel" }, "BeaconEntries": [ { "Round": 2787998, "Data": "h+zHzc0DvUFIWFpFzqREiA2f3Uk4sn5NExnJJUtfju3Hlc0/dkNXq31+su9kh/q1CK69TRUy9562jx/eV4XXw1lA4QhDxBBWKoxQL/xR+zoCcfm4nzoD3HximnPCEEQA" } ], "WinPoStProof": [ { "PoStProof": 3, "ProofBytes": "pK36Z/ehsV5sqyoX/Gc64tsV2yQOW6X+p8Wy1wH03WC9VA6qyc3ZaTt4d9oI6xVniJdyHiu22yMsXfimEfVSc/UzThf8KrnIBMWZr3sSQsOVusdf1zV5zNfvDr1wccHhCjIExyinkvGRW/irioDZ49Jrm5PUvaBERIuJC4hUp0DijM8UgY7FIYTA16HHp7gbpUzU7mpofBz42tL3c/8LgOmLd7FKOh69fk0xHYaeQU1Oz3cbSSHWL8a/wRf4y3nV" } ], "Parents": [ { "/": "bafy2bzaceaxasycsjnixwqqbx4o3fsspal2zspnhmdjdtyke5xwtjkut7asyw" }, { "/": "bafy2bzaceadqtqu4wcecrk2akfb4mw7y3bedihwanwk2l4dxbcu4fonu3x6pe" }, { "/": "bafy2bzacecoqk52mag2xpxn2eq3pfmyr6mafvogju4znyagmkah4oo4fjgh5i" }, { "/": "bafy2bzaced46b2tewkbg6qfa5jnoecvbpdn5k7loz7qsoon3m5mgeb63de46s" } ], "ParentWeight": "63400884650", "Height": 2692153, "ParentStateRoot": { "/": "bafy2bzacec5o4ffqnp4zmkn44i6h7oajurvtsb5zvstudvgwhha7y25alt3ck" }, "ParentMessageReceipts": { "/": "bafy2bzacebvll7rq7wscnsgbvgdc7xeuzsp2quu4hhfx4pjvq3hydhw2auvd6" }, "Messages": { "/": "bafy2bzacechrvqknf26ff4pihyatewfx64ae4bawbp4ibtasy72hr63fds4iq" }, "BLSAggregate": { "Type": 2, "Data": "mQuz4wd292+Qh8oeZmpl+4QX7/90Oz7VDFLgPhRjIGgvYTEj0FYAecHTaxKaH0GGDwt0nqEvoVbFGf6PA6wCNtzwpLTMqQXZrT2cFeSAtC62vOOn7KTSdqtFxJvBwX1a" }, "Timestamp": 1679070990, "BlockSig": { "Type": 2, "Data": "qiMSk+hQ1E9WGMRn2o5dQmCpz1uO8JK4oIoh8NUwybN7GzrLEaSTv1W5IGx5AAnrAIYgE1MA+Y+CQ677iBC6wD3YUpzdSIt0QCv3cbf8SJgeOVusC+x0Vo/29zRGBgU/" }, "ForkSignaling": 0, "ParentBaseFee": "403334159" }, "id": 1 } ``` --- ### `Filecoin.ChainGetBlockMessages` > Returns the messages stored in the specified block. If there are multiple blocks in a tipset, it’s likely that some messages will be duplicated. It’s also possible for blocks in a tipset to have different messages from the same sender at the same nonce. When that happens, only the first message (in a block with the lowest ticket) will be considered for execution. :::warning This method should only be used for getting messages in a specific block.
Do not use this method to get messages included in a tipset. ::: :::tip To get messages included in a tipset, use [`Filecoin.ChainGetParentMessages`](/rpc-service/chains/chains-api/filecoin/chain/#filecoinchaingetparentmessages) which performs correct message deduplication. ::: [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetBlockMessages", "params": [ { "/": "bafy2bzaceblys3pf5uejw4dvqgpfumoxjnkxcz22pqkjcztj4xumva52mzthe" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "BlsMessages": [ { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } } ], "SecpkMessages": [ { "Message": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "Signature": { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" }, "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } } ], "Cids": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ] } } ``` --- ### `Filecoin.ChainGetGenesis` > Returns the genesis tipset. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Parameters None. #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetGenesis", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Cids": [ { "/": "bafy2bzacecnamqgqmifpluoeldx7zzglxcljo6oja4vrmtj7432rphldpdmm2" } ], "Blocks": [ { "Miner": "f00", "Ticket": { "VRFProof": "X4oDOWswmmD7fT0z3RNIPQVGS85f2dBhceeowoDiQhY=" }, "ElectionProof": { "WinCount": 0, "VRFProof": null }, "BeaconEntries": [ { "Round": 0, "Data": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" } ], "WinPoStProof": null, "Parents": [ { "/": "bafyreiaqpwbbyjo4a42saasj36kkrpv4tsherf2e7bvezkert2a7dhonoi" } ], "ParentWeight": "0", "Height": 0, "ParentStateRoot": { "/": "bafy2bzacech3yb7xlb7c57v2xh7rvmt4skeidk7z2g36llksaz4biflblbt24" }, "ParentMessageReceipts": { "/": "bafy2bzacedswlcz5ddgqnyo3sak3jmhmkxashisnlpq6ujgyhe4mlobzpnhs6" }, "Messages": { "/": "bafy2bzacecmda75ovposbdateg7eyhwij65zklgyijgcjwynlklmqazpwlhba" }, "BLSAggregate": null, "Timestamp": 1598306400, "BlockSig": null, "ForkSignaling": 0, "ParentBaseFee": "100000000" } ], "Height": 0 }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/filecoin/methods/ title: Filecoin — Methods, Chain (1/3) source: docs/rpc-service/chains/chains-api/filecoin/methods.mdx --- # Filecoin — Methods, Chain (1/3) > API reference for [Filecoin](/rpc-service/chains/chains-api/filecoin/). [All methods ->](/rpc-service/chains/chains-api/filecoin/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/filecoin/methods-p2/) · [3](/rpc-service/chains/chains-api/filecoin/methods-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "1.20.3+mainnet+git.04ad31148", "id": 1 } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "314" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x12", "id": 1 } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2caad377" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2910f9" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xff00000000000000000000000000000000193b86", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x27d6e22a612335c27", "id": 1 } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xff00000000000000000000000000000000193b86", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xff00000000000000000000000000000000193b86", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x44d2", "id": 1 } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xa5a4ed12caffde7ff39b505d229759a193da11f4a5a087929df1973f3671b895"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x49", "id": 1 } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_: ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x2910AA"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0xc0", "id": 1 } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xff00000000000000000000000000000000193b86", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x", "id": 1 } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/filecoin/methods-p2/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x", "id": 1 } ``` --- ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":"0xcc84a1423537d7ac00b22d4a3ebc0fec5ff42205", "to":"0x7b90337f65faa2b2b8ed583ba1ba6eb0c9d7ea44"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53b8" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x1115a2c6e2ab432630f3da5f666fc0cdf21e3b71de6c2e2b1850f9e63a7309a7", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "hash": "0x1115a2c6e2ab432630f3da5f666fc0cdf21e3b71de6c2e2b1850f9e63a7309a7", "parentHash": "0x8f2f702031ecc7b6481558a00f8e329083b06b9076ef7f28c0fe1a7920f2631f", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x0000000000000000000000000000000000000000", "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "logsBloom": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "difficulty": "0x0", "totalDifficulty": "0x0", "number": "0x2910eb", "gasLimit": "0x2540be400", "gasUsed": "0x360744e48", "timestamp": "0x641433ea", "extraData": "0x", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "baseFeePerGas": "0x31ed7402", "size": "0x0", "transactions": [ "0x4060116f4dc21836c694f7a7c3113a3449db4800648b53330b62d7e2acb728ca", "0x95773ad43e3ee47fb72425ed5882b1e81e88e65808cfb8a3857bd8ffc7ad95d2", "0x3cda7c03632521df07450953bfc4dbed3e47cc81981b5d0b452161aa57cc2f54", "0x5b005f19aa04b5e10bdf179efc502f59051acd1725546f90ece3162a72f4e371", "0x7d21a229bf22fe7835c02a5ca33fa9d0c843e66d63eece968297922b2d26d8d6", "0xb443b4c8d736e45aac0136a46370d44ffa7dc0d81b5c6c0f92ad91a65fc15d1c", "0x6fb559a195599d2813621dba1d982c75857b184109cbeaedc8c8b80456a74763" ], "uncles": [] }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/filecoin/state-p2/ title: Filecoin — State, Wallet (2/3) source: docs/rpc-service/chains/chains-api/filecoin/state-p2.mdx --- # Filecoin — State, Wallet (2/3) > API reference for [Filecoin](/rpc-service/chains/chains-api/filecoin/). [All methods ->](/rpc-service/chains/chains-api/filecoin/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/filecoin/state/) · 2 · [3](/rpc-service/chains/chains-api/filecoin/state-p3/) ### `Filecoin.StateMinerActiveSectors` > Returns info about sectors that a given miner is actively proving. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerActiveSectors", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "SectorNumber": 9, "SealProof": 8, "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "DealIDs": [ 5432 ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", "VerifiedDealWeight": "0", "InitialPledge": "0", "ExpectedDayReward": "0", "ExpectedStoragePledge": "0", "SectorKeyCID": null } ], "id": 1 } ``` --- ### `Filecoin.StateMinerAvailableBalance` > Returns the portion of a miner’s balance that can be withdrawn or spent. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerAvailableBalance", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0", "id": 1 } ``` --- ### `Filecoin.StateMinerDeadlines` > Returns all the proving deadlines for the given miner. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerDeadlines", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "PostSubmissions": [ 5, 1 ], "DisputableProofCount": 42 } ], "id": 1 } ``` --- ### `Filecoin.StateMinerFaults` > Returns a bitfield indicating the faulty sectors of the given miner. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerFaults", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ 5, 1 ], "id": 1 } ``` --- ### `Filecoin.StateMinerInfo` > Returns info about the indicated miner. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerInfo", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Owner": "f01234", "Worker": "f01234", "NewWorker": "f01234", "ControlAddresses": [ "f01234" ], "WorkerChangeEpoch": 10101, "PeerId": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", "Multiaddrs": [ "Ynl0ZSBhcnJheQ==" ], "WindowPoStProofType": 8, "SectorSize": 34359738368, "WindowPoStPartitionSectors": 42, "ConsensusFaultElapsed": 10101 }, "id": 1 } ``` --- ### `Filecoin.StateMinerInitialPledgeCollateral` > Returns the initial pledge collateral for the specified miner’s sector. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerInitialPledgeCollateral", "params": [ "f01234", { "SealProof": 8, "SectorNumber": 9, "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "SealRandEpoch": 10101, "DealIDs": [ 5432 ], "Expiration": 10101, "ReplaceCapacity": true, "ReplaceSectorDeadline": 42, "ReplaceSectorPartition": 42, "ReplaceSectorNumber": 9 }, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0", "id": 1 } ``` --- ### `Filecoin.StateMinerPartitions` > Returns all partitions in the specified deadline. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerPartitions", "params": [ "f01234", 42, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "AllSectors": [ 5, 1 ], "FaultySectors": [ 5, 1 ], "RecoveringSectors": [ 5, 1 ], "LiveSectors": [ 5, 1 ], "ActiveSectors": [ 5, 1 ] } ], "id": 1 } ``` --- ### `Filecoin.StateMinerPower` > Returns the power of the indicated miner. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerPower", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "MinerPower": { "RawBytePower": "0", "QualityAdjPower": "0" }, "TotalPower": { "RawBytePower": "0", "QualityAdjPower": "0" }, "HasMinPower": true }, "id": 1 } ``` --- ### `Filecoin.StateMinerPreCommitDepositForPower` > Returns the pre-commit deposit for the specified miner’s sector. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerPreCommitDepositForPower", "params": [ "f01234", { "SealProof": 8, "SectorNumber": 9, "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "SealRandEpoch": 10101, "DealIDs": [ 5432 ], "Expiration": 10101, "ReplaceCapacity": true, "ReplaceSectorDeadline": 42, "ReplaceSectorPartition": 42, "ReplaceSectorNumber": 9 }, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0", "id": 1 } ``` --- ### `Filecoin.StateMinerProvingDeadline` > Calculates the deadline at some epoch for a proving period and returns the deadline-related calculations. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerProvingDeadline", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "CurrentEpoch": 10101, "PeriodStart": 10101, "Index": 42, "Open": 10101, "Close": 10101, "Challenge": 10101, "FaultCutoff": 10101, "WPoStPeriodDeadlines": 42, "WPoStProvingPeriod": 10101, "WPoStChallengeWindow": 10101, "WPoStChallengeLookback": 10101, "FaultDeclarationCutoff": 10101 }, "id": 1 } ``` --- ### `Filecoin.StateMinerRecoveries` > Returns a bitfield indicating the recovering sectors of the given miner. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerRecoveries", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ 5, 1 ], "id": 1 } ``` --- ### `Filecoin.StateMinerSectorAllocated` > Checks if a sector is allocated. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerSectorAllocated", "params": [ "f01234", 9, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": true, "id": 1 } ``` --- ### `Filecoin.StateMinerSectorCount` > Returns the number of sectors in a miner’s sector set and proving set. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerSectorCount", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Live": 42, "Active": 42, "Faulty": 42 }, "id": 1 } ``` --- ### `Filecoin.StateMinerSectors` > Returns info about the given miner’s sectors. If the filter bitfield is nil, all sectors are included. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerSectors", "params": [ "f01234", [ 0 ], [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "SectorNumber": 9, "SealProof": 8, "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "DealIDs": [ 5432 ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", "VerifiedDealWeight": "0", "InitialPledge": "0", "ExpectedDayReward": "0", "ExpectedStoragePledge": "0", "SectorKeyCID": null } ], "id": 1 } ``` --- ### `Filecoin.StateNetworkName` > Returns the name of the network the node is synced to. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateNetworkName", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "lotus", "id": 1 } ``` --- ### `Filecoin.StateNetworkVersion` > Returns the network version at the given tipset. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateNetworkVersion", "params": [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": 15, "id": 1 } ``` --- ### `Filecoin.StateReadState` > Returns the indicated actor’s state. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateReadState", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Balance": "0", "Code": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "State": {} }, "id": 1 } ``` --- ### `Filecoin.StateReplay` > Replays a given message, assuming it was included in a block in the specified tipset. If a tipset key is provided, and a replacing message is found on chain, the method will return an error saying that the message wasn’t found If no tipset key is provided, the appropriate tipset is looked up, and if the message was gas-repriced, the on-chain message will be replayed — in that case the returned InvocResult.MsgCid will not match the Cid param If the caller wants to ensure that exactly the requested message was executed, they MUST check that InvocResult.MsgCid is equal to the provided Cid. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateReplay", "params": [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "MsgCid": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Msg": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "GasCost": { "Message": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "GasUsed": "0", "BaseFeeBurn": "0", "OverEstimationBurn": "0", "MinerPenalty": "0", "MinerTip": "0", "Refund": "0", "TotalCost": "0" }, "ExecutionTrace": { "Msg": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "Error": "string value", "Duration": 60000000000, "GasCharges": [ { "Name": "string value", "loc": [ { "File": "string value", "Line": 123, "Function": "string value" } ], "tg": 9, "cg": 9, "sg": 9, "vtg": 9, "vcg": 9, "vsg": 9, "tt": 60000000000, "ex": {} } ], "Subcalls": [ { "Msg": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "Error": "string value", "Duration": 60000000000, "GasCharges": [ { "Name": "string value", "loc": [ { "File": "string value", "Line": 123, "Function": "string value" } ], "tg": 9, "cg": 9, "sg": 9, "vtg": 9, "vcg": 9, "vsg": 9, "tt": 60000000000, "ex": {} } ], "Subcalls": null } ] }, "Error": "string value", "Duration": 60000000000 }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/filecoin/state-p3/ title: Filecoin — State, Wallet (3/3) source: docs/rpc-service/chains/chains-api/filecoin/state-p3.mdx --- # Filecoin — State, Wallet (3/3) > API reference for [Filecoin](/rpc-service/chains/chains-api/filecoin/). [All methods ->](/rpc-service/chains/chains-api/filecoin/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/filecoin/state/) · [2](/rpc-service/chains/chains-api/filecoin/state-p2/) · 3 ### `Filecoin.StateSearchMsg` > Searches for a message in the chain, and returns its receipt and the tipset where it was executed. NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message — the MsgLookup.Message will be a different CID than the one provided in the ‘cid’ param, MsgLookup.Receipt will contain the result of the execution of the replacing message. If the caller wants to ensure that exactly the requested message was executed, they MUST check that MsgLookup.Message is equal to the provided ‘cid’. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateSearchMsg", "params": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Message": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Receipt": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "ReturnDec": {}, "TipSet": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], "Height": 10101 }, "id": 1 } ``` --- ### `Filecoin.StateSearchMsgLimited` > Looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed. NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message — the MsgLookup.Message will be a different CID than the one provided in the ‘cid’ param, MsgLookup.Receipt will contain the result of the execution of the replacing message. If the caller wants to ensure that exactly the requested message was executed, they MUST check that MsgLookup.Message is equal to the provided ‘cid’. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateSearchMsgLimited", "params": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, 10101 ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Message": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Receipt": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "ReturnDec": {}, "TipSet": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], "Height": 10101 }, "id": 1 } ``` --- ### `Filecoin.StateSectorExpiration` > Returns epoch at which given sector will expire [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateSectorExpiration", "params": [ "f01234", 9, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "OnTime": 10101, "Early": 10101 }, "id": 1 } ``` --- ### `Filecoin.StateSectorGetInfo` > Returns the on-chain info for the specified miner’s sector. Returns null in case the sector info isn’t found. :::tip NOTE: returned info.Expiration may not be accurate in some cases, use StateSectorExpiration to get accurate expiration epoch. ::: [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateSectorGetInfo", "params": [ "f01234", 9, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "SectorNumber": 9, "SealProof": 8, "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "DealIDs": [ 5432 ], "Activation": 10101, "Expiration": 10101, "DealWeight": "0", "VerifiedDealWeight": "0", "InitialPledge": "0", "ExpectedDayReward": "0", "ExpectedStoragePledge": "0", "SectorKeyCID": null }, "id": 1 } ``` --- ### `Filecoin.StateSectorPartition` > Finds deadline/partition with the specified sector. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateSectorPartition", "params": [ "f01234", 9, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Deadline": 42, "Partition": 42 }, "id": 1 } ``` --- ### `Filecoin.StateSectorPreCommitInfo` > Returns the PreCommit info for the specified miner’s sector. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateSectorPreCommitInfo", "params": [ "f01234", 9, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Info": { "SealProof": 8, "SectorNumber": 9, "SealedCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "SealRandEpoch": 10101, "DealIDs": [ 5432 ], "Expiration": 10101, "ReplaceCapacity": true, "ReplaceSectorDeadline": 42, "ReplaceSectorPartition": 42, "ReplaceSectorNumber": 9 }, "PreCommitDeposit": "0", "PreCommitEpoch": 10101, "DealWeight": "0", "VerifiedDealWeight": "0" }, "id": 1 } ``` --- ### `Filecoin.StateVMCirculatingSupplyInternal` > Returns an approximation of the circulating supply of Filecoin at the given tipset. This is the value reported by the runtime interface to actors code. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateVMCirculatingSupplyInternal", "params": [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "FilVested": "0", "FilMined": "0", "FilBurnt": "0", "FilLocked": "0", "FilCirculating": "0", "FilReserveDisbursed": "0" }, "id": 1 } ``` --- ### `Filecoin.StateVerifiedClientStatus` > Returns the data cap for the given address. Returns nil if there is no entry in the data cap table for the address. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateVerifiedClientStatus", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0", "id": 1 } ``` --- ### `Filecoin.StateVerifiedRegistryRootKey` > Returns the address of the Verified Registry’s root key. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateVerifiedRegistryRootKey", "params": [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "f01234", "id": 1 } ``` --- ### `Filecoin.StateVerifierStatus` > Returns the data cap for the given address. Returns nil if there is no entry in the data cap table for the address. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateVerifierStatus", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0", "id": 1 } ``` --- ### `Filecoin.StateWaitMsg` > Looks back in the chain for a message. If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth. NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message — the MsgLookup.Message will be a different CID than the one provided in the ‘cid’ param, MsgLookup.Receipt will contain the result of the execution of the replacing message. If the caller wants to ensure that exactly the requested message was executed, they MUST check that MsgLookup.Message is equal to the provided ‘cid’. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateWaitMsg", "params": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, 42 ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Message": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Receipt": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "ReturnDec": {}, "TipSet": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], "Height": 10101 }, "id": 1 } ``` --- ### `Filecoin.StateWaitMsgLimited` > Looks back up to limit epochs in the chain for a message. If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth. NOTE: If a replacing message is found on chain, this method will return a MsgLookup for the replacing message — the MsgLookup.Message will be a different CID than the one provided in the ‘cid’ param, MsgLookup.Receipt will contain the result of the execution of the replacing message. If the caller wants to ensure that exactly the requested message was executed, they MUST check that MsgLookup.Message is equal to the provided ‘cid’. Without this check both the requested and original message may appear as successfully executed on-chain, which may look like a double-spend. A replacing message is a message with a different CID, any of Gas values, and different signature, but with all other parameters matching (source/destination, nonce, params, etc.) [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateWaitMsgLimited", "params": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, 42, 10101 ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Message": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Receipt": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "ReturnDec": {}, "TipSet": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], "Height": 10101 }, "id": 1 } ``` --- ## Wallet The Wallet methods are used for wallet operations. ### `Filecoin.WalletBalance` > Returns the balance of the given address at the current head of the chain. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.WalletBalance", "params": [ "f01234" ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0", "id": 1 } ``` --- ### `Filecoin.WalletValidateAddress` > Validates whether a given string can be decoded as a well-formed address. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.WalletValidateAddress", "params": [ "string value" ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "f01234", "id": 1 } ``` --- ### `Filecoin.WalletVerify` > Takes an address, a signature, and some bytes, and indicates whether the signature is valid. The address does not have to be in the wallet. #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.WalletVerify", "params": [ "f01234", "Ynl0ZSBhcnJheQ==", { "Type": 2, "Data": "Ynl0ZSBhcnJheQ==" } ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": true, "id": 1 } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/filecoin/state/ title: Filecoin — State, Wallet (1/3) source: docs/rpc-service/chains/chains-api/filecoin/state.mdx --- # Filecoin — State, Wallet (1/3) > API reference for [Filecoin](/rpc-service/chains/chains-api/filecoin/). [All methods ->](/rpc-service/chains/chains-api/filecoin/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/filecoin/state-p2/) · [3](/rpc-service/chains/chains-api/filecoin/state-p3/) ### `Filecoin.StateCompute` > Applies the given messages on the given tipset. The messages are run as though the VM were at the provided height. When called, StateCompute will: * Load the provided tipset, or use the current chain head if not provided * Compute the tipset state of the provided tipset on top of the parent state * (note that this step runs before vmheight is applied to the execution) * Execute state upgrade if any were scheduled at the epoch, or in null blocks preceding the tipset * Call the cron actor on null blocks preceding the tipset * For each block in the tipset * Apply messages in blocks in the specified * Award block reward by calling the reward actor * Call the cron actor for the current epoch * If the specified vmheight is higher than the current epoch, apply any needed state upgrades to the state * Apply the specified messages to the state The vmheight parameter sets VM execution epoch, and can be used to simulate message execution in different network versions. If the specified vmheight epoch is higher than the epoch of the specified tipset, any state upgrades until the vmheight will be executed on the state before applying messages specified by the user. Note that the initial tipset state computation is not affected by the vmheight parameter — only the messages in the `apply` set are If the caller wants to simply compute the state, vmheight should be set to the epoch of the specified tipset. Messages in the `apply` parameter must have the correct nonces, and gas values set. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateCompute", "params": [ 10101, [ { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } } ], [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Root": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Trace": [ { "MsgCid": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Msg": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "GasCost": { "Message": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "GasUsed": "0", "BaseFeeBurn": "0", "OverEstimationBurn": "0", "MinerPenalty": "0", "MinerTip": "0", "Refund": "0", "TotalCost": "0" }, "ExecutionTrace": { "Msg": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "Error": "string value", "Duration": 60000000000, "GasCharges": [ { "Name": "string value", "loc": [ { "File": "string value", "Line": 123, "Function": "string value" } ], "tg": 9, "cg": 9, "sg": 9, "vtg": 9, "vcg": 9, "vsg": 9, "tt": 60000000000, "ex": {} } ], "Subcalls": [ { "Msg": { "Version": 42, "To": "f01234", "From": "f01234", "Nonce": 42, "Value": "0", "GasLimit": 9, "GasFeeCap": "0", "GasPremium": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "CID": { "/": "bafy2bzacebbpdegvr3i4cosewthysg5xkxpqfn2wfcz6mv2hmoktwbdxkax4s" } }, "MsgRct": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "Error": "string value", "Duration": 60000000000, "GasCharges": [ { "Name": "string value", "loc": [ { "File": "string value", "Line": 123, "Function": "string value" } ], "tg": 9, "cg": 9, "sg": 9, "vtg": 9, "vcg": 9, "vsg": 9, "tt": 60000000000, "ex": {} } ], "Subcalls": null } ] }, "Error": "string value", "Duration": 60000000000 } ] }, "id": 1 } ``` --- ### `Filecoin.StateDealProviderCollateralBounds` > Returns the min and max collateral a storage provider can issue. It takes the deal size and verified status as parameters. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateDealProviderCollateralBounds", "params": [ 1032, true, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Min": "0", "Max": "0" }, "id": 1 } ``` --- ### `Filecoin.StateDecodeParams` > Attempts to decode the provided params, based on the recipient actor address and method number. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateDecodeParams", "params": [ "f01234", 1, "Ynl0ZSBhcnJheQ==", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": {}, "id": 1 } ``` --- ### `Filecoin.StateGetActor` > Returns the indicated actor’s nonce and balance. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateGetActor", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Code": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Head": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "Nonce": 42, "Balance": "0" }, "id": 1 } ``` --- ### `Filecoin.StateGetReceipt` > Returns the message receipt for the given message or for a matching gas-repriced replacing message. :::tip If the requested message was replaced, this method will return the receipt for the replacing message — if the caller needs the receipt for exactly the requested message, use StateSearchMsg().Receipt, and check that MsgLookup.Message is matching the requested CID. ::: :::warning DEPRECATED: Use StateSearchMsg, this method won’t be supported in v1 API ::: [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateGetReceipt", "params": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "ExitCode": 0, "Return": "Ynl0ZSBhcnJheQ==", "GasUsed": 9 }, "id": 1 } ``` --- ### `Filecoin.StateListActors` > Returns the addresses of every actor in the state. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateListActors", "params": [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": ["f01234"], "id": 1 } ``` --- ### `Filecoin.StateListMessages` > Looks back and returns all messages with a matching to or from address, stopping at the given height. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateListMessages", "params": [ { "To": "f01234", "From": "f01234" }, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ], 10101 ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" } ], "id": 1 } ``` --- ### `Filecoin.StateListMiners` > Returns the addresses of every miner that has claimed power in the Power Actor. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateListMiners", "params": [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ "f01234" ], "id": 1 } ``` --- ### `Filecoin.StateLookupID` > Retrieves the ID address of the given address. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateLookupID", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "f01234", "id": 1 } ``` --- ### `Filecoin.StateMarketBalance` > Looks up the Escrow and Locked balances of the given address in the Storage Market. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMarketBalance", "params": [ "f01234", [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Escrow": "0", "Locked": "0" }, "id": 1 } ``` --- ### `Filecoin.StateMarketDeals` > Returns information about every deal in the Storage Market. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMarketDeals", "params": [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "t026363": { "Proposal": { "PieceCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "PieceSize": 1032, "VerifiedDeal": true, "Client": "f01234", "Provider": "f01234", "Label": "string value", "StartEpoch": 10101, "EndEpoch": 10101, "StoragePricePerEpoch": "0", "ProviderCollateral": "0", "ClientCollateral": "0" }, "State": { "SectorStartEpoch": 10101, "LastUpdatedEpoch": 10101, "SlashEpoch": 10101 } } }, "id": 1 } ``` --- ### `Filecoin.StateMarketParticipants` > Returns the Escrow and Locked balances of every participant in the Storage Market. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMarketParticipants", "params": [ [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "t026363": { "Escrow": "0", "Locked": "0" } }, "id": 1 } ``` --- ### `Filecoin.StateMarketStorageDeal` > Returns information about the indicated deal. [Permission](/rpc-service/chains/chains-api/filecoin/#permissions): `read` #### Request example ```shell curl -X POST https://rpc.ankr.com/filecoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.StateMarketStorageDeal", "params": [ 5432, [ { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, { "/": "bafy2bzacebp3shtrn43k7g3unredz7fxn4gj533d3o43tqn2p2ipxxhrvchve" } ] ], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "Proposal": { "PieceCID": { "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" }, "PieceSize": 1032, "VerifiedDeal": true, "Client": "f01234", "Provider": "f01234", "Label": "string value", "StartEpoch": 10101, "EndEpoch": 10101, "StoragePricePerEpoch": "0", "ProviderCollateral": "0", "ClientCollateral": "0" }, "State": { "SectorStartEpoch": 10101, "LastUpdatedEpoch": 10101, "SlashEpoch": 10101 } }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/flare/evm-methods-2/ title: Flare — EVM methods source: docs/rpc-service/chains/chains-api/flare/evm-methods-2.mdx --- # Flare — EVM methods > API reference for [Flare](/rpc-service/chains/chains-api/flare/). [All methods ->](/rpc-service/chains/chains-api/flare/#methods) ### `eth_getLogs` > Returns an array of all logs matching a given filter object. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. #### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x3fE77e9be1ECcDe815311f9bcc40814F4eC6AE09"}], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- ### `eth_getAssetBalance` > Retrieves the balance of first class Flare Native Tokens on the C-Chain. In addition to the standard Ethereum APIs, Flare offers `eth_getAssetBalance` to retrieve the balance of first class Flare Native Tokens on the C-Chain (excluding AVAX, which must be fetched with eth_getBalance). #### Parameters **Signature**: ``` eth_getAssetBalance({ address: string, blk: BlkNrOrHash, assetID: string, }) -> {balance: int} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `address`: owner of the asset. * `blk`: the block number or hash at which to retrieve the balance. * `assetID`: an ID of the asset for which the balance is requested. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/flare' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"eth_getAssetBalance", "params" : [ "0x8723e5773847A4Eb5FeEDabD9320802c5c812F46", "latest", "3RvKBAmQnfYionFXMfW5P8TDZgZiogKbHjM8cjpu16LKAgF5T" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1388" } ``` --- ### `eth_baseFee` > Retrieves the base fee for the next block. #### Parameters **Signature**: ``` eth_baseFee() -> {} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/flare' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"eth_baseFee", "params" : [] }' ``` #### Request example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x66f4f3390" } ``` --- ### `eth_maxPriorityFeePerGas` > Retrieves the priority fee needed to be included in a block. #### Parameters **Signature**: ``` eth_maxPriorityFeePerGas() -> {} ``` **Request parameters**: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/flare' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"eth_maxPriorityFeePerGas", "params" : [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/flare/evm-methods-p2/ title: Flare — EVM methods (2/3) source: docs/rpc-service/chains/chains-api/flare/evm-methods-p2.mdx --- # Flare — EVM methods (2/3) > API reference for [Flare](/rpc-service/chains/chains-api/flare/). [All methods ->](/rpc-service/chains/chains-api/flare/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/flare/evm-methods/) · 2 · [3](/rpc-service/chains/chains-api/flare/evm-methods-p3/) ## EVM methods ### `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (quantity): the amount of gas used. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x3727cfCBD85390Bb11B3fF421878123AdB866be8","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53b8" } ``` --- ### `eth_getBlockByHash` > Returns information for the block specified by block hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. #### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xda396abaf2c81c964746e4d37a4ee38db6462a601cd6b89119899fbb9a79463c", false], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x98eb59547", "blockExtraData": "0x", "blockGasCost": "0xf4240", "difficulty": "0x1", "extDataGasUsed": "0x0", "extDataHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "extraData": "0x0000000000658f90000000000075018e0000000000635ef0000000000050c3ef00000000003a08c400000000005cffe5000000000038171c0000000000235b8e00000000001cacb80000000000000000", "gasLimit": "0x7a1200", "gasUsed": "0x1ca1e0", "hash": "0xda396abaf2c81c964746e4d37a4ee38db6462a601cd6b89119899fbb9a79463c", "logsBloom": "0x00020800000004010010000000000000000004000080000000000000000006000200000000040000020000000000000000008080002000010000000008000000200000000080004100400000000020002000000000100004000084000000000100000000000000040000000000000000000020000000000001210200240002004000000000040000000000000000008100000000400800000400300500008008080009002000000200000000000008000000008000000000000000000001000000000000800100000000000800000020000000000100000000400240050000000000080000000000000000010002420000000000080000080000000000000001", "miner": "0x0100000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0xbe7bdc", "parentHash": "0xba6047d1d08a413a04fb626abf35e0efac669f892b7004ce976ed90b0fb82259", "receiptsRoot": "0xced751b09a3bdfcaffdf9a3792e5c6c44d060f484d81ec3d0fe07bf708355ce1", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0xdf0", "stateRoot": "0x082a923169550df0431eafe118fe35fe93f137463c0a0b6fde7f524747d2c8fd", "timestamp": "0x64f9d661", "totalDifficulty": "0xbe7bdc", "transactions": [ "0x0e9199a9be799934bd93759a232bf454630c904759d07ff26aac75ed6d65af8a", "0x7f396fcd410991b51815f955ba16ed33e8f0cfe6a72758a56ceb18ec59562a0b" ], "transactionsRoot": "0x0348339df1a95ad8ff021810f41a7421ac16afcf28c672f81ea77ad388002adc", "uncles": [] } } ``` --- ### `eth_getBlockByNumber` > Returns information for the block specified by block number. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. #### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x6317d9c55", "blockExtraData": "0x", "blockGasCost": "0x0", "difficulty": "0x1", "extDataGasUsed": "0x0", "extDataHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x7a1200", "gasUsed": "0x8277c", "hash": "0xb12ec30126bc6e2996a7dac4709ea7ef5616b9d4e17ed3497a7fcea1f9738355", "logsBloom": "0x00020000000000000000000080000000000000000000000000000000000001200000000000000000000000000000000000000000000080000000000000000000000040000000000000600008002020000000000000000000000080008000800000000000820000000008000000000800000000040008000001000010000000000000020000000000000000200000000000000011100040082000000400001000082000000000000000000000000000000200000000000000002000000000000040000002000000000000000000020000000000000004001000020000000020000000000000000000000400000000000000080000000000400000000000000000", "miner": "0x0100000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0xbe7bf5", "parentHash": "0xbec426ff031f840b280a89dd62deb1b88d234b7db8ede1b0c91c249c3df60a7d", "receiptsRoot": "0x5e0f2ee719197966326d67585c291b9f020f3529b0847f488ba0af5804b2c26d", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3bd", "stateRoot": "0x2b759653407627e355c524cea8bf2dc11e847693b7a557f5274bb7bd30f2ccd1", "timestamp": "0x64f9d6da", "totalDifficulty": "0xbe7bf5", "transactions": [ "0xd5ab9b761813f1572271a2764664da7ced8e9ac77151e26d2c7e6a5331c436a1" ], "transactionsRoot": "0x52653fa51cafbf77b7ea31e1fce9be3c5a23e3b5948e716e163f737c66990337", "uncles": [] } } ``` --- ### `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. #### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xa4ddb8f66ba81edd90b5299aa35447f5c3426f26d03de6543a7c75c381c784d4"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xbdb84c3e03660c5e59a4a182d8c5e0a6fae96d322ba7eaf90677ddff6006b599", "blockNumber": "0xbe76f1", "from": "0xf12f09e8ee7e0c0d0b3279120325a97dc821e971", "gas": "0x2625a0", "gasPrice": "0x34630b8a00", "hash": "0xa4ddb8f66ba81edd90b5299aa35447f5c3426f26d03de6543a7c75c381c784d4", "input": "0xe2db5a5200000000000000000000000000000000000000000000000000000000000314dd000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001e0428183b2922e853f7c15b6df401da9eee59f95eea54008612097e86c1a021269000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000c2d100000000000000000000000000000000000000000000000000000000005fe72b0000000000000000000000000000000000000000000000000000000000002fd3000000000000000000000000000000000000000000000000000000000000189100000000000000000000000000000000000000000000000000000000000062fd00000000000000000000000000000000000000000000000000000000000024a60000000000000000000000000000000000000000000000000000000098fc85b70000000000000000000000000000000000000000000000000000000009b132ae000000000000000000000000000000000000000000000000000000000004e8b200000000000000000000000000000000000000000000000000000000000004fa", "nonce": "0x48e9a", "to": "0x1000000000000000000000000000000000000003", "transactionIndex": "0x3", "value": "0x0", "type": "0x0", "chainId": "0xe", "v": "0x40", "r": "0x7a737c7e04de1539e1a61fdbd1f43d28116a93c04b9ee02ea223270ff97ef41c", "s": "0x2a4a2c54780d78ab81705d3d8f151902773b498134acae04ed2f9af1ff86c17d" } } ``` --- ### `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. #### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x8056988b9e6a19979a23f204d03ab365e605af6b0036564f8c5bc1cd424d756b", "0x0"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x8056988b9e6a19979a23f204d03ab365e605af6b0036564f8c5bc1cd424d756b", "blockNumber": "0xbe76f7", "from": "0xc7cf3238d2ca63d01ad4d42b4ccb9db8b0ade702", "gas": "0x2625a0", "gasPrice": "0x746a528800", "maxFeePerGas": "0x746a528800", "maxPriorityFeePerGas": "0x746a528800", "hash": "0x0c9a3fdc5ce9a7e39d301354be873af6e93908a583744f6da1325e9aef22b1b1", "input": "0xe2db5a5200000000000000000000000000000000000000000000000000000000000314dd000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002e09b83cc55afdbc384a4ea41303117f12ef10d7d0549bdde8fdb2d3434f875ebf7000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000f00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000130000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000c2d500000000000000000000000000000000000000000000000000000000005fe0be0000000000000000000000000000000000000000000000000000000000002fd1000000000000000000000000000000000000000000000000000000000000189200000000000000000000000000000000000000000000000000000000000062ee00000000000000000000000000000000000000000000000000000000000024a70000000000000000000000000000000000000000000000000000000098fbe7ee0000000000000000000000000000000000000000000000000000000009b13b50000000000000000000000000000000000000000000000000000000000004e8d500000000000000000000000000000000000000000000000000000000000004fb0000000000000000000000000000000000000000000000000000000000015fec00000000000000000000000000000000000000000000000000000000000f0d690000000000000000000000000000000000000000000000000000000001463995000000000000000000000000000000000000000000000000000000000000d85b00000000000000000000000000000000000000000000000000000000001d994c00000000000000000000000000000000000000000000000000000000000186c20000000000000000000000000000000000000000000000000000000000018666000000000000000000000000000000000000000000000000000000000000151d", "nonce": "0x58094", "to": "0x1000000000000000000000000000000000000003", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0xe", "v": "0x0", "r": "0x4a7c6af13d2b1d6fa94cb9dbeb5e62b02d0b2bc53cec070c31fef03ecb2edc1c", "s": "0x63581ea3a61b26279a76a210ed05f875438634562747d07c155aa1928d444160" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/flare/evm-methods-p3/ title: Flare — EVM methods (3/3) source: docs/rpc-service/chains/chains-api/flare/evm-methods-p3.mdx --- # Flare — EVM methods (3/3) > API reference for [Flare](/rpc-service/chains/chains-api/flare/). [All methods ->](/rpc-service/chains/chains-api/flare/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/flare/evm-methods/) · [2](/rpc-service/chains/chains-api/flare/evm-methods-p2/) · 3 ## EVM methods ### `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. #### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x056356a9ae44398575433ad04655e317a36b953559b395cffc6d19db5a762b2e", "blockNumber": "0xbeef7a", "from": "0xb084575cacedf7dedd78329656715651f8f66712", "gas": "0x2625a0", "gasPrice": "0x6a113947e0", "hash": "0xfc747cba6fe5096049184cd7317feb7678ea2244909dbec795231397aa20e7d9", "input": "0xe2db5a520000000000000000000000000000000000000000000000000000000000031675000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a04b97ff052cbf418409d77676d98c1e52aacf28c4d43b38c898e9511875b271d70000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000f00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000130000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000001645d00000000000000000000000000000000000000000000000000000000000f4e2400000000000000000000000000000000000000000000000000000000014aba77000000000000000000000000000000000000000000000000000000000000d4aa00000000000000000000000000000000000000000000000000000000001e14ac00000000000000000000000000000000000000000000000000000000000186a200000000000000000000000000000000000000000000000000000000000186700000000000000000000000000000000000000000000000000000000000001696", "nonce": "0x96b1", "to": "0x1000000000000000000000000000000000000003", "transactionIndex": "0x0", "value": "0x0", "type": "0x0", "chainId": "0xe", "v": "0x3f", "r": "0x51b4275338f7918a39afca3766bf377cc9e9968f824dffcdbe70fcc2ee852b23", "s": "0x56b7e3634539d74fe58446934cd625e53a29d31ade254ef99471a92c3654364e" } } ``` --- ### `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. #### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x832e3d4fc79919baac1a7c0b89fe30f23cde74987695a500bb111e805c391805"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x588cd986c91d8662c84b3b4d8f0705aa02feab8a63d80bbb54b1025ee7453db4", "blockNumber": "0xbe76f8", "contractAddress": null, "cumulativeGasUsed": "0x1864d7", "effectiveGasPrice": "0x3c4f6606d1", "from": "0x1c4f41549e99c13f6091dd6a806d638c084adaa6", "gasUsed": "0x333d9", "logs": [ { "address": "0x50edeaa0f6772c899276ddc1b515f4c81d529e6c", "topics": [ "0x500599802164a08023e87ffc3eed0ba3ae60697b3083ba81d046683679d81c6b", "0x0000000000000000000000001c4f41549e99c13f6091dd6a806d638c084adaa6", "0x0000000000000000000000009a46864a3b0a7805b266c445289c3fad1e48f18e" ], "data": "0x0000000000000000000000000000000000000000000001234f5903de73a4214f0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xbe76f8", "transactionHash": "0x832e3d4fc79919baac1a7c0b89fe30f23cde74987695a500bb111e805c391805", "transactionIndex": "0x1", "blockHash": "0x588cd986c91d8662c84b3b4d8f0705aa02feab8a63d80bbb54b1025ee7453db4", "logIndex": "0x17", "removed": false }, { "address": "0x50edeaa0f6772c899276ddc1b515f4c81d529e6c", "topics": [ "0x500599802164a08023e87ffc3eed0ba3ae60697b3083ba81d046683679d81c6b", "0x0000000000000000000000001c4f41549e99c13f6091dd6a806d638c084adaa6", "0x000000000000000000000000b0421af2cffb21d8a0be4087448146e4f9cbd306" ], "data": "0x0000000000000000000000000000000000000000000001234f5903de73a4214f0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xbe76f8", "transactionHash": "0x832e3d4fc79919baac1a7c0b89fe30f23cde74987695a500bb111e805c391805", "transactionIndex": "0x1", "blockHash": "0x588cd986c91d8662c84b3b4d8f0705aa02feab8a63d80bbb54b1025ee7453db4", "logIndex": "0x18", "removed": false } ], "logsBloom": "0x00000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000400000000000000000000000000000000000001000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000040000000000000000000000000000000000000000100000000000000000001000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000004000000000000000020220000000000000000000000040000008000000000000000000000000000000000", "status": "0x1", "to": "0x1d80c49bbbcd1c0911346656b529df9e5c2f783d", "transactionHash": "0x832e3d4fc79919baac1a7c0b89fe30f23cde74987695a500bb111e805c391805", "transactionIndex": "0x1", "type": "0x1" } } ``` --- ### `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): the uncle's index position. #### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x4598a7bb6bfc449773f71531048e1e822c847f13bc6534817b14bba56bbdf1c2", "0x0"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ### `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. #### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` #### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/flare/evm-methods/ title: Flare — EVM methods (1/3) source: docs/rpc-service/chains/chains-api/flare/evm-methods.mdx --- # Flare — EVM methods (1/3) > API reference for [Flare](/rpc-service/chains/chains-api/flare/). [All methods ->](/rpc-service/chains/chains-api/flare/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/flare/evm-methods-p2/) · [3](/rpc-service/chains/chains-api/flare/evm-methods-p3/) ## EVM methods * [`web3_clientVersion`](#web3_clientversion) — returns the current client version. * [`web3_sha3`](#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](#net_version) — returns the current network ID. * [`net_listening`](#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/flare/evm-methods-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/flare/evm-methods-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/flare/evm-methods-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/flare/evm-methods-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/flare/evm-methods-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/flare/evm-methods-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/flare/evm-methods-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/flare/evm-methods-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/flare/evm-methods-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/flare/evm-methods-2/#eth_getlogs) — returns logs matching the parameters specified. * [`eth_getAssetBalance`](/rpc-service/chains/chains-api/flare/evm-methods-2/#eth_getassetbalance) — retrieves the balance of first class Avalanche Native Tokens on the C-Chain (excluding AVAX, which must be fetched with eth_getBalance). * [`eth_baseFee`](/rpc-service/chains/chains-api/flare/evm-methods-2/#eth_basefee) — retrieves the base fee for the next block. * [`eth_maxPriorityFeePerGas`](/rpc-service/chains/chains-api/flare/evm-methods-2/#eth_maxpriorityfeepergas) — retrieves the priority fee needed to be included in a block. --- ### `web3_clientVersion` > Returns the current client version. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * ``: the current client version. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "v0.8.15" } ``` --- ## EVM methods ### `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. #### Returns * `` (data): the SHA3 result of the given string. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ### `net_version` > Returns the current network ID. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * ``: the current network ID. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "14" } ``` --- ### `net_listening` > Returns `true` if client is actively listening for network connections. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * ``: `true` when listening, otherwise `false`. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ### `eth_syncing` > Returns an object with data about the sync status or false. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * ``|``: an object with sync status data or FALSE, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` #### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` #### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ### `eth_gasPrice` > Returns the current price per gas in wei. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * `` (quantity): the current gas price in wei. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x72739b636" } ``` --- ### `eth_accounts` > Returns a list of addresses owned by client. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * `` (string; data, 20 bytes): addresses owned by the client. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ### `eth_blockNumber` > Returns the number of most recent block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. #### Returns * `` (quantity): the current block number the client is on. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xbe7a89" } ``` --- ### `eth_getBalance` > Returns the balance of the account specified by address. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address to check for balance. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (quantity): the current balance in wei. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x3727cfCBD85390Bb11B3fF421878123AdB866be8", "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xdd73d065816b73312f0f8d" } ``` --- ### `eth_getStorageAt` > Returns the value from a storage position at an address specified. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (data): the value at this storage position. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x3727cfCBD85390Bb11B3fF421878123AdB866be8", "0x0", "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ### `eth_getTransactionCount` > Returns the number of transactions sent from an address. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (quantity): the number of transactions send from this address. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x3727cfCBD85390Bb11B3fF421878123AdB866be8", "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3e6" } ``` --- ### `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes; required): a block hash. #### Returns * `` (quantity): the number of transactions in this block. #### Request example: ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x4c17b19f8ecca584e687b95797ae36c509a953ac87acbd5db454eb78577852e3"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3" } ``` --- ### `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (quantity): the number of transactions in this block. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xa" } ``` --- ### `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. #### Returns * `` (quantity): the number of uncles in this block. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x4c17b19f8ecca584e687b95797ae36c509a953ac87acbd5db454eb78577852e3"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ### `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (quantity): the number of uncles in this block. #### Request example ```shell curl -X POST https://rpc.ankr.com/eth/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ### `eth_getCode` > Returns code at a given address. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (data): the code from the given address. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x3727cfCBD85390Bb11B3fF421878123AdB866be8", "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ### `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. #### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/flare/evm-methods-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ### `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. #### Returns * `` (hex encoded bytes): the return value of executed contract. #### Request example ```shell curl -X POST https://rpc.ankr.com/flare/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/flare/ title: Flare description: Flare is the blockchain for data. Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/flare/index.mdx --- # Flare
> Flare API is available on [Web3 API platform](https://www.ankr.com/rpc/flare). *Flare* is the blockchain for data. It is a layer 1, EVM smart contract platform designed to expand the utility of blockchain. Flare is an ecosystem made up of three core blockchains optimized for specific tasks within the network. The **Exchange Chain** (X-Chain), **Platform Chain** (P-Chain), and **Contract Chain** (C-Chain). We also support Standard EVM API for Flare. For Flare, we support the following APIs: * [Standard EVM API](/rpc-service/chains/chains-api/flare/#evm-methods) * [P-Chain API](/rpc-service/chains/chains-api/flare/#p-chain-methods) * [C-Chain API](/rpc-service/chains/chains-api/flare/#c-chain-methods) * [X-Chain API](/rpc-service/chains/chains-api/flare/#x-chain-methods) In order for your Web3 application to interact with the Flare blockchain — either by reading blockchain data or sending transactions to the network — it must connect to a Flare node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format. ## P-chain methods > Under construction ## C-Chain methods > Under construction ## X-Chain methods > Under construction ## Methods ### EVM methods - [`web3_clientVersion`](/rpc-service/chains/chains-api/flare/evm-methods/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/flare/evm-methods/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/flare/evm-methods/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/flare/evm-methods/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/flare/evm-methods/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/flare/evm-methods-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/flare/evm-methods-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/flare/evm-methods-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/flare/evm-methods-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/flare/evm-methods-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/flare/evm-methods-p3/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/flare/evm-methods-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/flare/evm-methods-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/flare/evm-methods-p3/#eth_getunclebyblocknumberandindex) ### EVM methods - [`eth_getLogs`](/rpc-service/chains/chains-api/flare/evm-methods-2/#eth_getlogs) - [`eth_getAssetBalance`](/rpc-service/chains/chains-api/flare/evm-methods-2/#eth_getassetbalance) - [`eth_baseFee`](/rpc-service/chains/chains-api/flare/evm-methods-2/#eth_basefee) - [`eth_maxPriorityFeePerGas`](/rpc-service/chains/chains-api/flare/evm-methods-2/#eth_maxpriorityfeepergas) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/fuel/ title: Fuel description: Fuel is an operating system specifically designed for Ethereum Rollups, providing the necessary tools and… 13 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/fuel/index.mdx --- # Fuel
> Fuel API is available on [Web3 API platform](https://www.ankr.com/rpc/fuel). Fuel is an operating system specifically designed for Ethereum Rollups, providing the necessary tools and infrastructure to maximize the efficiency of rollups while solving key challenges around scalability and performance. Fuel’s goal is to enhance the Ethereum ecosystem by optimizing for parallelization, state-minimized execution, and interoperability (PSI), without compromising on any of these aspects. * **FuelVM**: Optimized execution engine enabling parallel transaction execution and state minimization using a UTXO model, improving scalability and throughput. * **Sway Language**: A Rust + Solidity inspired language for smart contracts, offering safety, performance, and static auditing. * **Developer Experience**: Streamlined, boilerplate-free development for efficient contract creation and interaction with the FuelVM. * **Unmatched Throughput**: Leverages parallel processing for significantly higher transaction throughput compared to single-threaded blockchains. In order for your Web3 application to interact with Fuel — either by reading blockchain data or sending transactions to the network — it must connect to a Fuel node. Developers interact with the blockchain using the methods provided by the API. Responses come in [JSON format](https://www.json.org/json-en.html). ## Queries/Mutations supported * [getAddressAssetBalance](/rpc-service/chains/chains-api/fuel/methods/#getaddressassetbalance) — retrieves the balance of a specific asset of a given address. * [getAddressAssetBalances](/rpc-service/chains/chains-api/fuel/methods/#getaddressassetbalances) — retrieves balances of all assets of a given address. * [getTransactionsByOwner](/rpc-service/chains/chains-api/fuel/methods/#gettransactionsbyowner) — retrieves all transactions of a given address. * [getLatestTransactions](/rpc-service/chains/chains-api/fuel/methods/#getlatesttransactions) — retrieves the most recent transactions on the network. * [getContractAssetBalance](/rpc-service/chains/chains-api/fuel/methods/#getcontractassetbalance) — retrieves the balances of a specific asset of a given contract. * [getContractAssetBalances](/rpc-service/chains/chains-api/fuel/methods/#getcontractassetbalances) — retrieves all asset balances of a given contract. * [getLatestBlocks](/rpc-service/chains/chains-api/fuel/methods/#getlatestblocks) — retrieves several most recent blocks on the network. * [getLatestBlock](/rpc-service/chains/chains-api/fuel/methods-p2/#getlatestblock) — retrieves the most recent block on the network. * [getBlockByHeight](/rpc-service/chains/chains-api/fuel/methods-p2/#getblockbyheight) — retrieves info on a block specified by height. * [getBlockById](/rpc-service/chains/chains-api/fuel/methods-p2/#getblockbyid) — retrieves info on a block specified by ID. * [getMessagesByAddress](/rpc-service/chains/chains-api/fuel/#getaddressmessages) — retrieves all messages of a given address. * [dryRunTransaction](/rpc-service/chains/chains-api/fuel/methods-p2/#dryruntransaction) — simulates a transaction without broadcasting it. * [submitTransaction](/rpc-service/chains/chains-api/fuel/methods-p2/#submittransaction) — submits a transaction to the network. --- ## Methods ### Methods - [`getAddressAssetBalance`](/rpc-service/chains/chains-api/fuel/methods/#getaddressassetbalance) - [`getAddressAssetBalances`](/rpc-service/chains/chains-api/fuel/methods/#getaddressassetbalances) - [`getTransactionsByOwner`](/rpc-service/chains/chains-api/fuel/methods/#gettransactionsbyowner) - [`getLatestTransactions`](/rpc-service/chains/chains-api/fuel/methods/#getlatesttransactions) - [`getContractAssetBalance`](/rpc-service/chains/chains-api/fuel/methods/#getcontractassetbalance) - [`getContractAssetBalances`](/rpc-service/chains/chains-api/fuel/methods/#getcontractassetbalances) - [`getLatestBlocks`](/rpc-service/chains/chains-api/fuel/methods/#getlatestblocks) - [`getLatestBlock`](/rpc-service/chains/chains-api/fuel/methods-p2/#getlatestblock) - [`getBlockByHeight`](/rpc-service/chains/chains-api/fuel/methods-p2/#getblockbyheight) - [`getBlockById`](/rpc-service/chains/chains-api/fuel/methods-p2/#getblockbyid) - [`getMessagesByAddress`](/rpc-service/chains/chains-api/fuel/methods-p2/#getmessagesbyaddress) - [`dryRunTransaction`](/rpc-service/chains/chains-api/fuel/methods-p2/#dryruntransaction) - [`submitTransaction`](/rpc-service/chains/chains-api/fuel/methods-p2/#submittransaction) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/fuel/methods-p2/ title: Fuel — Methods (2/2) source: docs/rpc-service/chains/chains-api/fuel/methods-p2.mdx --- # Fuel — Methods (2/2) > API reference for [Fuel](/rpc-service/chains/chains-api/fuel/). [All methods ->](/rpc-service/chains/chains-api/fuel/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/fuel/methods/) · 2 ## `getLatestBlock` > Retrieves the most recent block on the network. ### Parameters None. ### Returns * `data` (object): the data object with the following fields: * `chain` (object): the object representing the blockchain network info: * `latestBlock` (object): the object containing details of the latest block on the network. * `id` (string): the unique identifier (hash) of the latest block. * `height` (string): the block height of the latest block. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "{ chain { latestBlock { id height } } }" }' ``` #### Response example ```json { "data": { "chain": { "latestBlock": { "id": "0x1cd6d6725bb58123623e8a60de42f269252dbf0df8922e27e45b9e894bffeea7", "height": "13781885" } } } } ``` --- ## `getBlockByHeight` > Retrieves info on a block specified by height. ### Parameters * `height` (string; required): the height of the block. ### Returns * `data` (object): the data object with the following fields: * `block` (object): the object with the queried block info. * `id` (string): the unique identifier (hash) of the block. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "query Block($height: U64) { block(height: $height) { id } }", "variables": { "height": "3000" } }' ``` ### Response example ```json { "data": { "block": { "id": "0xe4f573c8ba98085d8006d64176587720f166e761558a6f13fb40ad884d5db52c" } } } ``` --- ## `getBlockById` > Retrieves info on a block specified by ID. ### Parameters * `id` (string; required): a unique hash identifier for a block. ### Returns * `data` (object): the data object with the following fields: * `block` (object): the object representing a specific block info. * `id` (string): the unique identifier (hash) of the block. * `height` (string): the height of the block. * `transactions` (array): an array of transactions included in the block. * `id` (string): the unique identifier (hash) of each transaction in the block. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "query BlockById($id: BlockId!) { block(id: $id) { id height transactions { id } } }", "variables": { "id": "0xe4f573c8ba98085d8006d64176587720f166e761558a6f13fb40ad884d5db52c" } }' ``` ### Response example ```json { "data": { "block": { "id": "0xe4f573c8ba98085d8006d64176587720f166e761558a6f13fb40ad884d5db52c", "height": "3000", "transactions": [ { "id": "0x9dd04fce60b052963d8131c3e956a80e9a413363bae4f06a0ed0eeb575e24e0d" } ] } } } ``` --- ## `getMessagesByAddress` > Retrieves all messages of a given address. ### Parameters * `address` (string; required): the address to fetch the messages for. ### Returns * `data` (object): the data object with the following fields: * `blocks` (object): the object representing the queried block info. * `amount` (string): the amount of the message. * `sender` (string): the address of the message sender. * `recipient` (string): the address of the message destination. * `nonce` (string): a unique identifier associated with the message. * `data` (string): an optional additional data included in the message. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "query MessageInfo($address: Address) { messages(owner: $address, first: 5) { nodes { amount sender recipient nonce data daHeight } } }", "variables": { "address": "0xce9f8d9367fc4671c0ececce7ab603f6f75d1e66082a82ad12ecdc219b308820" } }' ``` ### Response example ```json { "data": { "messages": { "nodes": [] } } } ``` --- ## `dryRunTransaction` > Simulates a transaction without broadcasting it. ### Parameters * `encodedTransaction` (string: required): the hex-encoded transaction. * `utxoValidation` (boolean; required): a UTXO validation selector. ### Returns * `data` (object): the data object with the following fields: * `dryRun` (array): an array representing the simulated transaction result. * `receiptType` (string): the type of receipt generated by the simulation. * `data` (string): the hexadecimal data associated with the transaction outcome. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "mutation DryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) { dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) { receiptType data } }", "variables": { "encodedTransaction": "YOUR_ENCODED_TRANSACTION_HERE", "utxoValidation": true } }' ``` --- ## `submitTransaction` > Submits a transaction to the network. ### Parameters * `encodedTransaction` (string: required): the hex-encoded transaction. ### Returns * `data` (object): the data object with the following fields: * `submit` (object): result of the submit mutation: * `id` (string): the unique transaction ID generated upon transaction submission. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "mutation submit($encodedTransaction: HexString!) { submit(tx: $encodedTransaction) { id } }", "variables": { "encodedTransaction": "YOUR_ENCODED_TRANSACTION_HERE" } }' ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/fuel/methods/ title: Fuel — Methods (1/2) source: docs/rpc-service/chains/chains-api/fuel/methods.mdx --- # Fuel — Methods (1/2) > API reference for [Fuel](/rpc-service/chains/chains-api/fuel/). [All methods ->](/rpc-service/chains/chains-api/fuel/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/fuel/methods-p2/) ## `getAddressAssetBalance` > Retrieves the balance of a specific asset of a given address. ### Parameters * `address` (string; required): an address of an externally owned account identified by a 32 byte string prefixed by `0x`. * `assetId` (string; required): a 32 byte unique ID used to identify a coin. ### Returns * `data` (object): contains the query result. * `balance` (object): represents the balance for the specified address and asset. * `owner` (string): the address that owns the balance returned. * `amount` (string): the amount of the asset held by the address. * `assetId` (string): the asset ID for the queried asset. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "query Balance($address: Address, $assetId: AssetId) { balance(owner: $address, assetId: $assetId) { owner amount assetId } }", "variables": { "address": "0xce9f8d9367fc4671c0ececce7ab603f6f75d1e66082a82ad12ecdc219b308820", "assetId": "0x2a0d0ed9d2217ec7f32dcd9a1902ce2a66d68437aeff84e3a3cc8bebee0d2eea" } }' ``` ### Response example ```json { "data": { "balance": { "owner": "0xce9f8d9367fc4671c0ececce7ab603f6f75d1e66082a82ad12ecdc219b308820", "amount": "0", "assetId": "0x2a0d0ed9d2217ec7f32dcd9a1902ce2a66d68437aeff84e3a3cc8bebee0d2eea" } } } ``` --- ## `getAddressAssetBalances` > Retrieves the balances of all assets of a given address. ### Parameters * `filter` (object; required): the filter object to query balances. * `owner` (string; required): an address of an externally owned account identified by a 32 byte string prefixed by `0x`. ### Returns * `data` (object): contains the query result. * `balance` (object): represents the balance details of the provided address based on the filter applied * `nodes` (array): an array of balance entries (up to 5 in this case, based on first: 5). Each object contains information about a balance for a specific asset. * `amount` (string): the amount of the asset associated with the address. * `assetId` (string): the asset ID for the specific asset the balance is associated with. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "query Balances($filter: BalanceFilterInput) { balances(filter: $filter, first: 5) { nodes { amount assetId } } }", "variables": { "filter": { "owner": "0xce9f8d9367fc4671c0ececce7ab603f6f75d1e66082a82ad12ecdc219b308820" } } }' ``` ### Response example ```json { "data": { "balances": { "nodes": [ { "amount": "1000000000000000000", "assetId": "0xAssetIdHere" }, { "amount": "2000000000000000000", "assetId": "0xAnotherAssetIdHere" } ] } } } ``` --- ## `getTransactionsByOwner` > Retrieves all transactions sent from a given address. ### Parameters * `address` (string; required): the address to fetch the transactions for. ### Returns * `data` (object): contains the query result. * `transactionsByOwner` (object): contains the transactions related to the provided address. It is an object with the following properties: * `nodes` (array): an array of transactions, with each transaction containing information about inputs, outputs, and status. * `id` (string): the transaction identifier. * `inputs` (array): a list of inputs to the transaction: * `__typename` (string): a specific type of input in the transaction. * `owner` (string): the owner of the coin input (address). * `utxoId` (string): the ID of the unspent transaction output (UTXO). * `amount` (string): the amount of the asset involved in the transaction. * `assetId` (string): the unique identifier of the asset involved in the transaction. * `outputs` (array): an array of outputs, representing the transaction destination. * `__typename` (string): a specific type of output in the transaction. * `to` (string): the transaction destination address. * `amount` (string): the amount of the asset involved in the transaction. * `assetId` (string): the unique identifier of the asset involved in the transaction. * `status` (object): the transaction status. * `__typename` (string): the status name. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "query Transactions($address: Address) { transactionsByOwner(owner: $address, first: 5) { nodes { id inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } status { __typename ... on FailureStatus { reason programState { returnType } } } } } }", "variables": { "address": "0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871" } }' ``` ### Response example ```json { "data": { "transactionsByOwner": { "nodes": [ { "id": "0x670dde2a38d1bcd055aff7dfde5ed4c8f7532002dd0a9740f1b8732981c575be", "inputs": [ { "__typename": "InputCoin", "owner": "0x33d25d8d874c0eb5933f9ca505a172725aa19c65bd707ce7c1e7917b483bda16", "utxoId": "0x00c38d75412b7835947c8fde5f6d1f892488687c5a030bafe058b97a253766c60000", "amount": "2000000", "assetId": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" } ], "outputs": [ { "__typename": "CoinOutput", "to": "0xf65d6448a273b531ee942c133bb91a6f904c7d7f3104cdaf6b9f7f50d3518871", "amount": "160000", "assetId": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" }, { "__typename": "ChangeOutput", "to": "0x33d25d8d874c0eb5933f9ca505a172725aa19c65bd707ce7c1e7917b483bda16", "amount": "1715889", "assetId": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" } ], "status": { "__typename": "SuccessStatus" } } ] } } } ``` --- ## `getLatestTransactions` > Retrieves the most recent transactions on the network. ### Parameters None. ### Returns * `data` (object): contains the query result. * `transactions` (object): the transaction object with the following properties: * `nodes` (array): an array of transactions, with each transaction containing information about inputs, outputs, and status. * `id` (string): the transaction identifier. * `inputs` (array): a list of inputs to the transaction: * `__typename` (string): a specific type of input in the transaction. * `owner` (string): the owner of the coin input (address). * `utxoId` (string): the ID of the unspent transaction output (UTXO). * `amount` (string): the amount of the asset involved in the transaction. * `assetId` (string): the unique identifier of the asset involved in the transaction. * `outputs` (array): an array of outputs, representing the transaction destination. * `__typename` (string): a specific type of output in the transaction. * `to` (string): the transaction destination address. * `amount` (string): the amount of the asset involved in the transaction. * `assetId` (string): the unique identifier of the asset involved in the transaction. * `status` (object): the transaction status. * `__typename` (string): the status name. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "query LatestTransactions { transactions(last: 5) { nodes { id inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } status { __typename ... on FailureStatus { reason programState { returnType } } } } } }" }' ``` ### Response example ```json { "data": { "transactions": { "nodes": [ { "id": "0x330d0c4fb7d1c8dda917906ff2c87097b92bdf3be67b1c2fb03a4ad1fe0cd9a0", "inputs": null, "outputs": [], "status": { "__typename": "SuccessStatus" } }, { "id": "0x4ece83232f7b818e484546414cf6d8ffe98a61691602f4a34e9ed8b9bcf2b1d2", "inputs": [ { "__typename": "InputContract", "utxoId": "0x8cbd7f0a0e01cd848ef95b1702c70e07bc509d7461375be959358a9ea9cb4e280000", "contractId": "0x2e40f2b244b98ed6b8204b3de0156c6961f98525c8162f80162fcf53eebd90e7" }, { "__typename": "InputCoin", "owner": "0x4526bf524620d52a5f2046ca4835f84bcc81a8359172dbd13995367d61adb08b", "utxoId": "0x76766650603cb2146f48a7ee6a42215b91b0e48df2565e7598e42826e5b915b70001", "amount": "296940893153", "assetId": "0x1d5d97005e41cae2187a895fd8eab0506111e0e2f3331cd3912c15c24e3c1d82" } ], "outputs": [ { "__typename": "ContractOutput", "inputIndex": "0", "balanceRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" }, { "__typename": "VariableOutput", "to": "0x4526bf524620d52a5f2046ca4835f84bcc81a8359172dbd13995367d61adb08b", "amount": "10906889", "assetId": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" } ], "status": { "__typename": "SuccessStatus" } } ] } } } ``` --- ## `getContractAssetBalance` > Retrieves the balances of a specific asset of a given contract. ### Parameters * `contract` (string; required): the contract address to fetch the balance for. * `asset` (string: required): the unique identifier of an asset to fetch the balance for. ### Returns * `data` (object): the data object with the following fields: * `contractBalance` (object): the object containing details on the contract's balance for a specific asset: * `contract` (string): the ID of the contract. * `amount` (string): the balance amount of the asset in the contract. * `assetId` (string): the unique identifier of the asset associated with the contract. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "query ContractBalance($contract: ContractId, $asset: AssetId) { contractBalance(contract: $contract, asset: $asset) { contract amount assetId } }", "variables": { "contract": "0x7777777777777777777777777777777777777777777777777777777777777777", "asset": "0x2a0d0ed9d2217ec7f32dcd9a1902ce2a66d68437aeff84e3a3cc8bebee0d2eea" } }' ``` ### Response example ```json { "data": { "contractBalance": { "contract": "0x7777777777777777777777777777777777777777777777777777777777777777", "amount": "0", "assetId": "0x2a0d0ed9d2217ec7f32dcd9a1902ce2a66d68437aeff84e3a3cc8bebee0d2eea" } } } ``` --- ## `getContractAssetBalances` > Retrieves all asset balances of a given contract. ### Parameters * `filter` (object; required): the filter object used to query balances. * `contract` (string; required): the contract address for which the asset balances is to be fetched. ### Returns * `data` (object): the data object which contains the following fields: * `contractBalances` (object): the object containing details on the contract's balance for a specific asset. * `nodes` (array): an array of balance records for different assets. * `amount` (string): the balance amount of the specified asset in the contract. * `assetId` (string): the unique identifier of the asset associated with the balance. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "query ContractBalances($filter: ContractBalanceFilterInput!) { contractBalances(filter: $filter, first: 5) { nodes { amount assetId } } }", "variables": { "filter": { "contract": "0xf5b08689ada97df7fd2fbd67bee7dea6d219f117c1dc9345245da16fe4e99111" } } }' ``` ### Response example ```json { "data": { "contractBalances": { "nodes": [ { "amount": "0", "assetId": "0x0000000000000000000000000000000000000000000000000000000000000000" }, { "amount": "7661229750000", "assetId": "0x2a0d0ed9d2217ec7f32dcd9a1902ce2a66d68437aeff84e3a3cc8bebee0d2eea" }, { "amount": "0", "assetId": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" } ] } } } ``` --- ## `getLatestBlocks` > Retrieves several most recent blocks on the network. ### Parameters None. ### Returns * `data` (object): the data object with the following fields: * `blocks` (object): the blocks object with the following fields: * `nodes` (array): an array with individual block records. * `id` (string): the unique identifier of a block. * `transactions` (array): an array representing the transactions within the block. * `id` (string): the unique identifier of a transaction. * `inputAssetIds` (array): an array of asset IDs used as inputs in the transaction. * `inputs` (array): an array of the inputs used in the transaction. * `__typename` (string): the specific type of input in the transaction. * `owner` (string): the address that owned the input in the transaction. * `utxoId` (string): the unique identifier for the unspent transaction output (UTXO) related to the input. * `amount` (string): the amount of the asset in the transaction. * `assetId` (string): the unique identifier of the asset in the transaction. * `outputs` (array): an array of outputs, representing where the transaction destination. * `__typename` (string): the specific type of output in the transaction. * `inputIndex` (string): the index of the input that this contract output is associated with. * `balanceRoot` (string): the root hash representing the contracts balance state. * `stateRoot` (string): the root hash representing the contracts overall state. * `to` (string): the destination address of the transaction. * `amount` (string): the amount of the asset in the transaction. * `assetId` (string): the unique identifier of the asset in the transaction. ### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "query LatestBlocks { blocks(last: 5) { nodes { id transactions { id inputAssetIds inputs { __typename ... on InputCoin { owner utxoId amount assetId } ... on InputContract { utxoId contractId } ... on InputMessage { sender recipient amount data } } outputs { __typename ... on CoinOutput { to amount assetId } ... on ContractOutput { inputIndex balanceRoot stateRoot } ... on ChangeOutput { to amount assetId } ... on VariableOutput { to amount assetId } ... on ContractCreated { contract stateRoot } } } } } }" }' ``` ### Response example ```json { "data": { "blocks": { "nodes": [ { "id": "0xfc309ad1b32896287ffb19de63d49242d9f7eb7f067b9397d2e9cda134241bfc", "transactions": [ { "id": "0x5749b555b9e4c89e453d08395e0b291df8b4a1b8235ca5440cd3701f6c11aa22", "inputAssetIds": null, "inputs": null, "outputs": [] } ] }, { "id": "0x52a868e1b13afecf51ef2161663011c9f3865381316fc568aaa209ff41ee35aa", "transactions": [ { "id": "0x1078a8d9fc64a08a75ee2a20329bf98ad2cdafa340726e5184424709a6c25841", "inputAssetIds": null, "inputs": null, "outputs": [] } ] } ] } } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/ title: Gnosis Beacon — Beacon (2/3) source: docs/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2.mdx --- # Gnosis Beacon — Beacon (2/3) > API reference for [Gnosis Beacon](/rpc-service/chains/chains-api/gnosis-beacon/). [All methods ->](/rpc-service/chains/chains-api/gnosis-beacon/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/gnosis-beacon/beacon/) · 2 · [3](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/) ## Beacon ### `POST /eth/v1/beacon/blinded_blocks` > Publishes a signed block. Instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct and publish a `SignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`. The beacon node should broadcast a newly constructed `SignedBeaconBlock` to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed `BeaconBlock`, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202). Pre-Bellatrix, this endpoint will accept a `SignedBeaconBlock`. #### Parameters * `Eth-Consensus-Version` (header): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`. * `` (required): the `SignedBlindedBeaconBlock` object composed of `BlindedBeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0x81cdF3DbaE67fBbE10CAc8Bcd8B28d4DDDc65D9a74f3921693676fccF8BeCe9B", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blinded_blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. * `Code 202`: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database. * `Code 400`: The `SignedBlindedBeaconBlock` object is invalid. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v2/beacon/blocks/{block_id}` > Retrieves a block. Retrieves block details for given block id. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ. #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v2/beacon/blocks/{block_id}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Note: The `Eth-Consensus-Version` header is required in response so client can deserialize returned json or ssz data more effectively. ```json { "version": "phase0", "execution_optimistic": false, "data": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xdcbCcb77eD0d3ecDee90fc6efC1402cDc68CD4203d0FCeC25b07CCa5a8C34A2d", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ``` * `Code 400`: The block ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid block ID: current" } ``` * `Code 404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/blocks/{block_id}/root` > Retrieves a block root. Retrieves hashTreeRoot of BeaconBlock/BeaconBlockHeader #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blocks/{block_id}/root" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "execution_optimistic": false, "data": { "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } ``` * `Code 400`: The block ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid block ID: current" } ``` * `Code 404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/ title: Gnosis Beacon — Beacon (3/3) source: docs/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3.mdx --- # Gnosis Beacon — Beacon (3/3) > API reference for [Gnosis Beacon](/rpc-service/chains/chains-api/gnosis-beacon/). [All methods ->](/rpc-service/chains/chains-api/gnosis-beacon/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/gnosis-beacon/beacon/) · [2](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/) · 3 ## Beacon ### `GET /eth/v1/beacon/blocks/{block_id}/attestations` > Retrieves block attestations. Retrieves attestation included in requested block. #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blocks/{block_id}/attestations" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "execution_optimistic": false, "data": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ] } ``` * `Code 400`: The block ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid block ID: current" } ``` * `Code 404`: Block not found. ```json { "code": 404, "message": "Block not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/pool/attestations` > Retrieves attestations from the operations pool. Retrieves attestations known by the node but not necessarily incorporated into any block. #### Parameters * `slot` (string; query): a slot. * `committee_index` (string; query): a committee index. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attestations" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ] } ``` * `Code 400`: The slot or committee index could not be parsed. ```json { "code": 400, "message": "Invalid slot: current" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/attestations` > Submits attestation objects to the node. Submits Attestation objects to the node. Each attestation in the request body is processed individually. If an attestation is validated successfully the node MUST publish that attestation on the appropriate subnet. If one or more attestations fail validation the node MUST return a 400 error with details of which attestations have failed, and why. #### Parameters * `` (required): ```json [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attestations" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Attestations are stored in pool and broadcast on appropriate subnet. * `Code 400`: Errors with one or more attestations. ```json { "code": 400, "message": "some failures", "failures": [ { "index": 3, "message": "invalid signature" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/pool/attester_slashings` > Retrieves attester slashings from the operations pool. Retrieves attester slashings known by the node but not necessarily incorporated into any block. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attester_slashings" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/attester_slashings` > Submits the AttesterSlashing object to the node's pool. Submits AttesterSlashing object to node's pool and if passes validation node MUST broadcast it to network. #### Parameters * `` (required): ```json { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attester_slashings" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid attester slashing. ```json { "code": 400, "message": "Invalid attester slashing, it will never pass validation so it's rejected" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/pool/proposer_slashings` > Retrieves proposer slashings from the operations pool. Retrieves proposer slashings known by the node but not necessarily incorporated into any block #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/proposer_slashings" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/proposer_slashings` > Submits the ProposerSlashing object to the node's pool. Submits ProposerSlashing object to node's pool and if passes validation node MUST broadcast it to network. #### Parameters * `` (required): ```json { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/proposer_slashings" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid proposer slashing. ```json { "code": 400, "message": "Invalid proposer slashing, it will never pass validation so it's rejected" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/sync_committees` > Submits sync committee signatures to the node. Submits sync committee signature objects to the node. Sync committee signatures are not present in phase0, but are required for Altair networks. If a sync committee signature is validated successfully the node MUST publish that sync committee signature on all applicable subnets. If one or more sync committee signatures fail validation the node MUST return a 400 error with details of which sync committee signatures have failed, and why. #### Parameters * `` (required): ```json [ { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "validator_index": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/sync_committees" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Sync committee signatures are stored in pool and broadcast on appropriate subnet. * `Code 400`: Errors with one or more sync committee signatures. ```json { "code": 400, "message": "some failures", "failures": [ { "index": 3, "message": "invalid signature" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/beacon/pool/voluntary_exits` > Retrieves SignedVoluntaryExit from the operations pool. Retrieves voluntary exits known by the node but not necessarily incorporated into any block. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/voluntary_exits" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/voluntary_exits` > Submits the SignedVoluntaryExit object to the node's pool. Submits SignedVoluntaryExit object to node's pool and if passes validation node MUST broadcast it to network. #### Parameters * `` (required): ```json { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/voluntary_exits" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Voluntary exit is stored in node and broadcasted to network. * `Code 400`: Invalid voluntary exit. ```json { "code": 400, "message": "Invalid voluntary exit, it will never pass validation so it's rejected" } ``` * Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/beacon/ title: Gnosis Beacon — Beacon (1/3) source: docs/rpc-service/chains/chains-api/gnosis-beacon/beacon.mdx --- # Gnosis Beacon — Beacon (1/3) > API reference for [Gnosis Beacon](/rpc-service/chains/chains-api/gnosis-beacon/). [All methods ->](/rpc-service/chains/chains-api/gnosis-beacon/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/) · [3](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/) ## Beacon ### `GET /eth/v1/beacon/genesis` > Retrieves the details of the chain's genesis. Returns the details of the chain's genesis which can be used to identify chain. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/genesis" \ -H "Accept: application/json" ``` #### Response example ```json { "data": { "genesis_time": "1606824023", "genesis_validators_root": "0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95", "genesis_fork_version": "0x00000000" } } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/root` > Retrieves the state SSZ HashTreeRoot. Calculates HashTreeRoot for state with given 'stateId'. If stateId is root, same value will be returned. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/state/{state_id}/root" \ -H "Accept: application/json" ``` #### Request example ```json { "execution_optimistic": false, "data": { "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/fork` > Retrieves the Fork object for a requested state. Retrieves the [Fork](https://github.com/ethereum/consensus-specs/blob/v0.11.1/specs/phase0/beacon-chain.md#fork) object for state with given 'stateId'. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/state/{state_id}/fork" \ -H "Accept: application/json" ``` #### Response example ```json { "execution_optimistic": false, "data": { "previous_version": "0x00000000", "current_version": "0x00000000", "epoch": "1" } } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/finality_checkpoints` > Retrieves state finality checkpoints. Returns finality checkpoints for state with given 'stateId'. In case finality is not yet achieved, checkpoint should return epoch 0 and ZERO_HASH as root. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/finality_checkpoints" \ -H "Accept: application/json" ``` #### Response example ```json { "execution_optimistic": false, "data": { "previous_justified": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "current_justified": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "finalized": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/validators` > Retrieves validators from state. Returns filterable list of validators with their balance, status, and index. Information will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no information will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; both the index and public key are returned for each validator, and can be used to confirm for which inputs a response has been returned. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. * `id` (array[string]; query): either a hex encoded public key (any bytes48 with 0x prefix) or validator index. * `status` (array; query): a [validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ); Available values : `pending_initialized`, `pending_queued`, `active_ongoing`, `active_exiting`, `active_slashed`, `exited_unslashed`, `exited_slashed`, `withdrawal_possible`, `withdrawal_done`, `active`, `pending`, `exited`, `withdrawal` #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validators" \ -H "Accept: application/json" ``` #### Response example ```json { "execution_optimistic": false, "data": [ { "index": "1", "balance": "1", "status": "active_ongoing", "validator": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "effective_balance": "1", "slashed": false, "activation_eligibility_epoch": "1", "activation_epoch": "1", "exit_epoch": "1", "withdrawable_epoch": "1" } } ] } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}` > Retrieves the validator from state by ID. Returns validator specified by state and id or public key along with status and balance. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. * `validator_id` (string; path; required): either a hex encoded public key (any bytes48 with 0x prefix) or validator index. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validators/{validator_id}" \ -H "Accept: application/json" ``` #### Response example ```json { "execution_optimistic": false, "data": { "index": "1", "balance": "1", "status": "active_ongoing", "validator": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "effective_balance": "1", "slashed": false, "activation_eligibility_epoch": "1", "activation_epoch": "1", "exit_epoch": "1", "withdrawable_epoch": "1" } } } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/validator_balances` > Retrieves validator balances from state. Returns filterable list of validators balances. Balances will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no balance will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; the index and is returned for each balance, and can be used to confirm for which inputs a response has been returned. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. * `id` (array[string]; query): either a hex encoded public key (any bytes48 with 0x prefix) or validator index. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validator_balances" \ -H "Accept: application/json" ``` #### Response example ```json { "execution_optimistic": false, "data": [ { "index": "1", "balance": "1" } ] } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/committees` > Retrieves all committees for a state. Retrieves the committees for the given state. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. * `epoch` (string; query): fetches committees for the given epoch; if not present then the committees for the epoch of the state will be obtained. * `index` (string; query): restricts returned values to those matching the supplied committee index. * `slot` (string; query): restricts returned values to those matching the supplied slot. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/committees" \ -H "Accept: application/json" ``` #### Response example ```json { "execution_optimistic": false, "data": [ { "index": "1", "slot": "1", "validators": [ "1" ] } ] } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/sync_committees` > Retrieves sync committees for a state. Retrieves the sync committees for the given state. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. * `epoch` (string; query): fetches sync committees for the given epoch; if not present then the sync committees for the epoch of the state will be obtained. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/sync_committees" \ -H "Accept: application/json" ``` #### Response example ```json { "execution_optimistic": false, "data": { "validators": [ "1" ], "validator_aggregates": [ [ "1" ] ] } } ``` --- ### `GET /eth/v1/beacon/headers` > Retrieves block headers. Retrieves block headers matching given query. By default, it will fetch current head slot blocks. #### Parameters * `slot` (string; query): a slot. * `parent_root` (string; query): a parent root. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/headers" \ -H "Accept: application/json" ``` #### Response example ```json { "execution_optimistic": false, "data": [ { "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "canonical": true, "header": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ] } ``` --- ### `GET /eth/v1/beacon/headers/{block_id}` > Retrieves a block header. Retrieves a block header for a given block ID. #### Parameters * `block_id` (string; path; required): a block identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, ``, ``.
Example : head #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/headers/{block_id}" \ -H "Accept: application/json" ``` ### Response example ```json { "execution_optimistic": false, "data": { "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "canonical": true, "header": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } } ``` --- ### `POST /eth/v1/beacon/blocks` > Publishes a signed block. Instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed BeaconBlock, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202). #### Parameters * `Eth-Consensus-Version` (header): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`. * `` (required): the `SignedBeaconBlock` object composed of the `BeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xdEFeAFdc312b725d00Dd16b4A627fCBfa6B8aAF1d8AF7bCfd82bbFca700A0645", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. * `Code 202`: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database. * `Code 400`: The `SignedBeaconBlock` object is invalid. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/config-p2/ title: Gnosis Beacon — Config, Debug, Events, Node, Validator (2/3) source: docs/rpc-service/chains/chains-api/gnosis-beacon/config-p2.mdx --- # Gnosis Beacon — Config, Debug, Events, Node, Validator (2/3) > API reference for [Gnosis Beacon](/rpc-service/chains/chains-api/gnosis-beacon/). [All methods ->](/rpc-service/chains/chains-api/gnosis-beacon/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/gnosis-beacon/config/) · 2 · [3](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/) ## Validator ### `POST /eth/v1/validator/duties/sync/{epoch}` > Retrieves sync committee duties. Requests the beacon node to provide a set of sync committee duties for a particular epoch. #### Parameters * `epoch` (string; path; required): `epoch` // `EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch` // `EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1` * `` (required): an array of the validator indices for which to obtain the duties: ```json [ "1" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/sync/{epoch}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. ```json { "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "validator_sync_committee_indices": [ "1" ] } ] } ``` * `Code 400`: Invalid epoch or index. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/blocks/{slot}` > Produces a new block, without signature. Requests a beacon node to produce a valid block, which can then be signed by a validator. Metadata in the response indicates the type of block produced, and the supported types of block will be added to as forks progress. #### Parameters * `slot` (string; path; required): the slot for which the block should be proposed. * `randao_reveal` (string; hex; query; required): the validator's randao reveal value. * `graffiti` (string; hex; query): an arbitrary data validator to include in the block. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/blocks/{slot}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Note: The `Eth-Consensus-Version` header is required in response so client can deserialize returned json or ssz data more effectively. ```json { "version": "phase0", "data": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xbF0eF8805DE094355C99fD34Df183ADB5BB153f5dac2eD83bee6eEd2dEf05cFC", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } } } ``` * `Code 400`: Invalid block production request. ```json { "code": 400, "message": "Invalid request to produce a block" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/blinded_blocks/{slot}` > Produces a new blinded block, without signature. Requests a beacon node to produce a valid blinded block, which can then be signed by a validator. A blinded block is a block with only a transactions root, rather than a full transactions list. Metadata in the response indicates the type of block produced, and the supported types of block will be added to as forks progress. Pre-Bellatrix, this endpoint will return a `BeaconBlock`. #### Parameters * `slot` (string; path; required): the slot for which the block should be proposed. * `randao_reveal` (string; hex; query; required): the validator's randao reveal value. * `graffiti` (string; hex; query): an arbitrary data validator to include in the block. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/blinded_blocks/{slot}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "version": "bellatrix", "data": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0x2F86DB21b8b1C3465689AaeBB3cE1A4F7C79F09F0dA82444eec71f1cCbBC7fb3", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } } } ``` * `Code 400`: Invalid block production request. ```json { "code": 400, "message": "Invalid request to produce a block" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/attestation_data` > Produces attestation data. Requests that the beacon node to produce an AttestationData. #### Parameters * `slot` (string; query; required): the slot for which an attestation data should be created. * `committee_index` (string; query; required): the committee index for which an attestation data should be created. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/attestation_data" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/config-p3/ title: Gnosis Beacon — Config, Debug, Events, Node, Validator (3/3) source: docs/rpc-service/chains/chains-api/gnosis-beacon/config-p3.mdx --- # Gnosis Beacon — Config, Debug, Events, Node, Validator (3/3) > API reference for [Gnosis Beacon](/rpc-service/chains/chains-api/gnosis-beacon/). [All methods ->](/rpc-service/chains/chains-api/gnosis-beacon/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/gnosis-beacon/config/) · [2](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/) · 3 ## Validator ### `GET /eth/v1/validator/aggregate_attestation` > Retrieves aggregated attestation. Aggregates all attestations matching given attestation data root and slot. #### Parameters * `attestation_data_root` (string; query; required): HashTreeRoot of AttestationData that validator wants aggregated. * `slot` (string; query; required): a slot. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_attestation" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Returns aggregated `Attestation` object with same `AttestationData` root. ```json { "data": { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 404`: Not found. ```json { "code": 404, "message": "Requested item not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/aggregate_and_proofs` > Publishes multiple aggregate and proofs. Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic. #### Parameters * `` (required): ```json [ { "message": { "aggregator_index": "1", "aggregate": { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_and_proofs" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/beacon_committee_subscriptions` > Signals the Beacon node to prepare for a committee subnet. After beacon node receives this request, search using discv5 for peers related to this subnet and replace current peers with those ones if necessary. If validator `is_aggregator`, beacon node must: * Announce subnet topic subscription on gossipsub. * Aggregate attestations received on that subnet. #### Parameters * ``: ```json [ { "validator_index": "1", "committee_index": "1", "committees_at_slot": "1", "slot": "1", "is_aggregator": true } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/beacon_committee_subscriptions" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. Slot signature is valid and beacon node has prepared the attestation subnet. Note that we cannot be certain the Beacon node will find peers for that subnet for various reasons. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/sync_committee_subscriptions` > Subscribes to sync committee subnets. Subscribe to a number of sync committee subnets. Sync committees are not present in phase0, but are required for Altair networks. Subscribing to sync committee subnets is an action performed by VC to enable network participation in Altair networks, and only required if the VC has an active validator in an active sync committee. #### Parameters * ``: ```json [ { "validator_index": "1", "sync_committee_indices": [ "1" ], "until_epoch": "1" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_subscriptions" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/validator/sync_committee_contribution` > Produces a sync committee contribution. Requests that the beacon node to produce a sync committee contribution. #### Parameters * `slot` (string; query; required): the slot for which a sync committee contribution should be created. * `subcommittee_index` (string; query; required): the subcommittee index for which to produce the contribution. * `beacon_block_root` (string; query; required): the block root for which to produce the contribution. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_contribution" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "subcommittee_index": "1", "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 404`: Not found. ```json { "code": 404, "message": "Requested item not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/config/ title: Gnosis Beacon — Config, Debug, Events, Node, Validator (1/3) source: docs/rpc-service/chains/chains-api/gnosis-beacon/config.mdx --- # Gnosis Beacon — Config, Debug, Events, Node, Validator (1/3) > API reference for [Gnosis Beacon](/rpc-service/chains/chains-api/gnosis-beacon/). [All methods ->](/rpc-service/chains/chains-api/gnosis-beacon/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/) · [3](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/) ## Config ### `GET /eth/v1/config/fork_schedule` > Retrieves scheduled upcoming forks. Retrieve all forks, past present and future, of which this node is aware. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/config/fork_schedule" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "previous_version": "0x00000000", "current_version": "0x00000000", "epoch": "1" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/config/spec` > Retrieves spec parameters. Retrieve specification configuration used on this node. The configuration should include: * Constants for all hard forks known by the beacon node, for example the [phase 0](https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#constants) and [altair](https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/beacon-chain.md#constants) values. * Presets for all hard forks supplied to the beacon node, for example the [phase 0](https://github.com/ethereum/consensus-specs/blob/dev/presets/mainnet/phase0.yaml) and [altair](https://github.com/ethereum/consensus-specs/blob/dev/presets/mainnet/altair.yaml) values. * Configuration for the beacon node, for example the [mainnet](https://github.com/ethereum/consensus-specs/blob/dev/configs/mainnet.yaml) values. Values are returned with the following format: * Any value starting with 0x in the spec is returned as a hex string. * Numeric values are returned as a quoted integer. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/config/spec" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "DEPOSIT_CONTRACT_ADDRESS": "0x00000000219ab540356cBB839Cbe05303d7705Fa", "DEPOSIT_NETWORK_ID": "1", "DOMAIN_AGGREGATE_AND_PROOF": "0x06000000", "INACTIVITY_PENALTY_QUOTIENT": "67108864", "INACTIVITY_PENALTY_QUOTIENT_ALTAIR": "50331648" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/config/deposit_contract` > Retrieves a deposit contract address. Retrieve Eth1 deposit contract address and chain ID. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/config/deposit_contract" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "chain_id": "1", "address": "0x1Db3439a222C519ab44bb1144fC28167b4Fa6EE6" } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ## Debug ### `GET /eth/v2/debug/beacon/states/{state_id}` > Retrieves the full BeaconState object. Returns full BeaconState object for given stateId. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v2/debug/beacon/states/{state_id}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Note: The `Eth-Consensus-Version` header is required in response so client can deserialize returned json or ssz data more effectively. ```json { "version": "phase0", "execution_optimistic": false, "data": { "genesis_time": "1", "genesis_validators_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "slot": "1", "fork": { "previous_version": "0x00000000", "current_version": "0x00000000", "epoch": "1" }, "latest_block_header": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "block_roots": [], "slashings": [], "previous_epoch_attestations": [ { "aggregation_bits": "0x2ccfbd524ECbedfc70c91BE08b5668fA4ebdfD773B1fFe1daAbfC912c3cD4b2C93E1", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } }, "inclusion_delay": "1", "proposer_index": "1" } ], "current_epoch_attestations": [ { "aggregation_bits": "0xF9DD8ABe17ae0baDA640Bb0d8c4e81a349D3a", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } }, "inclusion_delay": "1", "proposer_index": "1" } ], "justification_bits": "0x01", "previous_justified_checkpoint": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "current_justified_checkpoint": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "finalized_checkpoint": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ``` * `Code 400`: Invalid state ID. ```json { "code": 400, "message": "Invalid state ID: current" } ``` * `Code 404`: State not found. ```json { "code": 404, "message": "State not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v2/debug/beacon/heads` > Retrieves fork choice leaves. Retrieves all possible chain heads (leaves of fork choice tree). #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v2/debug/beacon/heads" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "slot": "1", "execution_optimistic": false } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ## Events ### `GET /eth/v1/events` > Subscribes to Beacon node events. Provides endpoint to subscribe to beacon node Server-Sent-Events stream. Consumers should use [eventsource](https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface) implementation to listen on those events. Servers *may* send SSE comments beginning with `:` for any purpose, including to keep the event stream connection alive in the presence of proxy servers. #### Parameters * `topics` (array[string]; query; required): event types to subscribe to; available values : `head`, `block`, `attestation`, `voluntary_exit`, `finalized_checkpoint`, `chain_reorg`, `contribution_and_proof`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/events" \ -H "Accept: text/event-stream" ``` #### Responses * `Code 200`: Opened SSE stream. **Head event**: The node has finished processing, resulting in a new head. previous_duty_dependent_root is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)` and `current_duty_dependent_root` is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)`. Both dependent roots use the genesis block root in the case of underflow. ```text event: head data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch_transition":false, "previous_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "current_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "execution_optimistic": false} ``` **Block event**: The node has received a valid block (from P2P or API). ```text event: block data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "execution_optimistic": false} ``` **Attestation event**: The node has received a valid attestation (from P2P or API). ```text event: attestation data: {"aggregation_bits":"0x01", "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data":{"slot":"1", "index":"1", "beacon_block_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}, "target":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}} ``` **Voluntary exit event**: The node has received a valid voluntary exit (from P2P or API). ```text event: voluntary_exit data: {"message":{"epoch":"1", "validator_index":"1"}, "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"} ``` **Finalized checkpoint event**: Finalized checkpoint has been updated. ```text event: finalized_checkpoint data: {"block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch":"2", "execution_optimistic": false } ``` **Chain reorg event**: The node has reorganized its chain. ```text event: chain_reorg data: {"slot":"200", "depth":"50", "old_head_block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "new_head_block":"0x76262e91970d375a19bfe8a867288d7b9cde43c8635f598d93d39d041706fc76", "old_head_state":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "new_head_state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch":"2", "execution_optimistic": false} ``` **Contribution and proof event**: The node has received a valid sync committee SignedContributionAndProof (from P2P or API). ```text event: contribution_and_proof data: {"message": {"aggregator_index": "997", "contribution": {"slot": "168097", "beacon_block_root": "0x56f1fd4262c08fa81e27621c370e187e621a67fc80fe42340b07519f84b42ea1", "subcommittee_index": "0", "aggregation_bits": "0xffffffffffffffffffffffffffffffff", "signature": "0x85ab9018e14963026476fdf784cc674da144b3dbdb47516185438768774f077d882087b90ad642469902e782a8b43eed0cfc1b862aa9a473b54c98d860424a702297b4b648f3f30bdaae8a8b7627d10d04cb96a2cc8376af3e54a9aa0c8145e3"}, "selection_proof": "0x87c305f04bfe5db27c2b19fc23e00d7ac496ec7d3e759cbfdd1035cb8cf6caaa17a36a95a08ba78c282725e7b66a76820ca4eb333822bd399ceeb9807a0f2926c67ce67cfe06a0b0006838203b493505a8457eb79913ce1a3bcd1cc8e4ef30ed"}, "signature": "0xac118511474a94f857300b315c50585c32a713e4452e26a6bb98cdb619936370f126ed3b6bb64469259ee92e69791d9e12d324ce6fd90081680ce72f39d85d50b0ff977260a8667465e613362c6d6e6e745e1f9323ec1d6f16041c4e358839ac"} ``` --- ## Node ### `GET /eth/v1/node/peers` > Retrieves node network peers. Retrieves data about the node's network peers. By default, this returns all peers. Multiple query params are combined using AND conditions. #### Parameters * `state` (array[string]; query): available values : `disconnected`, `connecting`, `connected`, `disconnecting`. * `direction` (array[string]; query): available values : `inbound`, `outbound`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/node/peers" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": [ { "peer_id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N", "enr": "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8", "last_seen_p2p_address": "/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N", "state": "disconnected", "direction": "inbound" } ], "meta": { "count": 1 } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/peers/{peer_id}` > Retrieves a peer. Retrieves data about the given peer. #### Parameters * `peer_id` (string; path; required): a peer ID; example: `QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/node/peers/{peer_id}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "peer_id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N", "enr": "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8", "last_seen_p2p_address": "/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N", "state": "disconnected", "direction": "inbound" } } ``` * `Code 400`: The peer ID supplied could not be parsed. ```json { "code": 400, "message": "Invalid peer ID: localhost" } ``` * `Code 404`: Peer not found. ```json { "code": 404, "message": "Peer not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/peer_count` > Retrieves peer count. Retrieves number of known peers. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/node/peer_count" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "disconnected": "12", "connecting": "34", "connected": "56", "disconnecting": "5" } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/version` > Retrieves a version string of the running Beacon node. Requests that the beacon node identify information about its implementation in a format similar to an [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc7231#section-5.5.3) field. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/node/version" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "version": "Lighthouse/v0.1.5 (Linux x86_64)" } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/syncing` > Retrieves a node syncing status. Requests the beacon node to describe if it's currently syncing or not, and if it is, what block it is up to. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/node/syncing" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "head_slot": "1", "sync_distance": "1", "is_syncing": true, "is_optimistic": true } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/health` > Retrieves health check. Returns node health status in http status codes. Useful for load balancers. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/node/health" ``` #### Responses * `Code 200`: Node is ready. * `Code 206`: Node is syncing but can serve incomplete data. * `Code 503`: Node not initialized or having issues. --- ## Validator ### `POST /eth/v1/validator/duties/attester/{epoch}` > Retrieves attester duties. Requests the beacon node to provide a set of attestation duties, which should be performed by validators, for a particular epoch. Duties should only need to be checked once per epoch, however a chain reorganization (of > MIN_SEED_LOOKAHEAD epochs) could occur, resulting in a change of duties. For full safety, you should monitor head events and confirm the dependent root in this response matches: * event.previous_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch` * event.current_duty_dependent_root when `compute_epoch_at_slot(event.slot) + 1 == epoch` * event.block otherwise The dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)` or the genesis block root in the case of underflow. #### Parameters * `epoch` (string; path; required): should only be allowed one epoch ahead. * `` (required): an array of the validator indices for which to obtain the duties: ```json [ "1" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/attester/{epoch}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. ```json { "dependent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "committee_index": "1", "committee_length": "1", "committees_at_slot": "1", "validator_committee_index": "1", "slot": "1" } ] } ``` * `Code 400`: Invalid epoch or index. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/duties/proposer/{epoch}` > Retrieves block proposer duties. Request beacon node to provide all validators that are scheduled to propose a block in the given epoch. Duties should only need to be checked once per epoch, however a chain reorganization could occur that results in a change of duties. For full safety, you should monitor head events and confirm the dependent root in this response matches: * event.current_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch` * event.block otherwise The dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)` or the genesis block root in the case of underflow. #### Parameters * `epoch` (string; path; required); an epoch. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/proposer/{epoch}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "dependent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "slot": "1" } ] } ``` * `Code 400`: Invalid epoch. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/ title: Gnosis Beacon description: Gnosis Beacon — The Beacon Chain is a consensus layer that introduced a proof-of-stake to Ethereum. Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/gnosis-beacon/index.mdx --- # Gnosis Beacon
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Gnosis Beacon API is available on [Web3 API platform](https://www.ankr.com/rpc/gnosis) upon switching on the **Beacon** toggle. The *Beacon Chain* is a consensus layer that introduced a [proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) to Ethereum. The Beacon Chain mechanism is responsible for creating new blocks, making sure those new blocks are valid, and rewarding validators with ETH for keeping the network secure. In order for your Web3 application to interact with the Beacon Chain — either by reading blockchain data or sending transactions to the network — it must connect to a Beacon node. Developers interact with the blockchain using the methods provided by the API. Beacon API uses the REST interface for querying, responses come in [JSON format](https://www.json.org/json-en.html). ## Methods supported **Beacon**: * [`GET /eth/v1/beacon/genesis`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beacongenesis) — retrieves the details of the chain's genesis. * [`GET /eth/v1/beacon/states/{state_id}/root`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idroot) — retrieves the state SSZ HashTreeRoot. * [`GET /eth/v1/beacon/states/{state_id}/fork`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idfork) — retrieves the Fork object for a requested state. * [`GET /eth/v1/beacon/states/{state_id}/finality_checkpoints`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idfinality_checkpoints) — retrieves state finality checkpoints. * [`GET /eth/v1/beacon/states/{state_id}/validators`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idvalidators) — retrieves validators from state. * [`GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idvalidatorsvalidator_id) — retrieves the validator from state by ID. * [`GET /eth/v1/beacon/states/{state_id}/validator_balances`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idvalidator_balances) — retrieves validator balances from state. * [`GET /eth/v1/beacon/states/{state_id}/committees`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idcommittees) — retrieves all committees for a state. * [`GET /eth/v1/beacon/states/{state_id}/sync_committees`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idsync_committees) — retrieves sync committees for a state. * [`GET /eth/v1/beacon/headers`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconheaders) — retrieves block headers. * [`GET /eth/v1/beacon/headers/{block_id}`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconheadersblock_id) — retrieves a block header. * [`POST /eth/v1/beacon/blocks`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#post-ethv1beaconblocks) — publishes a signed block. * [`POST /eth/v1/beacon/blinded_blocks`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/#post-ethv1beaconblinded_blocks) — publishes a signed block. * [`GET /eth/v2/beacon/blocks/{block_id}`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/#get-ethv2beaconblocksblock_id) — retrieves a block. * [`GET /eth/v1/beacon/blocks/{block_id}/root`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/#get-ethv1beaconblocksblock_idroot) — retrieves a block root. * [`GET /eth/v1/beacon/blocks/{block_id}/attestations`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#get-ethv1beaconblocksblock_idattestations) — retrieves block attestations. * [`GET /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#get-ethv1beaconpoolattestations) — retrieves attestations from the operations pool. * [`POST /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolattestations) — submits attestation objects to the node. * [`GET /eth/v1/beacon/pool/attester_slashings`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#get-ethv1beaconpoolattester_slashings) — retrieves attester slashings from the operations pool. * [`POST /eth/v1/beacon/pool/attester_slashings`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolattester_slashings) — submits the AttesterSlashing object to the node's pool. * [`GET /eth/v1/beacon/pool/proposer_slashings`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#get-ethv1beaconpoolproposer_slashings) — retrieves proposer slashings from the operations pool. * [`POST /eth/v1/beacon/pool/proposer_slashings`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolproposer_slashings) — submits the ProposerSlashing object to the node's pool. * [`POST /eth/v1/beacon/pool/sync_committees`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolsync_committees) — submits sync committee signatures to the node. * [`GET /eth/v1/beacon/pool/voluntary_exits`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#get-ethv1beaconpoolvoluntary_exits) — retrieves SignedVoluntaryExit from the operations pool. * [`POST /eth/v1/beacon/pool/voluntary_exits`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolvoluntary_exits) — submits the SignedVoluntaryExit object to the node's pool. **Config**: * [`GET /eth/v1/config/fork_schedule`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1configfork_schedule) — retrieves scheduled upcoming forks. * [`GET /eth/v1/config/spec`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1configspec) — retrieves spec parameters. * [`GET /eth/v1/config/deposit_contract`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1configdeposit_contract) — retrieves a deposit contract address. **Debug**: * [`GET /eth/v2/debug/beacon/states/{state_id}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv2debugbeaconstatesstate_id) — retrieves the full BeaconState object. * [`GET /eth/v2/debug/beacon/heads`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv2debugbeaconheads) — retrieves fork choice leaves. **Events**: * [`GET /eth/v1/events`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1events) — subscribes to Beacon node events. **Node**: * [`GET /eth/v1/node/peers`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodepeers) — retrieves node network peers. * [`GET /eth/v1/node/peers/{peer_id}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodepeerspeer_id) — retrieves a peer. * [`GET /eth/v1/node/peer_count`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodepeer_count) — retrieves peer count. * [`GET /eth/v1/node/version`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodeversion) — retrieves a version string of the running Beacon node. * [`GET /eth/v1/node/syncing`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodesyncing) — retrieves a node syncing status. * [`GET /eth/v1/node/health`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodehealth) — retrieves health check. **Validator**: * [`POST /eth/v1/validator/duties/attester/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#post-ethv1validatordutiesattesterepoch) — retrieves attester duties. * [`GET /eth/v1/validator/duties/proposer/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1validatordutiesproposerepoch) — retrieves block proposer duties. * [`POST /eth/v1/validator/duties/sync/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#post-ethv1validatordutiessyncepoch) — retrieves sync committee duties. * [`GET /eth/v1/validator/blocks/{slot}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorblocksslot) — produces a new block, without signature. * [`GET /eth/v1/validator/blinded_blocks/{slot}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorblinded_blocksslot) — produces a new block, without signature. * [`GET /eth/v1/validator/attestation_data`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorattestation_data) — produces attestation data. * [`GET /eth/v1/validator/aggregate_attestation`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#get-ethv1validatoraggregate_attestation) — retrieves aggregated attestation. * [`POST /eth/v1/validator/aggregate_and_proofs`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatoraggregate_and_proofs) — publishes multiple aggregate and proofs. * [`POST /eth/v1/validator/beacon_committee_subscriptions`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatorbeacon_committee_subscriptions) — signals the Beacon node to prepare for a committee subnet. * [`POST /eth/v1/validator/sync_committee_subscriptions`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatorsync_committee_subscriptions) — subscribes to sync committee subnets. * [`GET /eth/v1/validator/sync_committee_contribution`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#get-ethv1validatorsync_committee_contribution) — produces a sync committee contribution. * [`POST /eth/v1/validator/contribution_and_proofs`](/rpc-service/chains/chains-api/gnosis-beacon/validator/#post-ethv1validatorcontribution_and_proofs) — publishes multiple contribution and proofs. * [`POST /eth/v1/validator/prepare_beacon_proposer`](/rpc-service/chains/chains-api/gnosis-beacon/validator/#post-ethv1validatorprepare_beacon_proposer) — provides the Beacon node with proposals for the given validators. * [`POST /eth/v1/validator/register_validator`](/rpc-service/chains/chains-api/gnosis-beacon/validator/#post-ethv1validatorregister_validator) — provides the Beacon node with registrations for the given validators to the external builder network. **ValidatorRequiredApi**: * [`GET /eth/v1/beacon/genesis`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beacongenesis) — retrieves details of the chain's genesis. * [`GET /eth/v1/beacon/states/{state_id}/fork`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idfork) — retrieves the Fork object for a requested state. * [`GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idvalidatorsvalidator_id) — retrieves the validator from state by ID. * [`POST /eth/v1/beacon/blocks`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#post-ethv1beaconblocks) — publishes a signed block. * [`POST /eth/v1/beacon/blinded_blocks`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/#post-ethv1beaconblinded_blocks) — publishes a signed block. * [`POST /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolattestations) — submits attestation objects to the node. * [`POST /eth/v1/beacon/pool/sync_committees`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolsync_committees) — submits sync committee signatures to the node. * [`GET /eth/v1/node/syncing`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodesyncing) — retrieves a node syncing status. * [`GET /eth/v1/config/spec`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1configspec) — retrieves spec parameters. * [`POST /eth/v1/validator/duties/attester/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#post-ethv1validatordutiesattesterepoch) — retrieves attester duties. * [`GET /eth/v1/validator/duties/proposer/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1validatordutiesproposerepoch) — retrieves block proposer duties. * [`POST /eth/v1/validator/duties/sync/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#post-ethv1validatordutiessyncepoch) — retrieves sync committee duties. * [`GET /eth/v1/validator/blocks/{slot}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorblocksslot) — produces a new block, without signature. * [`GET /eth/v1/validator/blinded_blocks/{slot}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorblinded_blocksslot) — produces a new block, without signature. * [`GET /eth/v1/validator/attestation_data`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorattestation_data) — produces attestation data. * [`GET /eth/v1/validator/aggregate_attestation`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#get-ethv1validatoraggregate_attestation) — retrieves aggregated attestation. * [`POST /eth/v1/validator/aggregate_and_proofs`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatoraggregate_and_proofs) — publishes multiple aggregate and proofs. * [`POST /eth/v1/validator/beacon_committee_subscriptions`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatorbeacon_committee_subscriptions) — signals the Beacon node to prepare for a committee subnet. * [`POST /eth/v1/validator/sync_committee_subscriptions`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatorsync_committee_subscriptions) — subscribes to sync committee subnets. * [`GET /eth/v1/validator/sync_committee_contribution`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#get-ethv1validatorsync_committee_contribution) — produces a sync committee contribution. * [`POST /eth/v1/validator/contribution_and_proofs`](/rpc-service/chains/chains-api/gnosis-beacon/validator/#post-ethv1validatorcontribution_and_proofs) — publishes multiple contribution and proofs. * [`POST /eth/v1/validator/prepare_beacon_proposer`](/rpc-service/chains/chains-api/gnosis-beacon/validator/#post-ethv1validatorprepare_beacon_proposer) — provides the Beacon node with proposals for the given validators. * [`GET /eth/v1/events`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1events) — subscribes to Beacon node events. --- ## Methods ### Beacon - [`GET /eth/v1/beacon/genesis`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beacongenesis) - [`GET /eth/v1/beacon/states/{state_id}/root`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idroot) - [`GET /eth/v1/beacon/states/{state_id}/fork`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idfork) - [`GET /eth/v1/beacon/states/{state_id}/finality_checkpoints`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idfinality_checkpoints) - [`GET /eth/v1/beacon/states/{state_id}/validators`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idvalidators) - [`GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idvalidatorsvalidator_id) - [`GET /eth/v1/beacon/states/{state_id}/validator_balances`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idvalidator_balances) - [`GET /eth/v1/beacon/states/{state_id}/committees`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idcommittees) - [`GET /eth/v1/beacon/states/{state_id}/sync_committees`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idsync_committees) - [`GET /eth/v1/beacon/headers`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconheaders) - [`GET /eth/v1/beacon/headers/{block_id}`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconheadersblock_id) - [`Response example`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#response-example-9) - [`POST /eth/v1/beacon/blocks`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#post-ethv1beaconblocks) - [`POST /eth/v1/beacon/blinded_blocks`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/#post-ethv1beaconblinded_blocks) - [`GET /eth/v2/beacon/blocks/{block_id}`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/#get-ethv2beaconblocksblock_id) - [`GET /eth/v1/beacon/blocks/{block_id}/root`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/#get-ethv1beaconblocksblock_idroot) - [`GET /eth/v1/beacon/blocks/{block_id}/attestations`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#get-ethv1beaconblocksblock_idattestations) - [`GET /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#get-ethv1beaconpoolattestations) - [`POST /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolattestations) - [`GET /eth/v1/beacon/pool/attester_slashings`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#get-ethv1beaconpoolattester_slashings) - [`POST /eth/v1/beacon/pool/attester_slashings`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolattester_slashings) - [`GET /eth/v1/beacon/pool/proposer_slashings`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#get-ethv1beaconpoolproposer_slashings) - [`POST /eth/v1/beacon/pool/proposer_slashings`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolproposer_slashings) - [`POST /eth/v1/beacon/pool/sync_committees`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolsync_committees) - [`GET /eth/v1/beacon/pool/voluntary_exits`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#get-ethv1beaconpoolvoluntary_exits) - [`POST /eth/v1/beacon/pool/voluntary_exits`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolvoluntary_exits) ### Config, Debug, Events, Node, Validator - [`GET /eth/v1/config/fork_schedule`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1configfork_schedule) - [`GET /eth/v1/config/spec`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1configspec) - [`GET /eth/v1/config/deposit_contract`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1configdeposit_contract) - [`GET /eth/v2/debug/beacon/states/{state_id}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv2debugbeaconstatesstate_id) - [`GET /eth/v2/debug/beacon/heads`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv2debugbeaconheads) - [`GET /eth/v1/events`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1events) - [`GET /eth/v1/node/peers`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodepeers) - [`GET /eth/v1/node/peers/{peer_id}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodepeerspeer_id) - [`GET /eth/v1/node/peer_count`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodepeer_count) - [`GET /eth/v1/node/version`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodeversion) - [`GET /eth/v1/node/syncing`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodesyncing) - [`GET /eth/v1/node/health`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodehealth) - [`POST /eth/v1/validator/duties/attester/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#post-ethv1validatordutiesattesterepoch) - [`GET /eth/v1/validator/duties/proposer/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1validatordutiesproposerepoch) - [`POST /eth/v1/validator/duties/sync/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#post-ethv1validatordutiessyncepoch) - [`GET /eth/v1/validator/blocks/{slot}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorblocksslot) - [`GET /eth/v1/validator/blinded_blocks/{slot}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorblinded_blocksslot) - [`GET /eth/v1/validator/attestation_data`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorattestation_data) - [`GET /eth/v1/validator/aggregate_attestation`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#get-ethv1validatoraggregate_attestation) - [`POST /eth/v1/validator/aggregate_and_proofs`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatoraggregate_and_proofs) - [`POST /eth/v1/validator/beacon_committee_subscriptions`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatorbeacon_committee_subscriptions) - [`POST /eth/v1/validator/sync_committee_subscriptions`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatorsync_committee_subscriptions) - [`GET /eth/v1/validator/sync_committee_contribution`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#get-ethv1validatorsync_committee_contribution) ### Validator, ValidatorRequiredApi - [`POST /eth/v1/validator/contribution_and_proofs`](/rpc-service/chains/chains-api/gnosis-beacon/validator/#post-ethv1validatorcontribution_and_proofs) - [`POST /eth/v1/validator/prepare_beacon_proposer`](/rpc-service/chains/chains-api/gnosis-beacon/validator/#post-ethv1validatorprepare_beacon_proposer) - [`POST /eth/v1/validator/register_validator`](/rpc-service/chains/chains-api/gnosis-beacon/validator/#post-ethv1validatorregister_validator) - [`GET /eth/v1/beacon/genesis`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beacongenesis) - [`GET /eth/v1/beacon/states/{state_id}/fork`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idfork) - [`GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#get-ethv1beaconstatesstate_idvalidatorsvalidator_id) - [`POST /eth/v1/beacon/blocks`](/rpc-service/chains/chains-api/gnosis-beacon/beacon/#post-ethv1beaconblocks) - [`POST /eth/v1/beacon/blinded_blocks`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p2/#post-ethv1beaconblinded_blocks) - [`POST /eth/v1/beacon/pool/attestations`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolattestations) - [`POST /eth/v1/beacon/pool/sync_committees`](/rpc-service/chains/chains-api/gnosis-beacon/beacon-p3/#post-ethv1beaconpoolsync_committees) - [`GET /eth/v1/node/syncing`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1nodesyncing) - [`GET /eth/v1/config/spec`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1configspec) - [`POST /eth/v1/validator/duties/attester/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#post-ethv1validatordutiesattesterepoch) - [`GET /eth/v1/validator/duties/proposer/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1validatordutiesproposerepoch) - [`POST /eth/v1/validator/duties/sync/{epoch}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#post-ethv1validatordutiessyncepoch) - [`GET /eth/v1/validator/blocks/{slot}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorblocksslot) ### ValidatorRequiredApi - [`GET /eth/v1/validator/blinded_blocks/{slot}`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorblinded_blocksslot) - [`GET /eth/v1/validator/attestation_data`](/rpc-service/chains/chains-api/gnosis-beacon/config-p2/#get-ethv1validatorattestation_data) - [`GET /eth/v1/validator/aggregate_attestation`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#get-ethv1validatoraggregate_attestation) - [`POST /eth/v1/validator/aggregate_and_proofs`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatoraggregate_and_proofs) - [`POST /eth/v1/validator/beacon_committee_subscriptions`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatorbeacon_committee_subscriptions) - [`POST /eth/v1/validator/sync_committee_subscriptions`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#post-ethv1validatorsync_committee_subscriptions) - [`GET /eth/v1/validator/sync_committee_contribution`](/rpc-service/chains/chains-api/gnosis-beacon/config-p3/#get-ethv1validatorsync_committee_contribution) - [`POST /eth/v1/validator/contribution_and_proofs`](/rpc-service/chains/chains-api/gnosis-beacon/validator/#post-ethv1validatorcontribution_and_proofs) - [`POST /eth/v1/validator/prepare_beacon_proposer`](/rpc-service/chains/chains-api/gnosis-beacon/validator/#post-ethv1validatorprepare_beacon_proposer) - [`GET /eth/v1/events`](/rpc-service/chains/chains-api/gnosis-beacon/config/#get-ethv1events) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/validator-p2/ title: Gnosis Beacon — Validator, ValidatorRequiredApi (2/2) source: docs/rpc-service/chains/chains-api/gnosis-beacon/validator-p2.mdx --- # Gnosis Beacon — Validator, ValidatorRequiredApi (2/2) > API reference for [Gnosis Beacon](/rpc-service/chains/chains-api/gnosis-beacon/). [All methods ->](/rpc-service/chains/chains-api/gnosis-beacon/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/gnosis-beacon/validator/) · 2 ## ValidatorRequiredApi ### `POST /eth/v1/beacon/pool/attestations` > Submits attestation objects to the node. Submits Attestation objects to the node. Each attestation in the request body is processed individually. If an attestation is validated successfully the node MUST publish that attestation on the appropriate subnet. If one or more attestations fail validation the node MUST return a 400 error with details of which attestations have failed, and why. #### Parameters * `` (required): ```json [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/attestations" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Attestations are stored in pool and broadcast on appropriate subnet. * `Code 400`: Errors with one or more attestations. ```json { "code": 400, "message": "some failures", "failures": [ { "index": 3, "message": "invalid signature" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/beacon/pool/sync_committees` > Submits sync committee signatures to the node. Submits sync committee signature objects to the node. Sync committee signatures are not present in phase0, but are required for Altair networks. If a sync committee signature is validated successfully the node MUST publish that sync committee signature on all applicable subnets. If one or more sync committee signatures fail validation the node MUST return a 400 error with details of which sync committee signatures have failed, and why. #### Parameters * `` (required): ```json [ { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "validator_index": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/pool/sync_committees" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Sync committee signatures are stored in pool and broadcast on appropriate subnet. * `Code 400`: Errors with one or more sync committee signatures. ```json { "code": 400, "message": "some failures", "failures": [ { "index": 3, "message": "invalid signature" } ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/node/syncing` > Retrieves a node syncing status. Requests the beacon node to describe if it's currently syncing or not, and if it is, what block it is up to. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/node/syncing" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "head_slot": "1", "sync_distance": "1", "is_syncing": true, "is_optimistic": true } } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/config/spec` > Retrieves spec parameters. Retrieve specification configuration used on this node. The configuration should include: * Constants for all hard forks known by the beacon node, for example the [phase 0](https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#constants) and [altair](https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/beacon-chain.md#constants) values. * Presets for all hard forks supplied to the beacon node, for example the [phase 0](https://github.com/ethereum/consensus-specs/blob/dev/presets/mainnet/phase0.yaml) and [altair](https://github.com/ethereum/consensus-specs/blob/dev/presets/mainnet/altair.yaml) values. * Configuration for the beacon node, for example the [mainnet](https://github.com/ethereum/consensus-specs/blob/dev/configs/mainnet.yaml) values. Values are returned with the following format: * Any value starting with 0x in the spec is returned as a hex string. * Numeric values are returned as a quoted integer. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/config/spec" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "DEPOSIT_CONTRACT_ADDRESS": "0x00000000219ab540356cBB839Cbe05303d7705Fa", "DEPOSIT_NETWORK_ID": "1", "DOMAIN_AGGREGATE_AND_PROOF": "0x06000000", "INACTIVITY_PENALTY_QUOTIENT": "67108864", "INACTIVITY_PENALTY_QUOTIENT_ALTAIR": "50331648" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/duties/attester/{epoch}` > Retrieves attester duties. Requests the beacon node to provide a set of attestation duties, which should be performed by validators, for a particular epoch. Duties should only need to be checked once per epoch, however a chain reorganization (of > MIN_SEED_LOOKAHEAD epochs) could occur, resulting in a change of duties. For full safety, you should monitor head events and confirm the dependent root in this response matches: * event.previous_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch` * event.current_duty_dependent_root when `compute_epoch_at_slot(event.slot) + 1 == epoch` * event.block otherwise The dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)` or the genesis block root in the case of underflow. #### Parameters * `epoch` (string; path; required): should only be allowed one epoch ahead. * `` (required): an array of the validator indices for which to obtain the duties: ```json [ "1" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/attester/{epoch}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. ```json { "dependent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "committee_index": "1", "committee_length": "1", "committees_at_slot": "1", "validator_committee_index": "1", "slot": "1" } ] } ``` * `Code 400`: Invalid epoch or index. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/duties/proposer/{epoch}` > Retrieves block proposer duties. Request beacon node to provide all validators that are scheduled to propose a block in the given epoch. Duties should only need to be checked once per epoch, however a chain reorganization could occur that results in a change of duties. For full safety, you should monitor head events and confirm the dependent root in this response matches: * event.current_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch` * event.block otherwise The dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)` or the genesis block root in the case of underflow. #### Parameters * `epoch` (string; path; required); an epoch. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/proposer/{epoch}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "dependent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "slot": "1" } ] } ``` * `Code 400`: Invalid epoch. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/duties/sync/{epoch}` > Retrieves sync committee duties. Requests the beacon node to provide a set of sync committee duties for a particular epoch. #### Parameters * `epoch` (string; path; required): `epoch` // `EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch` // `EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1` * `` (required): an array of the validator indices for which to obtain the duties: ```json [ "1" ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/duties/sync/{epoch}" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. ```json { "execution_optimistic": false, "data": [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "validator_index": "1", "validator_sync_committee_indices": [ "1" ] } ] } ``` * `Code 400`: Invalid epoch or index. ```json { "code": 400, "message": "Invalid epoch: -2" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/blocks/{slot}` > Produces a new block, without signature. Requests a beacon node to produce a valid block, which can then be signed by a validator. Metadata in the response indicates the type of block produced, and the supported types of block will be added to as forks progress. #### Parameters * `slot` (string; path; required): the slot for which the block should be proposed. * `randao_reveal` (string; hex; query; required): the validator's randao reveal value. * `graffiti` (string; hex; query): an arbitrary data validator to include in the block. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/blocks/{slot}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Note: The `Eth-Consensus-Version` header is required in response so client can deserialize returned json or ssz data more effectively. ```json { "version": "phase0", "data": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xbF0eF8805DE094355C99fD34Df183ADB5BB153f5dac2eD83bee6eEd2dEf05cFC", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } } } ``` * `Code 400`: Invalid block production request. ```json { "code": 400, "message": "Invalid request to produce a block" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/validator/ title: Gnosis Beacon — Validator, ValidatorRequiredApi (1/2) source: docs/rpc-service/chains/chains-api/gnosis-beacon/validator.mdx --- # Gnosis Beacon — Validator, ValidatorRequiredApi (1/2) > API reference for [Gnosis Beacon](/rpc-service/chains/chains-api/gnosis-beacon/). [All methods ->](/rpc-service/chains/chains-api/gnosis-beacon/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/gnosis-beacon/validator-p2/) ### `POST /eth/v1/validator/contribution_and_proofs` > Publishes multiple contribution and proofs. Publishes multiple signed sync committee contribution and proofs. #### Parameters * ``: ```json [ { "message": { "aggregator_index": "1", "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "contribution": { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "subcommittee_index": "1", "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/contribution_and_proofs" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/prepare_beacon_proposer` > Provides the Beacon node with proposals for the given validators. Prepares the beacon node for potential proposers by supplying information required when proposing blocks for the given validators. The information supplied for each validator index will persist through the epoch in which the call is submitted and for a further two epochs after that, or until the beacon node restarts. It is expected that validator clients will send this information periodically, for example each epoch, to ensure beacon nodes have correct and timely fee recipient information. Note that there is no guarantee that the beacon node will use the supplied fee recipient when creating a block proposal, so on receipt of a proposed block the validator should confirm that it finds the fee recipient within the block acceptable before signing it. Also note that requests containing currently inactive or unknown validator indices will be accepted, as they may become active at a later epoch. #### Parameters * ``: ```json [ { "validator_index": "1", "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/prepare_beacon_proposer" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. Preparation information has been received. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/register_validator` > Provides the Beacon node with registrations for the given validators to the external builder network. Prepares the beacon node for engaging with external builders. The information will be sent by the beacon node to the builder network. It is expected that the validator client will send this information periodically to ensure the beacon node has correct and timely registration information to provide to builders. The validator client should not sign blinded beacon blocks that do not adhere to their latest fee recipient and gas limit preferences. Note that requests containing currently inactive or unknown validator pubkeys will be accepted, as they may become active at a later epoch. #### Parameters * ``: ```json [ { "message": { "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09", "gas_limit": "1", "timestamp": "1", "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/register_validator" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. Registration information has been received. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ## ValidatorRequiredApi ### `GET /eth/v1/beacon/genesis` > Retrieves the details of the chain's genesis. Returns the details of the chain's genesis which can be used to identify chain. #### Parameters None. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/genesis" \ -H "Accept: application/json" ``` #### Response example ```json { "data": { "genesis_time": "1606824023", "genesis_validators_root": "0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95", "genesis_fork_version": "0x00000000" } } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/fork` > Retrieves the Fork object for a requested state. Retrieves the [Fork](https://github.com/ethereum/consensus-specs/blob/v0.11.1/specs/phase0/beacon-chain.md#fork) object for state with given 'stateId'. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/state/{state_id}/fork" \ -H "Accept: application/json" ``` #### Response example ```json { "execution_optimistic": false, "data": { "previous_version": "0x00000000", "current_version": "0x00000000", "epoch": "1" } } ``` --- ### `GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}` > Retrieves the validator from state by ID. Returns validator specified by state and id or public key along with status and balance. #### Parameters * `state_id` (string; path; required): state identifier. Can be one of: `head` (canonical head in node's view), `genesis`, `finalized`, `justified`, ``, ``.
Example: `head`. * `validator_id` (string; path; required): either a hex encoded public key (any bytes48 with 0x prefix) or validator index. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/states/{state_id}/validators/{validator_id}" \ -H "Accept: application/json" ``` #### Response example ```json { "execution_optimistic": false, "data": { "index": "1", "balance": "1", "status": "active_ongoing", "validator": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "effective_balance": "1", "slashed": false, "activation_eligibility_epoch": "1", "activation_epoch": "1", "exit_epoch": "1", "withdrawable_epoch": "1" } } } ``` --- ### `POST /eth/v1/beacon/blocks` > Publishes a signed block. Instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed BeaconBlock, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202). #### Parameters * `Eth-Consensus-Version` (header): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`. * `` (required): the `SignedBeaconBlock` object composed of the `BeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0xdEFeAFdc312b725d00Dd16b4A627fCBfa6B8aAF1d8AF7bCfd82bbFca700A0645", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. * `Code 202`: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database. * `Code 400`: The `SignedBeaconBlock` object is invalid. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/beacon/blinded_blocks` > Publishes a signed block. Instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct and publish a `SignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`. The beacon node should broadcast a newly constructed `SignedBeaconBlock` to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed `BeaconBlock`, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202). Pre-Bellatrix, this endpoint will accept a `SignedBeaconBlock`. #### Parameters * `Eth-Consensus-Version` (header): a version of the block being submitted, if using SSZ encoding. Available values : `phase0`, `altair`, `bellatrix`. * `` (required): the `SignedBlindedBeaconBlock` object composed of `BlindedBeaconBlock` object (produced by beacon node) and validator signature. ```json { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0x81cdF3DbaE67fBbE10CAc8Bcd8B28d4DDDc65D9a74f3921693676fccF8BeCe9B", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/beacon/blinded_blocks" \ -H "Eth-Consensus-Version: bellatrix" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{your_request_body}' ``` #### Responses * `Code 200`: The block was validated successfully and has been broadcast. It has also been integrated into the beacon node's database. * `Code 202`: The block failed validation, but was successfully broadcast anyway. It was not integrated into the beacon node's database. * `Code 400`: The `SignedBlindedBeaconBlock` object is invalid. ```json { "code": 400, "message": "Invalid block: missing signature" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/validatorrequiredapi-p2/ title: Gnosis Beacon — ValidatorRequiredApi (2/2) source: docs/rpc-service/chains/chains-api/gnosis-beacon/validatorrequiredapi-p2.mdx --- # Gnosis Beacon — ValidatorRequiredApi (2/2) > API reference for [Gnosis Beacon](/rpc-service/chains/chains-api/gnosis-beacon/). [All methods ->](/rpc-service/chains/chains-api/gnosis-beacon/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/gnosis-beacon/validatorrequiredapi/) · 2 ### `POST /eth/v1/validator/prepare_beacon_proposer` > Provides the Beacon node with proposals for the given validators. Prepares the beacon node for potential proposers by supplying information required when proposing blocks for the given validators. The information supplied for each validator index will persist through the epoch in which the call is submitted and for a further two epochs after that, or until the beacon node restarts. It is expected that validator clients will send this information periodically, for example each epoch, to ensure beacon nodes have correct and timely fee recipient information. Note that there is no guarantee that the beacon node will use the supplied fee recipient when creating a block proposal, so on receipt of a proposed block the validator should confirm that it finds the fee recipient within the block acceptable before signing it. Also note that requests containing currently inactive or unknown validator indices will be accepted, as they may become active at a later epoch. #### Parameters * ``: ```json [ { "validator_index": "1", "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/prepare_beacon_proposer" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. Preparation information has been received. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/events` > Subscribes to Beacon node events. Provides endpoint to subscribe to beacon node Server-Sent-Events stream. Consumers should use [eventsource](https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface) implementation to listen on those events. Servers *may* send SSE comments beginning with `:` for any purpose, including to keep the event stream connection alive in the presence of proxy servers. #### Parameters * `topics` (array[string]; query; required): event types to subscribe to; available values : `head`, `block`, `attestation`, `voluntary_exit`, `finalized_checkpoint`, `chain_reorg`, `contribution_and_proof`. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/events" \ -H "Accept: text/event-stream" ``` #### Responses * `Code 200`: Opened SSE stream. **Head event**: The node has finished processing, resulting in a new head. previous_duty_dependent_root is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)` and `current_duty_dependent_root` is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)`. Both dependent roots use the genesis block root in the case of underflow. ```text event: head data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch_transition":false, "previous_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "current_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "execution_optimistic": false} ``` **Block event**: The node has received a valid block (from P2P or API). ```text event: block data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "execution_optimistic": false} ``` **Attestation event**: The node has received a valid attestation (from P2P or API). ```text event: attestation data: {"aggregation_bits":"0x01", "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data":{"slot":"1", "index":"1", "beacon_block_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}, "target":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}} ``` **Voluntary exit event**: The node has received a valid voluntary exit (from P2P or API). ```text event: voluntary_exit data: {"message":{"epoch":"1", "validator_index":"1"}, "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"} ``` **Finalized checkpoint event**: Finalized checkpoint has been updated. ```text event: finalized_checkpoint data: {"block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch":"2", "execution_optimistic": false } ``` **Chain reorg event**: The node has reorganized its chain. ```text event: chain_reorg data: {"slot":"200", "depth":"50", "old_head_block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "new_head_block":"0x76262e91970d375a19bfe8a867288d7b9cde43c8635f598d93d39d041706fc76", "old_head_state":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "new_head_state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch":"2", "execution_optimistic": false} ``` **Contribution and proof event**: The node has received a valid sync committee SignedContributionAndProof (from P2P or API). ```text event: contribution_and_proof data: {"message": {"aggregator_index": "997", "contribution": {"slot": "168097", "beacon_block_root": "0x56f1fd4262c08fa81e27621c370e187e621a67fc80fe42340b07519f84b42ea1", "subcommittee_index": "0", "aggregation_bits": "0xffffffffffffffffffffffffffffffff", "signature": "0x85ab9018e14963026476fdf784cc674da144b3dbdb47516185438768774f077d882087b90ad642469902e782a8b43eed0cfc1b862aa9a473b54c98d860424a702297b4b648f3f30bdaae8a8b7627d10d04cb96a2cc8376af3e54a9aa0c8145e3"}, "selection_proof": "0x87c305f04bfe5db27c2b19fc23e00d7ac496ec7d3e759cbfdd1035cb8cf6caaa17a36a95a08ba78c282725e7b66a76820ca4eb333822bd399ceeb9807a0f2926c67ce67cfe06a0b0006838203b493505a8457eb79913ce1a3bcd1cc8e4ef30ed"}, "signature": "0xac118511474a94f857300b315c50585c32a713e4452e26a6bb98cdb619936370f126ed3b6bb64469259ee92e69791d9e12d324ce6fd90081680ce72f39d85d50b0ff977260a8667465e613362c6d6e6e745e1f9323ec1d6f16041c4e358839ac"} ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis-beacon/validatorrequiredapi/ title: Gnosis Beacon — ValidatorRequiredApi (1/2) source: docs/rpc-service/chains/chains-api/gnosis-beacon/validatorrequiredapi.mdx --- # Gnosis Beacon — ValidatorRequiredApi (1/2) > API reference for [Gnosis Beacon](/rpc-service/chains/chains-api/gnosis-beacon/). [All methods ->](/rpc-service/chains/chains-api/gnosis-beacon/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/gnosis-beacon/validatorrequiredapi-p2/) ### `GET /eth/v1/validator/blinded_blocks/{slot}` > Produces a new blinded block, without signature. Requests a beacon node to produce a valid blinded block, which can then be signed by a validator. A blinded block is a block with only a transactions root, rather than a full transactions list. Metadata in the response indicates the type of block produced, and the supported types of block will be added to as forks progress. Pre-Bellatrix, this endpoint will return a `BeaconBlock`. #### Parameters * `slot` (string; path; required): the slot for which the block should be proposed. * `randao_reveal` (string; hex; query; required): the validator's randao reveal value. * `graffiti` (string; hex; query): an arbitrary data validator to include in the block. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/blinded_blocks/{slot}" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "version": "bellatrix", "data": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body": { "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "eth1_data": { "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "deposit_count": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "graffiti": "0x2F86DB21b8b1C3465689AaeBB3cE1A4F7C79F09F0dA82444eec71f1cCbBC7fb3", "proposer_slashings": [ { "signed_header_1": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signed_header_2": { "message": { "slot": "1", "proposer_index": "1", "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "attester_slashings": [ { "attestation_1": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "attestation_2": { "attesting_indices": [ "1" ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ], "attestations": [ { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ], "deposits": [ { "proof": [ "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" ], "data": { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "amount": "1", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ], "voluntary_exits": [ { "message": { "epoch": "1", "validator_index": "1" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] } } } ``` * `Code 400`: Invalid block production request. ```json { "code": 400, "message": "Invalid request to produce a block" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/attestation_data` > Produces attestation data. Requests that the beacon node to produce an AttestationData. #### Parameters * `slot` (string; query; required): the slot for which an attestation data should be created. * `committee_index` (string; query; required): the committee index for which an attestation data should be created. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/attestation_data" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `GET /eth/v1/validator/aggregate_attestation` > Retrieves aggregated attestation. Aggregates all attestations matching given attestation data root and slot. #### Parameters * `attestation_data_root` (string; query; required): HashTreeRoot of AttestationData that validator wants aggregated. * `slot` (string; query; required): a slot. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_attestation" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. Returns aggregated `Attestation` object with same `AttestationData` root. ```json { "data": { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 404`: Not found. ```json { "code": 404, "message": "Requested item not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/aggregate_and_proofs` > Publishes multiple aggregate and proofs. Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic. #### Parameters * `` (required): ```json [ { "message": { "aggregator_index": "1", "aggregate": { "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data": { "slot": "1", "index": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "target": { "epoch": "1", "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" } } }, "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/aggregate_and_proofs" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `POST /eth/v1/validator/beacon_committee_subscriptions` > Signals the Beacon node to prepare for a committee subnet. After beacon node receives this request, search using discv5 for peers related to this subnet and replace current peers with those ones if necessary. If validator `is_aggregator`, beacon node must: * Announce subnet topic subscription on gossipsub. * Aggregate attestations received on that subnet. #### Parameters * ``: ```json [ { "validator_index": "1", "committee_index": "1", "committees_at_slot": "1", "slot": "1", "is_aggregator": true } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/beacon_committee_subscriptions" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. Slot signature is valid and beacon node has prepared the attestation subnet. Note that we cannot be certain the Beacon node will find peers for that subnet for various reasons. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/sync_committee_subscriptions` > Subscribes to sync committee subnets. Subscribe to a number of sync committee subnets. Sync committees are not present in phase0, but are required for Altair networks. Subscribing to sync committee subnets is an action performed by VC to enable network participation in Altair networks, and only required if the VC has an active validator in an active sync committee. #### Parameters * ``: ```json [ { "validator_index": "1", "sync_committee_indices": [ "1" ], "until_epoch": "1" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_subscriptions" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- ### `GET /eth/v1/validator/sync_committee_contribution` > Produces a sync committee contribution. Requests that the beacon node to produce a sync committee contribution. #### Parameters * `slot` (string; query; required): the slot for which a sync committee contribution should be created. * `subcommittee_index` (string; query; required): the subcommittee index for which to produce the contribution. * `beacon_block_root` (string; query; required): the block root for which to produce the contribution. #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/sync_committee_contribution" \ -H "Accept: application/json" ``` #### Responses * `Code 200`: Success. ```json { "data": { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "subcommittee_index": "1", "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } ``` * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 404`: Not found. ```json { "code": 404, "message": "Requested item not found" } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` * `Code 503`: Beacon node is currently syncing, try again later. ```json { "code": 503, "message": "Beacon node is currently syncing and not serving request on that endpoint" } ``` --- ### `POST /eth/v1/validator/contribution_and_proofs` > Publishes multiple contribution and proofs. Publishes multiple signed sync committee contribution and proofs. #### Parameters * ``: ```json [ { "message": { "aggregator_index": "1", "selection_proof": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "contribution": { "slot": "1", "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "subcommittee_index": "1", "aggregation_bits": "0x01", "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } ] ``` #### Request example ```shell curl -X POST "https://rpc.ankr.com/premium-http/gnosis_beacon/YOUR_ANKR_API_KEY/eth/v1/validator/contribution_and_proofs" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{request body}' ``` #### Responses * `Code 200`: Success. * `Code 400`: Invalid request syntax. ```json { "code": 400, "message": "string", "stacktraces": [ "string" ] } ``` * `Code 500`: Beacon node internal error. ```json { "code": 500, "message": "Internal server error" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis/ title: Gnosis description: Gnosis (formerly the xDai Chain) provides stability, scalability, and an extendable beacon chain framework. 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/gnosis/index.mdx --- # Gnosis
> Gnosis API is available on [Web3 API platform](https://www.ankr.com/rpc/gnosis). *Gnosis* (formerly the xDai Chain) provides stability, scalability, and an extendable beacon chain framework. Development on Gnosis is straightforward for Ethereum developers as it is an EVM compatible chain. Smart contracts can be written and deployed in the same way as for Ethereum just by setting a different RPC endpoint. Any contract that works on the Ethereum mainnet can be redeployed to the Gnosis chain. Transaction costs are minimized, and all fees and transactions are paid with a single token (xDai). Many tools supporting Ethereum development are compatible with Gnosis. In order for your Web3 application to interact with Gnosis — either by reading blockchain data or sending transactions to the network — it must connect to a Gnosis node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/gnosis/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/gnosis/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/gnosis/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/gnosis/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_protocolVersion`](/rpc-service/chains/chains-api/gnosis/web3/#eth_protocolversion) — returns the current protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/gnosis/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/gnosis/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_blockNumber`](/rpc-service/chains/chains-api/gnosis/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/gnosis/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/gnosis/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/gnosis/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/gnosis/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/gnosis/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/gnosis/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/gnosis/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/gnosis/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/gnosis/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/gnosis/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/gnosis/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/gnosis/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/gnosis/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/gnosis/web3/#eth_gasprice) - [`eth_blockNumber`](/rpc-service/chains/chains-api/gnosis/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/gnosis/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/gnosis/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/gnosis/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/gnosis/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/gnosis/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/gnosis/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/gnosis/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/gnosis/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/gnosis/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis/web3-p2/ title: Gnosis — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/gnosis/web3-p2.mdx --- # Gnosis — web3, net, eth (2/3) > API reference for [Gnosis](/rpc-service/chains/chains-api/gnosis/). [All methods ->](/rpc-service/chains/chains-api/gnosis/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/gnosis/web3/) · 2 · [3](/rpc-service/chains/chains-api/gnosis/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53b8" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "author": "0xcace5b3c29211740e595850e80478416ee77ca21", "difficulty": "0xfffffffffffffffffffffffffffffffe", "extraData": "0xde830201018f5061726974792d457468657265756d86312e32392e30826c69", "gasLimit": "0x989680", "gasUsed": "0x0", "hash": "0xdd9b627e6f18f92744a6f891f760ee776352fd1100e5929abedd32c181222e0f", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xcace5b3c29211740e595850e80478416ee77ca21", "number": "0x1b4", "parentHash": "0x32d9d5a23b1fcb6ff5357698b73c0f079ddce7cf50785e749df794e30b675472", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "signature": "0x3bb57dd408202a5577c3a6622d713e9b3e305187dc3346c145f0d5770fe96a7c5f023f77942d2c5f608cd9c3ee6e3033394b7681ad017eaa42da476b85402fca01", "size": "0x24b", "stateRoot": "0x79c51798a041161d441b1f857aa7dcff4713ad1b4ab939ae83e410e461bb7666", "step": 307805272, "totalDifficulty": "0x1b3ffffffffffffffffffffffffeda941f4", "timestamp": "0x5bbbadb8", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] }, "id": 1 } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xc5043f", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x00005a74000000fec7bf1f56c60d8fc0903da29d13b8e151c768c8630b999b4c", "blockNumber": "0xc5043f", "from": "0xc473ba887c10ec39533fa734d95be5712c556bb1", "gas": "0x445c0", "gasPrice": "0x2e90edd000", "hash": "0x37c19dd4771fd81cd2d0f3379e47dc4c11ff31f74b771ef631b162db0e0b5167", "input": "0xb3d16931000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000003e63e6ae34fcb270f19fdbe83d506e803fdc402ef650000000000000000000003e5971d049b7bde4ca9192a461708ebb54c8ebc08430000000b53affd05137f800021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000000000000000000000000000000000000000000400000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c8300000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d", "nonce": "0xcd", "to": "0xc6e3567cc9cef8cc243343186cb64b4fc9d7cd0c", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "v": "0x218", "r": "0x6bfc4a999f4f3aeea39a872d3b1a44b5f9dae0ffb27c4bb1e1bbb77a473742ff", "s": "0x5ea8bc05b9de3617dd7242ef263defaea92fa239e0f8695d51e5ae335c21de31" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis/web3-p3/ title: Gnosis — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/gnosis/web3-p3.mdx --- # Gnosis — web3, net, eth (3/3) > API reference for [Gnosis](/rpc-service/chains/chains-api/gnosis/). [All methods ->](/rpc-service/chains/chains-api/gnosis/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/gnosis/web3/) · [2](/rpc-service/chains/chains-api/gnosis/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3c9329b765d88c03d18f87dc1f2b5138c89d9a415d5c73dc7827b87aca176c8e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gnosis/web3/ title: Gnosis — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/gnosis/web3.mdx --- # Gnosis — web3, net, eth (1/3) > API reference for [Gnosis](/rpc-service/chains/chains-api/gnosis/). [All methods ->](/rpc-service/chains/chains-api/gnosis/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/gnosis/web3-p2/) · [3](/rpc-service/chains/chains-api/gnosis/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Nethermind/v1.16.1+644fe89f/linux-x64/dotnet7.0.2", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "100" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x42", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xad731380" } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x19268eb" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2c85c3ecfcb5fb" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x36c1d18"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xb6" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0xc5043f"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/gnosis/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/goat/ title: GOAT description: GOAT Network is a Layer 2 blockchain solution designed to enhance Bitcoin's scalability, transaction speed, and… 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/goat/index.mdx --- # GOAT
> GOAT API is available on [Web3 API platform](https://www.ankr.com/rpc/goat). GOAT Network is a Layer 2 blockchain solution designed to enhance Bitcoin's scalability, transaction speed, and functionality. By operating atop Bitcoin's primary blockchain (Layer 1), it aims to transform Bitcoin from a passive asset into an active participant in decentralized finance (DeFi), enabling users to earn sustainable yields on their BTC holdings. In order for your Web3 application to interact with GOAT — either by reading blockchain data or sending transactions to the network — it must connect to a GOAT node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/goat/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/goat/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/goat/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/goat/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/goat/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/goat/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/goat/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/goat/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/goat/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/goat/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/goat/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/goat/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/goat/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/goat/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/goat/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/goat/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/goat/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/goat/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/goat/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/goat/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/goat/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/goat/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/goat/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/goat/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/goat/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/goat/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/goat/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/goat/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/goat/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/goat/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/goat/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/goat/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/goat/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/goat/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/goat/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/goat/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/goat/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/goat/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/goat/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/goat/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/goat/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/goat/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/goat/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/goat/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/goat/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/goat/web3-p2/ title: GOAT — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/goat/web3-p2.mdx --- # GOAT — web3, net, eth (2/3) > API reference for [GOAT](/rpc-service/chains/chains-api/goat/). [All methods ->](/rpc-service/chains/chains-api/goat/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/goat/web3/) · 2 · [3](/rpc-service/chains/chains-api/goat/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0xa482AE7d753b33cB06Fd6872443E902cB6BEe592", "data": "0x70a082310000000000000000000000005a93a3f8c5e3eae603b36e3e0805a2e2290b1e82" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x0a803103e3d8add36912289278ee282dc917c968d3becd61af0766086cf62584", false], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "baseFeePerGas": "0x7", "blobGasUsed": "0x0", "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0x0056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "gasLimit": "0x1c9c380", "gasUsed": "0x5208", "hash": "0x0a803103e3d8add36912289278ee282dc917c968d3becd61af0766086cf62584", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x9f5a293be75cab701cd199a4fa97cb12703b1d03", "mixHash": "0x0785fc01df0072f88a1724ed15856f19aa6cf37b912a601ab700ec796accb81c", "nonce": "0x0000000000000000", "number": "0x7deb6", "parentBeaconBlockRoot": "0x98f3080c4d6bd9925ba72d2413b5d8840a23f0c22b30e47fe542644989591530", "parentHash": "0xf29453dcfd3d98cf6548ce1821b5297ef22b5b2d4695c3258b468689a2c4f2f4", "receiptsRoot": "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa", "requestsRoot": "0xb1bd483066a9383baa74eec48520e0cf0fb5f58d4316b73a241c354ce0ba5baf", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x303", "stateRoot": "0x253d9143a55292d4e843fc11ef7aa09864d802594edbf7e7f6458e59af6d64f7", "timestamp": "0x67502b08", "transactions": [ "0xddadd048ee141619897211ad394dedf0753504f11330373f7818d80b054088ef" ], "transactionsRoot": "0xb59e9656cc8d2a102ba01842521f6ed8f3807f8f8784e65547a862639f1c6e12", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", true], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "baseFeePerGas": "0x7", "blobGasUsed": "0x0", "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0x0056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "gasLimit": "0x1c9c380", "gasUsed": "0x0", "hash": "0xd024a69d8502e84f5049e3e8268439c81ff8f506fe0c4df340b744bf90c571e7", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x5d88d68542f262d52463e962781bc5758fdcde06", "mixHash": "0x6b9655291de8feeb510f74791b48adb97dff0759a1be15b6d6d1b8cfbfc4058b", "nonce": "0x0000000000000000", "number": "0x7e4e5", "parentBeaconBlockRoot": "0x38fabd58ebb680a399d311b16c492f4dd42e115f703fbd39d3149a630e7db0fb", "parentHash": "0xa01ed04a156ddf5a6c5798b5e7f6641a8e6ee791494515bca99e7c54f80c74c6", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "requestsRoot": "0xabc149717b3f8f2c6c8a6942c768f9f3635d5c2c9b838bf099849b6bcd7cf0b7", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x288", "stateRoot": "0x253d9143a55292d4e843fc11ef7aa09864d802594edbf7e7f6458e59af6d64f7", "timestamp": "0x675040c5", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xddadd048ee141619897211ad394dedf0753504f11330373f7818d80b054088ef"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x0a803103e3d8add36912289278ee282dc917c968d3becd61af0766086cf62584", "blockNumber": "0x7deb6", "from": "0xa482ae7d753b33cb06fd6872443e902cb6bee592", "gas": "0x5208", "gasPrice": "0x77359407", "maxFeePerGas": "0x174876e800", "maxPriorityFeePerGas": "0x77359400", "hash": "0xddadd048ee141619897211ad394dedf0753504f11330373f7818d80b054088ef", "input": "0x", "nonce": "0x16", "to": "0x2cd8df8a2edfe83cd2ba6064d23b47736b79fc85", "transactionIndex": "0x0", "value": "0x5af3107a4000", "type": "0x2", "accessList": [], "chainId": "0xbeb0", "v": "0x1", "r": "0x99934731a218345edb7a28088378b7345816133cc3c8eadffbd3e548ba401d4b", "s": "0x4639bdb8564a7a0f945f00172711470f31f5cce3206413273b7e87aa328b0bc3", "yParity": "0x1" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x0a803103e3d8add36912289278ee282dc917c968d3becd61af0766086cf62584", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x0a803103e3d8add36912289278ee282dc917c968d3becd61af0766086cf62584", "blockNumber": "0x7deb6", "from": "0xa482ae7d753b33cb06fd6872443e902cb6bee592", "gas": "0x5208", "gasPrice": "0x77359407", "maxFeePerGas": "0x174876e800", "maxPriorityFeePerGas": "0x77359400", "hash": "0xddadd048ee141619897211ad394dedf0753504f11330373f7818d80b054088ef", "input": "0x", "nonce": "0x16", "to": "0x2cd8df8a2edfe83cd2ba6064d23b47736b79fc85", "transactionIndex": "0x0", "value": "0x5af3107a4000", "type": "0x2", "accessList": [], "chainId": "0xbeb0", "v": "0x1", "r": "0x99934731a218345edb7a28088378b7345816133cc3c8eadffbd3e548ba401d4b", "s": "0x4639bdb8564a7a0f945f00172711470f31f5cce3206413273b7e87aa328b0bc3", "yParity": "0x1" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x7DEB6", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x0a803103e3d8add36912289278ee282dc917c968d3becd61af0766086cf62584", "blockNumber": "0x7deb6", "from": "0xa482ae7d753b33cb06fd6872443e902cb6bee592", "gas": "0x5208", "gasPrice": "0x77359407", "maxFeePerGas": "0x174876e800", "maxPriorityFeePerGas": "0x77359400", "hash": "0xddadd048ee141619897211ad394dedf0753504f11330373f7818d80b054088ef", "input": "0x", "nonce": "0x16", "to": "0x2cd8df8a2edfe83cd2ba6064d23b47736b79fc85", "transactionIndex": "0x0", "value": "0x5af3107a4000", "type": "0x2", "accessList": [], "chainId": "0xbeb0", "v": "0x1", "r": "0x99934731a218345edb7a28088378b7345816133cc3c8eadffbd3e548ba401d4b", "s": "0x4639bdb8564a7a0f945f00172711470f31f5cce3206413273b7e87aa328b0bc3", "yParity": "0x1" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/goat/web3-p3/ title: GOAT — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/goat/web3-p3.mdx --- # GOAT — web3, net, eth (3/3) > API reference for [GOAT](/rpc-service/chains/chains-api/goat/). [All methods ->](/rpc-service/chains/chains-api/goat/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/goat/web3/) · [2](/rpc-service/chains/chains-api/goat/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xddadd048ee141619897211ad394dedf0753504f11330373f7818d80b054088ef"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x0a803103e3d8add36912289278ee282dc917c968d3becd61af0766086cf62584", "blockNumber": "0x7deb6", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x77359407", "from": "0xa482ae7d753b33cb06fd6872443e902cb6bee592", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x2cd8df8a2edfe83cd2ba6064d23b47736b79fc85", "transactionHash": "0xddadd048ee141619897211ad394dedf0753504f11330373f7818d80b054088ef", "transactionIndex": "0x0", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x7e7e37b5a654e07548d54c2f8c28796b901a1202cf7979758e6b249f34d4dbbf", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "fromBlock": "0x1", "toBlock": "latest", "address": "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" ] } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/goat/web3/ title: GOAT — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/goat/web3.mdx --- # GOAT — web3, net, eth (1/3) > API reference for [GOAT](/rpc-service/chains/chains-api/goat/). [All methods ->](/rpc-service/chains/chains-api/goat/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/goat/web3-p2/) · [3](/rpc-service/chains/chains-api/goat/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v1.14.12-stable/linux-amd64/go1.23.3", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "48816" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x186a7" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7e407" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x2Cd8DF8a2eDfe83cD2ba6064D23B47736B79fC85", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5af3107a4000" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x2Cd8DF8a2eDfe83cD2ba6064D23B47736B79fC85", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x2Cd8DF8a2eDfe83cD2ba6064D23B47736B79fC85", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x0a803103e3d8add36912289278ee282dc917c968d3becd61af0766086cf62584"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x7DEB6"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x0a803103e3d8add36912289278ee282dc917c968d3becd61af0766086cf62584"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x2Cd8DF8a2eDfe83cD2ba6064D23B47736B79fC85", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/goat/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["hex_signed_transaction"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x2Cd8DF8a2eDfe83cD2ba6064D23B47736B79fC85", "data": "0x70a082310000000000000000000000005a93a3f8c5e3eae603b36e3e0805a2e2290b1e82" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gravity/eth/ title: Gravity — eth, debug source: docs/rpc-service/chains/chains-api/gravity/eth.mdx --- # Gravity — eth, debug > API reference for [Gravity](/rpc-service/chains/chains-api/gravity/). [All methods ->](/rpc-service/chains/chains-api/gravity/#methods) ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0x1E8480", "toBlock": "0x1E8481", "address": "0xb2D0A71509A77E7A4B485E40882997701A3554b8", "topics": [] }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Gravity blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0x1b60e17d9a28db0d43cbb64d46de40b96fad0d5fe3d209dba9ef099d26c85d35", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0x6d45a4e56001af4c5b92ff6859ee10a81555c5c9d24df6d33af899b8673e6c66", "result": { "beforeEVMTransfers": [], "afterEVMTransfers": [], "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasUsed": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "input": "0x6bf6a42d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001391c0c0000000000000000000000000000000000000000000000000000000000029e280000000000000000000000000000000000000000000000000000000000000000", "value": "0x0", "type": "CALL" } } ] } ``` --- ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Gravity blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0x29E28", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0x6d45a4e56001af4c5b92ff6859ee10a81555c5c9d24df6d33af899b8673e6c66", "result": { "beforeEVMTransfers": [], "afterEVMTransfers": [], "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasUsed": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "input": "0x6bf6a42d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001391c0c0000000000000000000000000000000000000000000000000000000000029e280000000000000000000000000000000000000000000000000000000000000000", "value": "0x0", "type": "CALL" } } ] } ``` --- ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Gravity blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gravity/ title: Gravity description: Gravity is a Layer 1 blockchain designed for mass adoption and an omnichain future. 30 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/gravity/index.mdx --- # Gravity
> Gravity API is available on [Web3 API platform](https://www.ankr.com/rpc/gravity). *Gravity* is a Layer 1 blockchain designed for mass adoption and an omnichain future. Gravity features the following key points: * **Cross-Chain Transactions**: Gravity enables developers to define and settle transactions across multiple blockchains, enhancing efficiency and security. * **Efficient Verification**: With cost-efficient ZKP verification, Gravity ensures economical and secure transactions. * **Enhanced User Experience**: Gravity introduces cryptographic primitives like the secp256r1 curve through precompiled contracts, allowing for cost-effective passkey authentication for Account Abstraction wallets. * **High-Performance Execution**: Gravity integrates the Reth execution layer and the Jolteon consensus algorithm, providing high throughput and near-instant finality. * **Secure and Robust PoS Mechanism**: Powered by G token staking and restaking protocols like Babylon and EigenLayer, Gravity's PoS design incentivizes and unites a diverse community to secure the chain. * **EVM-Compatible**: Gravity is fully EVM-compatible, enabling seamless deployment and interaction with smart contracts. In order for your Web3 application to interact with Gravity — either by reading blockchain data or sending transactions to the network — it must connect to a Gravity node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/gravity/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/gravity/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/gravity/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/gravity/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/gravity/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/gravity/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/gravity/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/gravity/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/gravity/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/gravity/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/gravity/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/gravity/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/gravity/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/gravity/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/gravity/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/gravity/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/gravity/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/gravity/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/gravity/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/gravity/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/gravity/eth/#eth_getlogs) — returns logs matching the parameters specified. **Premium-only methods**: * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/gravity/eth/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/gravity/eth/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/gravity/eth/#debug_traceblock) — traces the execution of all transactions within a block. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/gravity/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/gravity/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/gravity/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/gravity/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/gravity/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/gravity/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/gravity/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/gravity/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/gravity/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/gravity/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/gravity/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/gravity/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/gravity/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/gravity/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/gravity/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/gravity/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/gravity/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/gravity/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/gravity/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/gravity/web3-p3/#eth_getunclebyblockhashandindex) ### eth, debug - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/gravity/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/gravity/eth/#eth_getlogs) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/gravity/eth/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/gravity/eth/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/gravity/eth/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gravity/web3-p2/ title: Gravity — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/gravity/web3-p2.mdx --- # Gravity — web3, net, eth (2/3) > API reference for [Gravity](/rpc-service/chains/chains-api/gravity/). [All methods ->](/rpc-service/chains/chains-api/gravity/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/gravity/web3/) · 2 · [3](/rpc-service/chains/chains-api/gravity/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{ "to": "0x5c2ed810328349100A66B82b78a1791B101C9D61", "value": "0x0", "data": "0xa9059cbb000000000000000000000000d8dA6BF26964aF9D7eEd9e03E53415D37aA960450000000000000000000000000000000000000000000000000000000000000003e8" }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5454" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xcbf8df8ecb51f5aaf10c606a0a3ad9586767ecd2e9d019ef2d3cd5692bbe8cf8", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x989680", "difficulty": "0x1", "extraData": "0x128d8afc6ce0ec45e6edc0be87d687938952277fa63e1d7906b25e905f87e6fc", "gasLimit": "0x4000000000000", "gasUsed": "0x9495", "hash": "0xcbf8df8ecb51f5aaf10c606a0a3ad9586767ecd2e9d019ef2d3cd5692bbe8cf8", "l1BlockNumber": "0x134d898", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xa4b000000000000000000073657175656e636572", "mixHash": "0x0000000000000006000000000134d89800000000000000140000000000000000", "nonce": "0x0000000000000022", "number": "0x3233", "parentHash": "0xe38848ff195e0b54934eb4974589dec56e99dcdb8e3885c3d11e11403a2c5391", "receiptsRoot": "0x226f8d2746e925e5d108e81674c8c1708205ea3b42624071a2aeca983fd93ef5", "sendCount": "0x6", "sendRoot": "0x128d8afc6ce0ec45e6edc0be87d687938952277fa63e1d7906b25e905f87e6fc", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3e7", "stateRoot": "0x0cb3cbb4eaf982e73f8a4ad8ffe59e40a3b159184aeac23885df9d18ccd8be00", "timestamp": "0x6687f1dd", "totalDifficulty": "0x3234", "transactions": [ "0x4add785f1128b92cb7bd385996974b5964d9d690b9f61947bb8d18e236286682", "0x55a85827bb05dd69e55b9da99a63afda99120eb9f4dd2e1e9658be4d9cc48004" ], "transactionsRoot": "0xaf601d8b8304200c005f69c98bea08e2fc0032cdb73d8e7d09210c9358bd4736", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x989680", "difficulty": "0x1", "extraData": "0x128d8afc6ce0ec45e6edc0be87d687938952277fa63e1d7906b25e905f87e6fc", "gasLimit": "0x4000000000000", "gasUsed": "0x9489", "hash": "0x3e6da4cba1b96d41502cda6bf781d75a5d735ccc43b7d79a09350a93b22d6892", "l1BlockNumber": "0x134d8e2", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xa4b000000000000000000073657175656e636572", "mixHash": "0x0000000000000006000000000134d8e200000000000000140000000000000000", "nonce": "0x0000000000000022", "number": "0x323c", "parentHash": "0x1c012f8b9637458da4b109889b81f7748b1ecebc3361a75fd83039c890310c50", "receiptsRoot": "0x286f0bf63363c874f5af9cd61801f2d95a43bc57b5f2669a6c6eef769647d5d8", "sendCount": "0x6", "sendRoot": "0x128d8afc6ce0ec45e6edc0be87d687938952277fa63e1d7906b25e905f87e6fc", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3e7", "stateRoot": "0x8652f9257ae223c17c610f7a92cbca663687adfbad1346068702b8ed4336d9ea", "timestamp": "0x6687f564", "totalDifficulty": "0x323d", "transactions": [ "0xd6f514445c2367601195f5d943150f971d8cc9f6cabb00204d034aed186fb944", "0x8159a01a245ba2adafa241011f89efd4d5ef827b775311463ba101829df7c2ec" ], "transactionsRoot": "0xf91f8b3f83f76391821507de4f0a9e80fcc5de1e958f6025f46a8c270a9872d9", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xd6f514445c2367601195f5d943150f971d8cc9f6cabb00204d034aed186fb944"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x3e6da4cba1b96d41502cda6bf781d75a5d735ccc43b7d79a09350a93b22d6892", "blockNumber": "0x323c", "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasPrice": "0x0", "hash": "0xd6f514445c2367601195f5d943150f971d8cc9f6cabb00204d034aed186fb944", "input": "0x6bf6a42d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000134d8e2000000000000000000000000000000000000000000000000000000000000323c0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "transactionIndex": "0x0", "value": "0x0", "type": "0x6a", "chainId": "0x659", "v": "0x0", "r": "0x0", "s": "0x0" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x3e6da4cba1b96d41502cda6bf781d75a5d735ccc43b7d79a09350a93b22d6892", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x3e6da4cba1b96d41502cda6bf781d75a5d735ccc43b7d79a09350a93b22d6892", "blockNumber": "0x323c", "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasPrice": "0x0", "hash": "0xd6f514445c2367601195f5d943150f971d8cc9f6cabb00204d034aed186fb944", "input": "0x6bf6a42d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000134d8e2000000000000000000000000000000000000000000000000000000000000323c0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "transactionIndex": "0x0", "value": "0x0", "type": "0x6a", "chainId": "0x659", "v": "0x0", "r": "0x0", "s": "0x0" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x3e6da4cba1b96d41502cda6bf781d75a5d735ccc43b7d79a09350a93b22d6892", "blockNumber": "0x323c", "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasPrice": "0x0", "hash": "0xd6f514445c2367601195f5d943150f971d8cc9f6cabb00204d034aed186fb944", "input": "0x6bf6a42d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000134d8e2000000000000000000000000000000000000000000000000000000000000323c0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "transactionIndex": "0x0", "value": "0x0", "type": "0x6a", "chainId": "0x659", "v": "0x0", "r": "0x0", "s": "0x0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gravity/web3-p3/ title: Gravity — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/gravity/web3-p3.mdx --- # Gravity — web3, net, eth (3/3) > API reference for [Gravity](/rpc-service/chains/chains-api/gravity/). [All methods ->](/rpc-service/chains/chains-api/gravity/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/gravity/web3/) · [2](/rpc-service/chains/chains-api/gravity/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xcbf8df8ecb51f5aaf10c606a0a3ad9586767ecd2e9d019ef2d3cd5692bbe8cf8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6429e98ac2774c3062b81d7575fe7d1bc837b45fc5f4c9b468cf49815e9fcfc", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/gravity/web3/ title: Gravity — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/gravity/web3.mdx --- # Gravity — web3, net, eth (1/3) > API reference for [Gravity](/rpc-service/chains/chains-api/gravity/). [All methods ->](/rpc-service/chains/chains-api/gravity/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/gravity/web3-p2/) · [3](/rpc-service/chains/chains-api/gravity/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "nitro/v2.3.3-6a1c1a7/linux-amd64/go1.20.1", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1625" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x989680" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2ba9" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x840bb8d233bfBf58658A57b85A74F4b8a57B555D", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xcbf8df8ecb51f5aaf10c606a0a3ad9586767ecd2e9d019ef2d3cd5692bbe8cf8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xcbf8df8ecb51f5aaf10c606a0a3ad9586767ecd2e9d019ef2d3cd5692bbe8cf8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x1234567890abcdef1234567890abcdef12345678", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/gravity/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/gravity/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{ "to": "0x5c2ed810328349100A66B82b78a1791B101C9D61", "data": "0x70a08231000000000000000000000000d8dA6BF26964aF9D7eEd9e03E53415D37aA96045" }, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/harmony/ title: Harmony description: Harmony is a powerful EVM-compatible blockchain with sharding and staking features. 23 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/harmony/index.mdx --- # Harmony
> Harmony API is available on [Web3 API platform](https://www.ankr.com/rpc/harmony). *Harmony* is a powerful EVM-compatible blockchain with sharding and staking features. Developing on Harmony should be familiar for Ethereum developers, as it is fully Ethereum compatible and inherits almost all the tools and libraries from Ethereum, like Truffle, Remix, web3.js, etc. In order for your Web3 application to interact with Harmony — either by reading blockchain data or sending transactions to the network — it must connect to a Harmony node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/harmony/web3/#web3_clientversion) — returns the current client version. * [`net_version`](/rpc-service/chains/chains-api/harmony/web3/#net_version) — returns the current network ID. * [`eth_protocolversion`](/rpc-service/chains/chains-api/harmony/web3/#eth_protocolversion) — returns the current Ethereum protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/harmony/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/harmony/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/harmony/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/harmony/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/harmony/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/harmony/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/harmony/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/harmony/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/harmony/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getCode`](/rpc-service/chains/chains-api/harmony/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/harmony/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/harmony/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/harmony/web3/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getLogs`](/rpc-service/chains/chains-api/harmony/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/harmony/web3/#web3_clientversion) - [`net_version`](/rpc-service/chains/chains-api/harmony/web3/#net_version) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/harmony/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/harmony/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/harmony/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/harmony/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/harmony/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/harmony/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/harmony/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/harmony/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/harmony/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/harmony/web3/#eth_getblocktransactioncountbynumber) - [`eth_getCode`](/rpc-service/chains/chains-api/harmony/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/harmony/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/harmony/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/harmony/web3/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_gettransactionreceipt) - [`eth_getLogs`](/rpc-service/chains/chains-api/harmony/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/harmony/web3-p2/ title: Harmony — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/harmony/web3-p2.mdx --- # Harmony — web3, net, eth (2/3) > API reference for [Harmony](/rpc-service/chains/chains-api/harmony/). [All methods ->](/rpc-service/chains/chains-api/harmony/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/harmony/web3/) · 2 · [3](/rpc-service/chains/chains-api/harmony/web3-p3/) ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "author": "0xcace5b3c29211740e595850e80478416ee77ca21", "difficulty": "0xfffffffffffffffffffffffffffffffe", "extraData": "0xde830201018f5061726974792d457468657265756d86312e32392e30826c69", "gasLimit": "0x989680", "gasUsed": "0x0", "hash": "0xdd9b627e6f18f92744a6f891f760ee776352fd1100e5929abedd32c181222e0f", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xcace5b3c29211740e595850e80478416ee77ca21", "number": "0x1b4", "parentHash": "0x32d9d5a23b1fcb6ff5357698b73c0f079ddce7cf50785e749df794e30b675472", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "signature": "0x3bb57dd408202a5577c3a6622d713e9b3e305187dc3346c145f0d5770fe96a7c5f023f77942d2c5f608cd9c3ee6e3033394b7681ad017eaa42da476b85402fca01", "size": "0x24b", "stateRoot": "0x79c51798a041161d441b1f857aa7dcff4713ad1b4ab939ae83e410e461bb7666", "step": 307805272, "totalDifficulty": "0x1b3ffffffffffffffffffffffffeda941f4", "timestamp": "0x5bbbadb8", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] }, "id": 1 } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xc5043f", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x00005a74000000fec7bf1f56c60d8fc0903da29d13b8e151c768c8630b999b4c", "blockNumber": "0xc5043f", "from": "0xc473ba887c10ec39533fa734d95be5712c556bb1", "gas": "0x445c0", "gasPrice": "0x2e90edd000", "hash": "0x37c19dd4771fd81cd2d0f3379e47dc4c11ff31f74b771ef631b162db0e0b5167", "input": "0xb3d16931000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000003e63e6ae34fcb270f19fdbe83d506e803fdc402ef650000000000000000000003e5971d049b7bde4ca9192a461708ebb54c8ebc08430000000b53affd05137f800021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000000000000000000000000000000000000000000400000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c8300000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d", "nonce": "0xcd", "to": "0xc6e3567cc9cef8cc243343186cb64b4fc9d7cd0c", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "v": "0x218", "r": "0x6bfc4a999f4f3aeea39a872d3b1a44b5f9dae0ffb27c4bb1e1bbb77a473742ff", "s": "0x5ea8bc05b9de3617dd7242ef263defaea92fa239e0f8695d51e5ae335c21de31" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3c9329b765d88c03d18f87dc1f2b5138c89d9a415d5c73dc7827b87aca176c8e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/harmony/web3-p3/ title: Harmony — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/harmony/web3-p3.mdx --- # Harmony — web3, net, eth (3/3) > API reference for [Harmony](/rpc-service/chains/chains-api/harmony/). [All methods ->](/rpc-service/chains/chains-api/harmony/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/harmony/web3/) · [2](/rpc-service/chains/chains-api/harmony/web3-p2/) · 3 ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/harmony/web3/ title: Harmony — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/harmony/web3.mdx --- # Harmony — web3, net, eth (1/3) > API reference for [Harmony](/rpc-service/chains/chains-api/harmony/). [All methods ->](/rpc-service/chains/chains-api/harmony/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/harmony/web3-p2/) · [3](/rpc-service/chains/chains-api/harmony/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Harmony (C) 2023. harmony, version v7647-v4.3.14.rc3-0-g09dba416 (root@ 2023-01-23T16:33:47+0000)" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1666600000" } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x1", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x22ecb25c00" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x23ea004" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2c85c3ecfcb5fb" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x36c1d18"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xb6" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/harmony/web3-p2/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53b8" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/heco/ title: Huobi ECO Chain description: Huobi ECO Chain (HECO) is a decentralized, high-efficiency and energy-saving public chain. 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/heco/index.mdx --- # Huobi ECO Chain
> HECO API is available on [Web3 API platform](https://www.ankr.com/rpc/heco). *Huobi ECO Chain* (HECO) is a decentralized, high-efficiency and energy-saving public chain. It is compatible with smart contracts and supports high- performance transactions. The endogenous token of Heco is HT, and it adopts the HPoS consensus mechanism. Heco will continue to improve the efficiency of Ethereum by Layer2, which will supplement and empower the Ethereum ecosystem. In order for your Web3 application to interact with HECO — either by reading blockchain data or sending transactions to the network — it must connect to a HECO node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/heco/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/heco/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/heco/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/heco/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/heco/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/heco/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/heco/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/heco/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/heco/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/heco/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/heco/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/heco/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/heco/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/heco/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/heco/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/heco/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/heco/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/heco/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/heco/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/heco/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/heco/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/heco/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/heco/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/heco/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/heco/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/heco/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/heco/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/heco/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/heco/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/heco/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/heco/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/heco/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/heco/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/heco/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/heco/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/heco/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/heco/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/heco/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/heco/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/heco/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/heco/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/heco/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/heco/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/heco/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/heco/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/heco/web3-p2/ title: Huobi ECO Chain — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/heco/web3-p2.mdx --- # Huobi ECO Chain — web3, net, eth (2/3) > API reference for [Huobi ECO Chain](/rpc-service/chains/chains-api/heco/). [All methods ->](/rpc-service/chains/chains-api/heco/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/heco/web3/) · 2 · [3](/rpc-service/chains/chains-api/heco/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53b8" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["22991214", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "author": "0xcace5b3c29211740e595850e80478416ee77ca21", "difficulty": "0xfffffffffffffffffffffffffffffffe", "extraData": "0xde830201018f5061726974792d457468657265756d86312e32392e30826c69", "gasLimit": "0x989680", "gasUsed": "0x0", "hash": "0xdd9b627e6f18f92744a6f891f760ee776352fd1100e5929abedd32c181222e0f", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xcace5b3c29211740e595850e80478416ee77ca21", "number": "0x1b4", "parentHash": "0x32d9d5a23b1fcb6ff5357698b73c0f079ddce7cf50785e749df794e30b675472", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "signature": "0x3bb57dd408202a5577c3a6622d713e9b3e305187dc3346c145f0d5770fe96a7c5f023f77942d2c5f608cd9c3ee6e3033394b7681ad017eaa42da476b85402fca01", "size": "0x24b", "stateRoot": "0x79c51798a041161d441b1f857aa7dcff4713ad1b4ab939ae83e410e461bb7666", "step": 307805272, "totalDifficulty": "0x1b3ffffffffffffffffffffffffeda941f4", "timestamp": "0x5bbbadb8", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] }, "id": 1 } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x1d43223707877aeed74baf3aa6892d789293ca7c1ee1cc32ef960b8f72b11273"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1d43223707877aeed74baf3aa6892d789293ca7c1ee1cc32ef960b8f72b11273", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["10674793", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x00005a74000000fec7bf1f56c60d8fc0903da29d13b8e151c768c8630b999b4c", "blockNumber": "0xc5043f", "from": "0xc473ba887c10ec39533fa734d95be5712c556bb1", "gas": "0x445c0", "gasPrice": "0x2e90edd000", "hash": "0x37c19dd4771fd81cd2d0f3379e47dc4c11ff31f74b771ef631b162db0e0b5167", "input": "0xb3d16931000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000003e63e6ae34fcb270f19fdbe83d506e803fdc402ef650000000000000000000003e5971d049b7bde4ca9192a461708ebb54c8ebc08430000000b53affd05137f800021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000000000000000000000000000000000000000000400000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c8300000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d", "nonce": "0xcd", "to": "0xc6e3567cc9cef8cc243343186cb64b4fc9d7cd0c", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "v": "0x218", "r": "0x6bfc4a999f4f3aeea39a872d3b1a44b5f9dae0ffb27c4bb1e1bbb77a473742ff", "s": "0x5ea8bc05b9de3617dd7242ef263defaea92fa239e0f8695d51e5ae335c21de31" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/heco/web3-p3/ title: Huobi ECO Chain — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/heco/web3-p3.mdx --- # Huobi ECO Chain — web3, net, eth (3/3) > API reference for [Huobi ECO Chain](/rpc-service/chains/chains-api/heco/). [All methods ->](/rpc-service/chains/chains-api/heco/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/heco/web3/) · [2](/rpc-service/chains/chains-api/heco/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3c9329b765d88c03d18f87dc1f2b5138c89d9a415d5c73dc7827b87aca176c8e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x1d43223707877aeed74baf3aa6892d789293ca7c1ee1cc32ef960b8f72b11273", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x15ed2ed", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/heco/web3/ title: Huobi ECO Chain — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/heco/web3.mdx --- # Huobi ECO Chain — web3, net, eth (1/3) > API reference for [Huobi ECO Chain](/rpc-service/chains/chains-api/heco/). [All methods ->](/rpc-service/chains/chains-api/heco/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/heco/web3-p2/) · [3](/rpc-service/chains/chains-api/heco/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v1.3.0-unstable-123ccb14-20220815/linux-amd64/go1.19.1", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "128" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "2250000000" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "22989937" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2c85c3ecfcb5fb" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["22991214"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xb6" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1d43223707877aeed74baf3aa6892d789293ca7c1ee1cc32ef960b8f72b11273"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["22991214"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/heco/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/heco/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/horizen-eon/ title: Horizen EON description: Horizen EON — EON is Horizen's Ethereum VM (Virtual Machine). 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/horizen-eon/index.mdx --- # Horizen EON
> Horizen EON API is available on [Web3 API platform](https://www.ankr.com/rpc/horizen). *EON* is Horizen's Ethereum VM (Virtual Machine). EON has adopted Ethereum’s account-based transaction model to represent assets as balances within accounts. The account model, in VM capable blockchains, differentiate account types on whether they represent a normal account balance or an account which is bound to some code that has to be executed by the VM. In order for your Web3 application to interact with Horizen EON — either by reading blockchain data or sending transactions to the network — it must connect to a Horizen EON node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/horizen-eon/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/horizen-eon/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/horizen-eon/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/horizen-eon/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/horizen-eon/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/horizen-eon/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/horizen-eon/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/horizen-eon/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/horizen-eon/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/horizen-eon/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/horizen-eon/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/horizen-eon/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/horizen-eon/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/horizen-eon/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/horizen-eon/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/horizen-eon/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/horizen-eon/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/horizen-eon/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/horizen-eon/web3-p2/ title: Horizen EON — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/horizen-eon/web3-p2.mdx --- # Horizen EON — web3, net, eth (2/3) > API reference for [Horizen EON](/rpc-service/chains/chains-api/horizen-eon/). [All methods ->](/rpc-service/chains/chains-api/horizen-eon/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/horizen-eon/web3/) · 2 · [3](/rpc-service/chains/chains-api/horizen-eon/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei; note that if the value exceeds the `from` address balance (which is 0.000000000000000001 ETH by default), then you'll receive an `insufficient funds` error in response. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0xE5f07530B17CeF98127F21837c04dD3439c9673B"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x54717ffa931111ec225f03e5e2ac38485968c7cff7ad1f314b0018d73721ff5f", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "number": "0x4807a", "hash": "0x54717ffa931111ec225f03e5e2ac38485968c7cff7ad1f314b0018d73721ff5f", "parentHash": "0x72f27ba7917de2cd103469a350ac02686f9d08301f46e7b6dabca3e618a4bc92", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000004000040000000010000000000000000000000000000020000000000000000200000000100000000000000000008000000008000000000000000000000000000000000000000000000000000004000001000001000000000000000000010000100000000000000000000000000000000100000000000000000000000000000000000020000020000000000000002000000000800000100800000000000000800400000000002000000000000000000000000000000000000000000040000000080000010000000000000000000000000000000000000000000010000000000000000", "transactionsRoot": "0xf07bc899c2867ebcf349cecc3ea2054f93a38ad22e17283cb38c1a1158e37abd", "stateRoot": "0x5f4fa0e19149743a1d610716cdcb044d211adbe9e1c70e9f27948346442c0047", "receiptsRoot": "0xfaa52da484430e07651e941f9b16f96fcbbfa2029d1ca48fdde563617fae8655", "miner": "0x144e0fe5e69893577107a15a7c76babd59f0a279", "size": "0x4d1", "gasLimit": "0x989680", "gasUsed": "0x7699b", "timestamp": "0x648994f2", "transactions": [ "0xcc109ad0f4b2987d214ff007f514697e6bd48c37c01d998c75c14551faf436fd" ], "baseFeePerGas": "0x4a817c800", "mixHash": "0x05def608f058f0b2bf503c19ce82741275438061d81dd50a9f844aa75873a537", "uncles": [], "difficulty": "0x0", "totalDifficulty": "0x0", "nonce": "0x0000000000000000", "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "number": "0x47f66", "hash": "0xd7ec09d094ab04d9e83ead36d8c8e1b3ba95e4ff44c1cc6b936c4053d1321d2e", "parentHash": "0xa877091a2f3432e9cf1220fddb0994b191cb41c5bbf4d7455ed7ebe8dcec9e70", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "stateRoot": "0x810bc69199a8b9d4625a84fbbdea7cfd7689b289f2489058dda371338868ff5b", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "miner": "0xeb16c502ea072ffc4f71eb877c2bd1e58645c9db", "size": "0x397", "gasLimit": "0x989680", "gasUsed": "0x0", "timestamp": "0x64898022", "transactions": [], "baseFeePerGas": "0x4a817c800", "mixHash": "0x027914fe18ea2a6c9edafb465edcb1ea66bd9a1097393f00de967796e402461d", "uncles": [], "difficulty": "0x0", "totalDifficulty": "0x0", "nonce": "0x0000000000000000", "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x0dd2ed8c715c996696cb22f88e15bcd2e2e11aa07d20afbde771d09ae794c9e8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "blockNumber": "0x3c755c", "from": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "gas": "0x186a0", "gasPrice": "0x0", "hash": "0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b", "input": "0x", "nonce": "0x0", "to": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f", "transactionIndex": "0x2", "value": "0x21ec894ca2f7b800", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x4b34328ff3466ddda82a19e849e6724e03cae75075709ec600c7d8bf6c7b5e9b", "mint": "0x21ec894ca2f7b800" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x54717ffa931111ec225f03e5e2ac38485968c7cff7ad1f314b0018d73721ff5f", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "blockNumber": "0x3c755c", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0x8f0d180", "gasPrice": "0x0", "hash": "0xf14686c9327d897ab5b0754b18cea248cf08a9caa3c9d7c98e73690d46d2cb39", "input": "0x015d8eb90000000000000000000000000000000000000000000000000000000000885554000000000000000000000000000000000000000000000000000000006452579400000000000000000000000000000000000000000000000000000009abdfc80badc6a92f7b910d6eb19519df02d5f553acf1916705b5c8ffc363f19eae6378bb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d679b567db6187c0c8323fa982cfb88b74dbcc7000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240", "nonce": "0x0", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x8d211d9a6c156ad43a3330c0f07904f319936ae4eadf6d57cce64c1f52a569b1", "mint": "0x0", "isSystemTx": true } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa72d3db5dc554ec1eee6be321d3d7fa5eadf68ef19e1ddba2cbdde65bd049325", "blockNumber": "0x3c764e", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0x8f0d180", "gasPrice": "0x0", "hash": "0xfa21b7302972609248949646b06703f94010c724f1565949da1e050a56672504", "input": "0x015d8eb9000000000000000000000000000000000000000000000000000000000088557000000000000000000000000000000000000000000000000000000000645259680000000000000000000000000000000000000000000000000000000d6a1b7750abf0a584e9f633edf00ea6ca61d6a845313965c3f39426e66ed959ba18f1c6d900000000000000000000000000000000000000000000000000000000000000020000000000000000000000002d679b567db6187c0c8323fa982cfb88b74dbcc7000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240", "nonce": "0x0", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x0d55c4a6698e3facccbb99f7d27a091886a9c4286c36f2789b850b70e7f83a0c", "mint": "0x0", "isSystemTx": true } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/horizen-eon/web3-p3/ title: Horizen EON — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/horizen-eon/web3-p3.mdx --- # Horizen EON — web3, net, eth (3/3) > API reference for [Horizen EON](/rpc-service/chains/chains-api/horizen-eon/). [All methods ->](/rpc-service/chains/chains-api/horizen-eon/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/horizen-eon/web3/) · [2](/rpc-service/chains/chains-api/horizen-eon/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x205f41f2fab243e66c23d41dcfd7ee1d366a62604dec86f08a346f51bbe0be52"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe56339767512b66d995d7c675bb27f4acda80dc2202e10c114a1e1b67b73b706", "blockNumber": "0x47508", "transactionIndex": "0x0", "transactionHash": "0x205f41f2fab243e66c23d41dcfd7ee1d366a62604dec86f08a346f51bbe0be52", "type": "0x2", "from": "0x58fb5d1b41c89fd26e293c519f8d60d8607d1d8b", "to": "0x1dc08285d1a81a9795dd9beafb3344cf89e8168b", "effectiveGasPrice": "0x5017ff700", "contractAddress": null, "logs": [ { "address": "0x593baa143e70517c1e07c5fc311e91d52af34cdd", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x00000000000000000000000058fb5d1b41c89fd26e293c519f8d60d8607d1d8b", "0x0000000000000000000000001dc08285d1a81a9795dd9beafb3344cf89e8168b" ], "data": "0x00000000000000000000000000000000000000000000000e31ed26bc6d2d2800", "blockHash": "0xe56339767512b66d995d7c675bb27f4acda80dc2202e10c114a1e1b67b73b706", "blockNumber": "0x47508", "transactionHash": "0x205f41f2fab243e66c23d41dcfd7ee1d366a62604dec86f08a346f51bbe0be52", "transactionIndex": "0x0", "logIndex": "0x0", "removed": false }, { "address": "0x593baa143e70517c1e07c5fc311e91d52af34cdd", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000058fb5d1b41c89fd26e293c519f8d60d8607d1d8b", "0x0000000000000000000000001dc08285d1a81a9795dd9beafb3344cf89e8168b" ], "data": "0x00000000000000000000000000000000000000000000000e31ed26bc6d2d2800", "blockHash": "0xe56339767512b66d995d7c675bb27f4acda80dc2202e10c114a1e1b67b73b706", "blockNumber": "0x47508", "transactionHash": "0x205f41f2fab243e66c23d41dcfd7ee1d366a62604dec86f08a346f51bbe0be52", "transactionIndex": "0x0", "logIndex": "0x1", "removed": false }, { "address": "0x1dc08285d1a81a9795dd9beafb3344cf89e8168b", "topics": [ "0x1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90" ], "data": "0x00000000000000000000000058fb5d1b41c89fd26e293c519f8d60d8607d1d8b00000000000000000000000000000000000000000000000e31ed26bc6d2d28000000000000000000000000000000000000000000000000000000000000004c41", "blockHash": "0xe56339767512b66d995d7c675bb27f4acda80dc2202e10c114a1e1b67b73b706", "blockNumber": "0x47508", "transactionHash": "0x205f41f2fab243e66c23d41dcfd7ee1d366a62604dec86f08a346f51bbe0be52", "transactionIndex": "0x0", "logIndex": "0x2", "removed": false } ], "logsBloom": "0x00000000000040000000000000000000000000000000000000100000000200000020000000000000000000000000000000000000000000000000000000200000000000000400000000000008000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000010200008000000100000000000000004000000000010000000000000000000000000020000020000000000000000000000010000000000000000000000000000000000000000000002000000000000000000000000000000000000002000000000000002000010000000000000000000000000000000000000000000000000000000000000", "gasUsed": "0xeb159", "cumulativeGasUsed": "0xeb159", "status": "0x1" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xe56339767512b66d995d7c675bb27f4acda80dc2202e10c114a1e1b67b73b706", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x58FB5d1b41C89fd26E293c519F8d60d8607D1D8b"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/horizen-eon/web3/ title: Horizen EON — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/horizen-eon/web3.mdx --- # Horizen EON — web3, net, eth (1/3) > API reference for [Horizen EON](/rpc-service/chains/chains-api/horizen-eon/). [All methods ->](/rpc-service/chains/chains-api/horizen-eon/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/horizen-eon/web3-p2/) · [3](/rpc-service/chains/chains-api/horizen-eon/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "scaling-services-sidechains-sdk/0.7.0-SNAPSHOT/amd64/jdk11" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1663" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4a817c800" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47f66" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x94E7358492C968FCA9D984aB507067Ea734233Ce", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x46bb5369701C44E3F1a78825A5E55743B0D81401", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x46bb5369701C44E3F1a78825A5E55743B0D81401", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xa6605c5de56b85486a5fe129a09765e889de245edec839fe9474e7c939d9fc97"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x8" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x6b8946b4b037a1dd6e641ce45f784d35279f035811e97770b63ac5fa8f8effcc"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xB0B376f61da13a3295190699a24CbC5201165430", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/horizen-eon/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0xE5f07530B17CeF98127F21837c04dD3439c9673B","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota-evm/ title: Iota EVM description: Iota EVM is a Layer 2 solution that operates on top of the Iota Mainnet. 27 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/iota-evm/index.mdx --- # Iota EVM
> Iota EVM API is available on [Web3 API platform](https://www.ankr.com/rpc/iota_evm). *Iota EVM* is a Layer 2 solution that operates on top of the Iota Mainnet. It is part of the broader Iota Smart Contracts (ISC) framework, which provides smart contract functionality on Iota. It leverages the Iota Tangle's scalability and security while providing an environment for running decentralized applications (dApps). In order for your Web3 application to interact with Iota EVM — either by reading blockchain data or sending transactions to the network — it must connect to an Iota EVM node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/iota-evm/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/iota-evm/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/iota-evm/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/iota-evm/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/iota-evm/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/iota-evm/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/iota-evm/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/iota-evm/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/iota-evm/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/iota-evm/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/iota-evm/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/iota-evm/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/iota-evm/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/iota-evm/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/iota-evm/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/iota-evm/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota-evm/web3-p2/ title: Iota EVM — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/iota-evm/web3-p2.mdx --- # Iota EVM — web3, net, eth (2/3) > API reference for [Iota EVM](/rpc-service/chains/chains-api/iota-evm/). [All methods ->](/rpc-service/chains/chains-api/iota-evm/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/iota-evm/web3/) · 2 · [3](/rpc-service/chains/chains-api/iota-evm/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0x1Cf9D01E066b955B2f74779a6e5A21AF410f6c28", "to": "0x61FbDc17240c951701313BFC93E8134Fcf2e25Bb", "data": "0xa9059cbb000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf90000000000000000000000000000000000000000000000000000000000000064" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5444" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x3b9aca00", "gasUsed": "0x62f5a", "hash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "logsBloom": "0x00000000000000000000000000000000000000080000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000001000000000000000008000000400002000000000008000000008000000000000080020000000000000000000800000020000000000000000010000000000000000000000000000000000000000000000001000000000000000000000000000000000000000100000000000000200000000000000000000000000800000000000006000000000000000000000000000402000000000000000000000020000000000000002000000000000000000000000400000000400000004000001000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x4aeaf7", "parentHash": "0x5a306fff79c7e91c825f35829838174f9b9f51dbba575b1ad8c1f0bd4a1a786a", "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x41e", "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": "0x67b5c5ff", "totalDifficulty": "0x0", "transactions": [ "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf" ], "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x4AEAF7", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x3b9aca00", "gasUsed": "0x62f5a", "hash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "logsBloom": "0x00000000000000000000000000000000000000080000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000001000000000000000008000000400002000000000008000000008000000000000080020000000000000000000800000020000000000000000010000000000000000000000000000000000000000000000001000000000000000000000000000000000000000100000000000000200000000000000000000000000800000000000006000000000000000000000000000402000000000000000000000020000000000000002000000000000000000000000400000000400000004000001000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x4aeaf7", "parentHash": "0x5a306fff79c7e91c825f35829838174f9b9f51dbba575b1ad8c1f0bd4a1a786a", "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x41e", "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": "0x67b5c5ff", "totalDifficulty": "0x0", "transactions": [ "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf" ], "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "blockNumber": "0x4aeaf7", "from": "0x71d4507b876552607bc8ef6438e7a6af9ec475e7", "gas": "0x128e0e", "gasPrice": "0x2540be400", "hash": "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf", "input": "0xf2ae372f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000006e47f8d48a01b44df3fff35d258a10a3aedc114c00000000000000000000000000000000000000000000000000000000004c4b400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012e7e4574083b0c9f46471bf4c000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000002cff4df0600d7f0a132200000000000000000000000000000000000000000000000000000001c6bf526340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000fbda5f676cb37624f28265a144a48b0d6e87d3b60000000000000000000000006e47f8d48a01b44df3fff35d258a10a3aedc114c", "nonce": "0x2e0", "to": "0xe4fc778e1372e0e62665058aefff31032c0aebc9", "transactionIndex": "0x0", "value": "0x1c6bf526340000", "v": "0x450f", "r": "0xeade9297a2e657ba934356424aeda04b7210a9f096cfce17bc0fc27d3c90547a", "s": "0x7e319f6a7e982f642e581c8a284020089b40aac5e66a4837f93dde5e211c544" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "0x0" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "blockNumber": "0x4aeaf7", "from": "0x71d4507b876552607bc8ef6438e7a6af9ec475e7", "gas": "0x128e0e", "gasPrice": "0x2540be400", "hash": "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf", "input": "0xf2ae372f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000006e47f8d48a01b44df3fff35d258a10a3aedc114c00000000000000000000000000000000000000000000000000000000004c4b400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012e7e4574083b0c9f46471bf4c000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000002cff4df0600d7f0a132200000000000000000000000000000000000000000000000000000001c6bf526340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000fbda5f676cb37624f28265a144a48b0d6e87d3b60000000000000000000000006e47f8d48a01b44df3fff35d258a10a3aedc114c", "nonce": "0x2e0", "to": "0xe4fc778e1372e0e62665058aefff31032c0aebc9", "transactionIndex": "0x0", "value": "0x1c6bf526340000", "v": "0x450f", "r": "0xeade9297a2e657ba934356424aeda04b7210a9f096cfce17bc0fc27d3c90547a", "s": "0x7e319f6a7e982f642e581c8a284020089b40aac5e66a4837f93dde5e211c544" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x4AEAF7", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "blockNumber": "0x4aeaf7", "from": "0x71d4507b876552607bc8ef6438e7a6af9ec475e7", "gas": "0x128e0e", "gasPrice": "0x2540be400", "hash": "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf", "input": "0xf2ae372f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000006e47f8d48a01b44df3fff35d258a10a3aedc114c00000000000000000000000000000000000000000000000000000000004c4b400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012e7e4574083b0c9f46471bf4c000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000002cff4df0600d7f0a132200000000000000000000000000000000000000000000000000000001c6bf526340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000fbda5f676cb37624f28265a144a48b0d6e87d3b60000000000000000000000006e47f8d48a01b44df3fff35d258a10a3aedc114c", "nonce": "0x2e0", "to": "0xe4fc778e1372e0e62665058aefff31032c0aebc9", "transactionIndex": "0x0", "value": "0x1c6bf526340000", "v": "0x450f", "r": "0xeade9297a2e657ba934356424aeda04b7210a9f096cfce17bc0fc27d3c90547a", "s": "0x7e319f6a7e982f642e581c8a284020089b40aac5e66a4837f93dde5e211c544" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota-evm/web3-p3/ title: Iota EVM — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/iota-evm/web3-p3.mdx --- # Iota EVM — web3, net, eth (3/3) > API reference for [Iota EVM](/rpc-service/chains/chains-api/iota-evm/). [All methods ->](/rpc-service/chains/chains-api/iota-evm/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/iota-evm/web3/) · [2](/rpc-service/chains/chains-api/iota-evm/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "blockNumber": "0x4aeaf7", "contractAddress": null, "cumulativeGasUsed": "0x62f5a", "effectiveGasPrice": "0x2540be400", "from": "0x71d4507b876552607bc8ef6438e7a6af9ec475e7", "gasUsed": "0x62f5a", "logs": [ { "address": "0x6e47f8d48a01b44df3fff35d258a10a3aedc114c", "blockHash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "blockNumber": "0x4aeaf7", "data": "0x000000000000000000000000000000000000000000000000001c6bf526340000", "logIndex": "0x0", "removed": false, "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000e4fc778e1372e0e62665058aefff31032c0aebc9" ], "transactionHash": "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf", "transactionIndex": "0x0" }, { "address": "0x6e47f8d48a01b44df3fff35d258a10a3aedc114c", "blockHash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "blockNumber": "0x4aeaf7", "data": "0x000000000000000000000000000000000000000000000000001c6bf526340000", "logIndex": "0x1", "removed": false, "topics": [ "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", "0x000000000000000000000000e4fc778e1372e0e62665058aefff31032c0aebc9" ], "transactionHash": "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf", "transactionIndex": "0x0" } ], "logsBloom": "0x00000000000000000000000000000000000000080000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000001000000000000000008000000400002000000000008000000008000000000000080020000000000000000000800000020000000000000000010000000000000000000000000000000000000000000000001000000000000000000000000000000000000000100000000000000200000000000000000000000000800000000000006000000000000000000000000000402000000000000000000000020000000000000002000000000000000000000000400000000400000004000001000", "status": "0x1", "to": "0xe4fc778e1372e0e62665058aefff31032c0aebc9", "transactionHash": "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf", "transactionIndex": "0x0", "type": "0x0" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x4AEAF7", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0x4AEAF7", "toBlock": "0x4AEAF8" }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0x6e47f8d48a01b44df3fff35d258a10a3aedc114c", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000e4fc778e1372e0e62665058aefff31032c0aebc9" ], "data": "0x000000000000000000000000000000000000000000000000001c6bf526340000", "blockNumber": "0x4aeaf7", "transactionHash": "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf", "transactionIndex": "0x0", "blockHash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "logIndex": "0x0", "removed": false }, { "address": "0x6e47f8d48a01b44df3fff35d258a10a3aedc114c", "topics": [ "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", "0x000000000000000000000000e4fc778e1372e0e62665058aefff31032c0aebc9" ], "data": "0x000000000000000000000000000000000000000000000000001c6bf526340000", "blockNumber": "0x4aeaf7", "transactionHash": "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf", "transactionIndex": "0x0", "blockHash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "logIndex": "0x1", "removed": false }, { "address": "0xfbda5f676cb37624f28265a144a48b0d6e87d3b6", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000071d4507b876552607bc8ef6438e7a6af9ec475e7", "0x000000000000000000000000e4fc778e1372e0e62665058aefff31032c0aebc9" ], "data": "0x00000000000000000000000000000000000000000000000000000000004c4b40", "blockNumber": "0x4aeaf7", "transactionHash": "0xd05f13c9daab7d26927658c20a61988ecdda27eaac8d08bb2861bee87ba49aaf", "transactionIndex": "0x0", "blockHash": "0xc9412dd29c0704b54c8d71dd906972ece9df172770fda0e07a315d37ac4ec61a", "logIndex": "0x2", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota-evm/web3/ title: Iota EVM — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/iota-evm/web3.mdx --- # Iota EVM — web3, net, eth (1/3) > API reference for [Iota EVM](/rpc-service/chains/chains-api/iota-evm/). [All methods ->](/rpc-service/chains/chains-api/iota-evm/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/iota-evm/web3-p2/) · [3](/rpc-service/chains/chains-api/iota-evm/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "wasp/evmproxy" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "8822" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2540be400" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4abacf" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x7CB153C989e700Dd62dcBc741E43ff0C76b69e0D", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x51fcdb4572505a68" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xb083Df660665DBf1faDDb57e4c1F6d2550569a5d", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x7CB153C989e700Dd62dcBc741E43ff0C76b69e0D", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xd" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb8f116ca07d1fcd46a3f46a3176500065f002febf5472849461cfcb0b394a16b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x4AEAD7"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb8f116ca07d1fcd46a3f46a3176500065f002febf5472849461cfcb0b394a16b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xb083Df660665DBf1faDDb57e4c1F6d2550569a5d", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/iota-evm/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_tx_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x1Cf9D01E066b955B2f74779a6e5A21AF410f6c28", "data": "0x70a08231000000000000000000000000abcdefabcdefabcdefabcdefabcdef" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota/ title: IOTA description: IOTA is a Move-based protocol that provides a decentralized, scalable platform for digital asset management and… 52 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/iota/index.mdx --- # IOTA
> IOTA API is available on [Web3 API platform](https://www.ankr.com/rpc/iota). IOTA is a Move-based protocol that provides a decentralized, scalable platform for digital asset management and smart contracts. Leveraging the Move programming language, IOTA Layer 1 ensures high performance and security for applications deployed on the IOTA Mainnet. In order for your Web3 application to interact with IOTA — either by reading blockchain data or sending transactions to the network — it must connect to an IOTA node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. ## Methods supported **Coin Query**: * [`iotax_getAllBalances`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getallbalances) — retrieves all coin balances for an account. * [`iotax_getAllCoins`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getallcoins) — retrieves all coins held by an account. * [`iotax_getBalance`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getbalance) — retrieves the balance of a specific coin for an account. * [`iotax_getCirculatingSupply`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getcirculatingsupply) — retrieves the circulating supply of a coin. * [`iotax_getCoinMetadata`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getcoinmetadata) — retrieves metadata of a coin (name, symbol, etc.). * [`iotax_getCoins`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getcoins) — retrieves all existing coins. * [`iotax_getTotalSupply`](/rpc-service/chains/chains-api/iota/iotax/#iotax_gettotalsupply) — retrieves the total minted supply of a coin. [//]: # (**Extended**:) [//]: # () [//]: # ( * [`iotax_getAllEpochAddressMetrics`]() — retrieves address metrics for all epochs.) [//]: # ( * [`iotax_getCheckpointAddressMetrics`]() — retrieves address metrics at a specific checkpoint.) [//]: # ( * [`iotax_getCurrentEpoch`]() — retrieves the current epoch.) [//]: # ( * [`iotax_getDynamicFieldObject`]() — retrieves a specific dynamic field object.) [//]: # ( * [`iotax_getDynamicFields`]() — retrieves dynamic fields associated with an object.) [//]: # ( * [`iotax_getEpochMetrics`]() — retrieves network metrics for a given epoch.) [//]: # ( * [`iotax_getEpochs`]() — retrieves a list of past epochs.) [//]: # ( * [`iotax_getLatestAddressMetrics`]() — retrieves the most recent address metrics.) [//]: # ( * [`iotax_getMoveCallMetrics`]() — retrieves metrics related to Move function calls.) [//]: # ( * [`iotax_getNetworkMetrics`]() — retrieves overall network performance metrics.) [//]: # ( * [`iotax_getOwnedObjects`]() — retrieves all objects owned by an address.) [//]: # ( * [`iotax_getTotalTransactions`]() — retrieves the total number of transactions.) [//]: # ( * [`iotax_queryEvents`]() — retrieves events matching specific filters.) [//]: # ( * [`iotax_queryTransactionBlocks`]() — retrieves transaction blocks based on query parameters.) [//]: # ( * [`iotax_subscribeEvent`]() — subscribes to real-time event updates.) [//]: # ( * [`iotax_subscribeTransaction`]() — subscribes to real-time transaction updates.) **Governance Read**: * [`iotax_getCommitteeInfo`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getcommitteeinfo) — retrieves the committee information for the asked `epoch`. * [`iotax_getLatestIotaSystemState`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getlatestiotasystemstate) — retrieves the latest IOTA system state. * [`iotax_getLatestIotaSystemStateV2`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_getlatestiotasystemstatev2) — retrieves the latest IOTA system state (v2 format). * [`iotax_getReferenceGasPrice`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_getreferencegasprice) — retrieves the current reference gas price. * [`iotax_getStakes`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_getstakes) — retrieves all stakes for a given address. * [`iotax_getStakesByIds`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_getstakesbyids) — retrieves stakes by stake object IDs. * [`iotax_getTimelockedStakes`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_gettimelockedstakes) — retrieves all timelocked stakes for an address. * [`iotax_getTimelockedStakesByIds`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_gettimelockedstakesbyids) — retrieves timelocked stakes by object IDs. * [`iotax_getValidatorsApy`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_getvalidatorsapy) — retrieves the annual percentage yield (APY) for validators. **Move Utils**: * [`iota_getMoveFunctionArgTypes`](/rpc-service/chains/chains-api/iota/iotax-p2/#iota_getmovefunctionargtypes) — retrieves argument types for a Move function. * [`iota_getNormalizedMoveFunction`](/rpc-service/chains/chains-api/iota/iotax-p2/#iota_getnormalizedmovefunction) — retrieves normalized representation of a Move function. * [`iota_getNormalizedMoveModule`](/rpc-service/chains/chains-api/iota/iotax-p3/#iota_getnormalizedmovemodule) — retrieves normalized representation of a Move module. * [`iota_getNormalizedMoveModulesByPackage`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getnormalizedmovemodulesbypackage) — retrieves all normalized Move modules in a package. * [`iota_getNormalizedMoveStruct`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getnormalizedmovestruct) — retrieves normalized representation of a Move struct. **Read**: * [`iota_getChainIdentifier`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getchainidentifier) — retrieves the unique identifier of the chain. * [`iota_getCheckpoint`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getcheckpoint) — retrieves a checkpoint by sequence number. * [`iota_getCheckpoints`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getcheckpoints) — retrieves a list of checkpoints. * [`iota_getEvents`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getevents) — retrieves transaction events. * [`iota_getLatestCheckpointSequenceNumber`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getlatestcheckpointsequencenumber) — retrieves the latest checkpoint sequence number. * [`iota_getObject`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getobject) — retrieves object data by ID. * [`iota_getProtocolConfig`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getprotocolconfig) — retrieves the current protocol configuration. * [`iota_getTotalTransactionBlocks`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_gettotaltransactionblocks) — retrieves the total number of transaction blocks. * [`iota_getTransactionBlock`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_gettransactionblock) — retrieves a transaction block by digest. * [`iota_multiGetObjects`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#iota_multigetobjects) — retrieves multiple on-chain objects by ID. * [`iota_multiGetTransactionBlocks`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#iota_multigettransactionblocks) — retrieves multiple transaction blocks by digest. * [`iota_tryGetPastObject`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#iota_trygetpastobject) — retrieves a past version of an object if available. * [`iota_tryMultiGetPastObjects`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#iota_trymultigetpastobjects) — retrieves past versions of multiple objects if available. **Transaction Builder**: * [`unsafe_batchTransaction`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#unsafe_batchtransaction) — creates an unsigned batched transaction. * [`unsafe_mergeCoins`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#unsafe_mergecoins) — creates an unsigned transaction to merge multiple coins. * [`unsafe_moveCall`](/rpc-service/chains/chains-api/iota/iota-rpc-p3/#unsafe_movecall) — creates an unsigned transaction to call a Move function. * [`unsafe_pay`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_pay) — creates a transaction to transfer coins to multiple recipients. * [`unsafe_payAllIota`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_payalliota) — creates a transaction to transfer all IOTA coins to a single recipient. * [`unsafe_payIota`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_payiota) — creates a transaction to transfer IOTA coins to multiple recipients. * [`unsafe_publish`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_publish) — creates an unsigned transaction to publish Move modules. * [`unsafe_requestAddStake`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_requestaddstake) — creates a request to add stake. * [`unsafe_requestAddTimelockedStake`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_requestaddtimelockedstake) — adds a timelocked stake. * [`unsafe_requestWithdrawStake`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_requestwithdrawstake) — withdraws stake from a validator's staking pool. * [`unsafe_requestWithdrawTimelockedStake`](/rpc-service/chains/chains-api/iota/unsafe-p2/#unsafe_requestwithdrawtimelockedstake) — withdraws timelocked stake from a validator's staking pool. * [`unsafe_splitCoin`](/rpc-service/chains/chains-api/iota/unsafe-p2/#unsafe_splitcoin) — creates an unsigned transaction to split a coin into specified amounts. * [`unsafe_splitCoinEqual`](/rpc-service/chains/chains-api/iota/unsafe-p2/#unsafe_splitcoinequal) — creates an unsigned transaction to split a coin into equal parts. * [`unsafe_transferIota`](/rpc-service/chains/chains-api/iota/unsafe-p2/#unsafe_transferiota) — creates an unsigned transaction to transfer IOTA coins. * [`unsafe_transferObject`](/rpc-service/chains/chains-api/iota/unsafe-p2/#unsafe_transferobject) — creates an unsigned transaction to transfer an on-chain object. **Write**: * [`iota_devInspectTransactionBlock`](/rpc-service/chains/chains-api/iota/unsafe-p2/#iota_devinspecttransactionblock) — simulates a transaction block for debugging and inspection. * [`iota_dryRunTransactionBlock`](/rpc-service/chains/chains-api/iota/unsafe-p2/#iota_dryruntransactionblock) — simulates execution of a transaction block without committing it. * [`iota_executeTransactionBlock`](/rpc-service/chains/chains-api/iota/unsafe-p2/#iota_executetransactionblock) — executes and commits a transaction block to the network. --- ## Coin Query ## Governance Read ## Move Utils ## Read ## Transaction Builder ## Write ## Methods ### iotax, iota - [`iotax_getAllBalances`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getallbalances) - [`iotax_getAllCoins`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getallcoins) - [`iotax_getBalance`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getbalance) - [`iotax_getCirculatingSupply`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getcirculatingsupply) - [`iotax_getCoinMetadata`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getcoinmetadata) - [`iotax_getCoins`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getcoins) - [`iotax_getTotalSupply`](/rpc-service/chains/chains-api/iota/iotax/#iotax_gettotalsupply) - [`iotax_getCommitteeInfo`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getcommitteeinfo) - [`iotax_getLatestIotaSystemState`](/rpc-service/chains/chains-api/iota/iotax/#iotax_getlatestiotasystemstate) - [`iotax_getLatestIotaSystemStateV2`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_getlatestiotasystemstatev2) - [`iotax_getReferenceGasPrice`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_getreferencegasprice) - [`iotax_getStakes`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_getstakes) - [`iotax_getStakesByIds`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_getstakesbyids) - [`iotax_getTimelockedStakes`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_gettimelockedstakes) - [`iotax_getTimelockedStakesByIds`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_gettimelockedstakesbyids) - [`iotax_getValidatorsApy`](/rpc-service/chains/chains-api/iota/iotax-p2/#iotax_getvalidatorsapy) - [`iota_getMoveFunctionArgTypes`](/rpc-service/chains/chains-api/iota/iotax-p2/#iota_getmovefunctionargtypes) - [`iota_getNormalizedMoveFunction`](/rpc-service/chains/chains-api/iota/iotax-p2/#iota_getnormalizedmovefunction) - [`iota_getNormalizedMoveModule`](/rpc-service/chains/chains-api/iota/iotax-p3/#iota_getnormalizedmovemodule) ### iota, unsafe - [`iota_getNormalizedMoveModulesByPackage`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getnormalizedmovemodulesbypackage) - [`iota_getNormalizedMoveStruct`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getnormalizedmovestruct) - [`iota_getChainIdentifier`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getchainidentifier) - [`iota_getCheckpoint`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getcheckpoint) - [`iota_getCheckpoints`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getcheckpoints) - [`iota_getEvents`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getevents) - [`iota_getLatestCheckpointSequenceNumber`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getlatestcheckpointsequencenumber) - [`iota_getObject`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getobject) - [`iota_getProtocolConfig`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_getprotocolconfig) - [`iota_getTotalTransactionBlocks`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_gettotaltransactionblocks) - [`iota_getTransactionBlock`](/rpc-service/chains/chains-api/iota/iota-rpc/#iota_gettransactionblock) - [`iota_multiGetObjects`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#iota_multigetobjects) - [`iota_multiGetTransactionBlocks`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#iota_multigettransactionblocks) - [`iota_tryGetPastObject`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#iota_trygetpastobject) - [`iota_tryMultiGetPastObjects`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#iota_trymultigetpastobjects) - [`unsafe_batchTransaction`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#unsafe_batchtransaction) - [`unsafe_mergeCoins`](/rpc-service/chains/chains-api/iota/iota-rpc-p2/#unsafe_mergecoins) - [`unsafe_moveCall`](/rpc-service/chains/chains-api/iota/iota-rpc-p3/#unsafe_movecall) ### unsafe, iota - [`unsafe_pay`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_pay) - [`unsafe_payAllIota`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_payalliota) - [`unsafe_payIota`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_payiota) - [`unsafe_publish`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_publish) - [`unsafe_requestAddStake`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_requestaddstake) - [`unsafe_requestAddTimelockedStake`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_requestaddtimelockedstake) - [`unsafe_requestWithdrawStake`](/rpc-service/chains/chains-api/iota/unsafe/#unsafe_requestwithdrawstake) - [`unsafe_requestWithdrawTimelockedStake`](/rpc-service/chains/chains-api/iota/unsafe-p2/#unsafe_requestwithdrawtimelockedstake) - [`unsafe_splitCoin`](/rpc-service/chains/chains-api/iota/unsafe-p2/#unsafe_splitcoin) - [`unsafe_splitCoinEqual`](/rpc-service/chains/chains-api/iota/unsafe-p2/#unsafe_splitcoinequal) - [`unsafe_transferIota`](/rpc-service/chains/chains-api/iota/unsafe-p2/#unsafe_transferiota) - [`unsafe_transferObject`](/rpc-service/chains/chains-api/iota/unsafe-p2/#unsafe_transferobject) - [`iota_devInspectTransactionBlock`](/rpc-service/chains/chains-api/iota/unsafe-p2/#iota_devinspecttransactionblock) - [`iota_dryRunTransactionBlock`](/rpc-service/chains/chains-api/iota/unsafe-p2/#iota_dryruntransactionblock) - [`iota_executeTransactionBlock`](/rpc-service/chains/chains-api/iota/unsafe-p2/#iota_executetransactionblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota/iota-rpc-p2/ title: IOTA — iota, unsafe (2/3) source: docs/rpc-service/chains/chains-api/iota/iota-rpc-p2.mdx --- # IOTA — iota, unsafe (2/3) > API reference for [IOTA](/rpc-service/chains/chains-api/iota/). [All methods ->](/rpc-service/chains/chains-api/iota/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/iota/iota-rpc/) · 2 · [3](/rpc-service/chains/chains-api/iota/iota-rpc-p3/) ## `iota_multiGetObjects` > Retrieves multiple on-chain objects by ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `object_ids< [ObjectID] >` (required): the list of object IDs to query. * `options< ObjectDataOptions >` (optional): optional settings for specifying which parts of the object data to include in the response. ### Returns ``` Vec<[ IotaObjectResponse ]> ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_multiGetObjects", "params": [ [ "0x9f5bc1dbdc77a1603835318928fcb4bfb8b80b59638ea86579aecdadb00e6a58", "0x0000000000000000000000000000000000000000000000000000000000000005", "0x3aba764588cac339ef5b2676cad430a6d7a0fbc97d2d8e3eece9c42ee0379593", "0xee2fe355d70cd714eaa82d2d10644b44a3e2f65146dc95a7b759cab4b1d1ab72" ], { "showType": true, "showOwner": true, "showPreviousTransaction": true, "showDisplay": false, "showContent": true, "showBcs": false, "showStorageRebate": true } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "data": { "objectId": "0x9f5bc1dbdc77a1603835318928fcb4bfb8b80b59638ea86579aecdadb00e6a58", "version": "13624397", "digest": "7igEiTswauamJfm8vKQq4htKzyEwTJKBUTP9RvfXaj2g", "type": "0x3::timelocked_staking::TimelockedStakedIota", "owner": { "AddressOwner": "0x1ee12dca0e798966a82f74c010c109e1bd0674f4f47517db6843f223bad5eb7c" }, "previousTransaction": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G", "storageRebate": "3009600", "content": { "dataType": "moveObject", "type": "0x3::timelocked_staking::TimelockedStakedIota", "fields": { "expiration_timestamp_ms": "1787097600000", "id": { "id": "0x9f5bc1dbdc77a1603835318928fcb4bfb8b80b59638ea86579aecdadb00e6a58" }, "label": "000000000000000000000000000000000000000000000000000000000000107a::stardust_upgrade_label::STARDUST_UPGRADE_LABEL", "staked_iota": { "type": "0x3::staking_pool::StakedIota", "fields": { "id": { "id": "0xc9b07d5e6148cf2f70bc2f4d013bbe2697764a4e6181f0610803aac940bb04cc" }, "pool_id": "0x829fcfaca1ce8ca42161469447c23a600b2df7215a5b784a51e930e323bdd3bb", "principal": "2816564858653000", "stake_activation_epoch": "10" } } } } } }, { "error": { "code": "deleted", "object_id": "0xee2fe355d70cd714eaa82d2d10644b44a3e2f65146dc95a7b759cab4b1d1ab72", "version": 13624397, "digest": "7gyGAp71YXQRoxmFBaHxofQXAipvgHyBKPyxmdSJxyvz" } } ] } ``` --- ## `iota_multiGetTransactionBlocks` > Retrieves multiple transaction blocks by digest. Retrieves an ordered list of transaction responses The method will throw an error if the input contains any duplicate or the input size exceeds `QUERY_MAX_RESULT_LIMIT`. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `digests< [TransactionDigest] >` (required): a list of transaction digests to query. * `options< TransactionBlockResponseOptions >` (optional): configuration options to control which fields are included in the response. ### Returns ``` Vec<[ TransactionBlockResponse ]> ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_multiGetTransactionBlocks", "params": [ [ "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G", "ESwp5E4rEeGSpfi86vpzogszMLo3mnkedUcvjEdLqqLi" ], { "showInput": true, "showRawInput": false, "showEffects": true, "showEvents": true, "showObjectChanges": false, "showBalanceChanges": false, "showRawEffects": false } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "digest": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G", "transaction": { "data": { "transaction": { "kind": "ProgrammableTransaction", "inputs": ["object", "sharedObject", "pure
"], "transactions": [ { "MoveCall": { "package": "0x3", "module": "timelocked_staking", "function": "request_add_stake" } } ] }, "sender": "0x1ee1...eb7c" } }, "effects": { "status": { "status": "success" }, "executedEpoch": "9", "gasUsed": { "computationCost": "1000000", "storageCost": "299037200", "storageRebate": "296027600" }, "created": ["0x9f5b...6a58"], "mutated": ["0x0000...0005", "0x3aba...9593", "0x5b89...48d1"], "deleted": ["0xee2f...ab72"] }, "events": [ { "type": "0x3::validator::StakingRequestEvent", "parsedJson": { "amount": "2816564858653000", "epoch": "9" } } ], "timestampMs": "1747226554971", "checkpoint": "3513008" }, { "digest": "ESwp5E4rEeGSpfi86vpzogszMLo3mnkedUcvjEdLqqLi", "transaction": { "data": { "transaction": { "kind": "ProgrammableTransaction", "inputs": ["object", "pure", "pure>"], "transactions": [ { "MoveCall": { "function": "borrow_assets" } }, { "MakeMoveVec": ["Receipt", []] }, { "MoveCall": { "function": "take_coin_balance" } }, { "MoveCall": { "function": "from_balance" } }, { "MergeCoins": ["GasCoin"] }, { "MoveCall": { "function": "return_assets_from_borrow" } }, { "MoveCall": { "function": "transition" } } ] }, "sender": "0x7b4a...dd67" } }, "effects": { "status": { "status": "success" }, "executedEpoch": "9", "gasUsed": { "computationCost": "1000000", "storageCost": "6619600", "storageRebate": "6619600" }, "mutated": ["0x0dc4...409d", "0x3215...3cb8", "0xb693...270d"] }, "events": [], "timestampMs": "1747232429004", "checkpoint": "3538984" } ] } ``` --- ## `iota_tryGetPastObject` > Retrieves a past version of an object if available. Note: there is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. The result may vary across nodes depending on their pruning policies. Return the object information for a specified version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `object_id< ObjectID >` (required): the ID of the queried object. * `version< SequenceNumber >` (required): the version of the queried object. If `null`, defaults to the latest known version. * `options< ObjectDataOptions >` (optional): settings for specifying which parts of the object data to include in the response. ### Returns ``` IotaPastObjectResponse< ObjectRead > ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_tryGetPastObject", "params": [ "0x0000000000000000000000000000000000000000000000000000000000000005", 13624397, { "showType": true, "showOwner": true, "showPreviousTransaction": true, "showDisplay": false, "showContent": true, "showBcs": false, "showStorageRebate": true } ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "status": "VersionFound", "details": { "objectId": "0x0000000000000000000000000000000000000000000000000000000000000005", "version": "13624397", "digest": "5HqUbjLYUvLayiSS4RwqHC55BMwnGp5dmiZCf375gHfh", "type": "0x3::iota_system::IotaSystemState", "owner": { "Shared": { "initial_shared_version": 1 } }, "previousTransaction": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G", "storageRebate": "1444000", "content": { "dataType": "moveObject", "type": "0x3::iota_system::IotaSystemState", "fields": { "id": { "id": "0x0000000000000000000000000000000000000000000000000000000000000005" }, "version": "2" } } } } } ``` --- ## `iota_tryMultiGetPastObjects` > Retrieves past versions of multiple objects if available. Note: there is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. The result may vary across nodes depending on their pruning policies. Return the object information for a specified version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `past_objects< [GetPastObjectRequest] >` (required): a list of objects and their corresponding versions to be queried. * `options< ObjectDataOptions >` (optional): settings for specifying which parts of the object data to include in the response. ### Returns ``` Vec<[ ObjectRead ]> ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_tryMultiGetPastObjects", "params": [ [ { "objectId": "0x5b890eaf2abcfa2ab90b77b8e6f3d5d8609586c3e583baf3dccd5af17edf48d1", "version": "13624397" }, { "objectId": "0x0000000000000000000000000000000000000000000000000000000000000005", "version": "13624397" } ], { "showType": true, "showOwner": true, "showPreviousTransaction": true, "showDisplay": false, "showContent": true, "showBcs": false, "showStorageRebate": true } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": [ { "status": "VersionFound", "details": { "objectId": "0x5b890eaf2abcfa2ab90b77b8e6f3d5d8609586c3e583baf3dccd5af17edf48d1", "version": "13624397", "digest": "HRYS5tXW9HwcxV9NufDDHJvFUvwQ3GzAU5h1Tr9wWLZC", "type": "0x2::dynamic_field::Field", "owner": { "ObjectOwner": "0x0000000000000000000000000000000000000000000000000000000000000005" }, "previousTransaction": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G", "storageRebate": "293603200", "content": { "dataType": "moveObject", "type": "0x2::dynamic_field::Field", "fields": { "balance": "10000", "id": { "id": "0x5b890eaf2abcfa2ab90b77b8e6f3d5d8609586c3e583baf3dccd5af17edf48d1" } } } } }, { "status": "VersionFound", "details": { "objectId": "0x0000000000000000000000000000000000000000000000000000000000000005", "version": "13624397", "digest": "5HqUbjLYUvLayiSS4RwqHC55BMwnGp5dmiZCf375gHfh", "type": "0x3::iota_system::IotaSystemState", "owner": { "Shared": { "initial_shared_version": 1 } }, "previousTransaction": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G", "storageRebate": "1444000", "content": { "dataType": "moveObject", "type": "0x3::iota_system::IotaSystemState", "fields": { "id": { "id": "0x0000000000000000000000000000000000000000000000000000000000000005" }, "version": "2" } } } } ], "id": 1 } ``` --- ## `unsafe_batchTransaction` > Create an unsigned batched transaction. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `single_transaction_params< [RPCTransactionRequestParams] >` (required): list of transaction request parameters to be included in the transaction. * `gas< ObjectID >` (optional): the gas object to use for this transaction. If not provided, the node selects one from the signer's owned objects. * `gas_budget< BigInt_for_uint64 >` (required): the maximum gas allowed for the transaction. The transaction will fail if this budget is exceeded. * `txn_builder_mode< IotaTransactionBlockBuilderMode >` (optional): specifies the transaction builder mode, indicating whether this is a regular transaction or a dev inspect transaction. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the list of gas objects to be used in the transaction. * `inputObjects< [InputObjectKind] >` (required): the objects involved in this transaction. * `txBytes< Base64 >` (required): the BCS-encoded transaction data (without its type tag), provided as a base64-encoded string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_batchTransaction", "params": [ { "signer": "0xYourIotaAddress", "single_transaction_params": [ { "moveCallRequestParams": { "package_object_id": "0xPackageID", "module": "moduleName", "function": "functionName", "type_arguments": [], "arguments": [] } }, { "transferObjectRequestParams": { "object_id": "0xObjectID", "recipient": "0xRecipientAddress" } } ], "gas_budget": "1000000" } ], "id": 1 }' ``` ### Response parameters ```json { "jsonrpc": "2.0", "id": 1, "method": "unsafe_batchTransaction", "params": { "signer": "string (IotaAddress)", "single_transaction_params": [ { "moveCallRequestParams": { "package_object_id": "string (ObjectID)", "module": "string", "function": "string", "type_arguments": ["string"], "arguments": ["any"] } // or // "transferObjectRequestParams": { // "object_id": "string (ObjectID)", // "recipient": "string (IotaAddress)" // } } ], "gas": "string (ObjectID, optional)", "gas_budget": "string (BigInt_for_uint64)", "txn_builder_mode": "string (IotaTransactionBlockBuilderMode, optional)" } } ``` --- ## `unsafe_mergeCoins` > Creates an unsigned transaction to merge multiple coins. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `primary_coin< ObjectID >` (required): the coin object into which the other will be merged; this coin will remain after the transaction. * `coin_to_merge< ObjectID >` (required): the coin object to be merged and destroyed; its balance will be added to the primary_coin. * `gas< ObjectID >` (optional): the gas object to use for this transaction. If not provided, the node will select one from the signer's assets. * `gas_budget< BigInt_for_uint64 >` (required): the gas limit for this transaction; it will fail if the gas usage exceeds this budget. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_mergeCoins", "params": [ "0xYOUR_SIGNER_ADDRESS", // placeholder: signer address (IotaAddress) "0xPRIMARY_COIN_OBJECT_ID", // placeholder: coin object that will remain "0xCOIN_TO_MERGE_OBJECT_ID", // placeholder: coin object that will be merged and destroyed "0xOPTIONAL_GAS_OBJECT_ID", // placeholder: gas object (can be same as primary coin or omitted) "1000000" // gas budget as string (BigInt) ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "digest": "0xTRANSACTION_DIGEST", // placeholder: transaction hash "effects": { "status": { "status": "success" }, // status of transaction execution "gasUsed": { "computationCost": "1000000", // example gas values "storageCost": "50000", "storageRebate": "45000", "nonRefundableStorageFee": "0" }, "mutated": [ { "owner": { "AddressOwner": "0xSIGNER_ADDRESS" }, "reference": { "objectId": "0xPRIMARY_COIN_OBJECT_ID", // placeholder: updated coin object "version": 12345678, "digest": "0xUPDATED_OBJECT_DIGEST" } } ], "deleted": [ { "objectId": "0xCOIN_TO_MERGE_OBJECT_ID", // placeholder: deleted coin "version": 12345678, "digest": "0xDELETED_OBJECT_DIGEST" } ] }, "timestampMs": "1690000000000", // placeholder timestamp "checkpoint": "1234567" // checkpoint in which transaction was finalized } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota/iota-rpc-p3/ title: IOTA — iota, unsafe (3/3) source: docs/rpc-service/chains/chains-api/iota/iota-rpc-p3.mdx --- # IOTA — iota, unsafe (3/3) > API reference for [IOTA](/rpc-service/chains/chains-api/iota/). [All methods ->](/rpc-service/chains/chains-api/iota/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/iota/iota-rpc/) · [2](/rpc-service/chains/chains-api/iota/iota-rpc-p2/) · 3 ## `unsafe_moveCall` > Creates an unsigned transaction to call a Move function. Creates an unsigned transaction to execute a Move call on the network, by calling the specified function in the module of a given package. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `package_object_id< ObjectID >` (required): the ID of the Move package to invoke, e.g. 0x2. * `module< string >` (required): the name of the Move module containing the target function, e.g. pay. * `function< string >` (required): the name of the Move function to call, e.g. split. * `type_arguments< [TypeTag] >` (required): the type arguments to be passed into the Move function. * `arguments< [IotaJsonValue] >` (required): the function arguments, formatted as [IOTA-compatible JSON](https://docs.iota.org/references/iota-api) values. * `gas< ObjectID >` (optional): the gas object to use for the transaction. If not specified, one will be automatically selected from the signer's assets. * `gas_budget< BigInt_for_uint64 >` (required): the maximum gas the transaction is allowed to consume. It will fail if exceeded. * `execution_mode< IotaTransactionBlockBuilderMode >` (optional): the execution mode, indicating whether the transaction should be executed normally or as a dev inspect. Defaults to Commit if not provided. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects to be used for the transaction. * `inputObjects< [InputObjectKind] >` (required): the input objects involved in the transaction. * `txBytes< Base64 >` (required): the BCS-encoded transaction data bytes (without the type tag), represented as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_moveCall", "params": [ "0xSIGNER_ADDRESS", // placeholder: IOTA address of the transaction signer "0xPACKAGE_ID", // placeholder: Move package ID (e.g., 0x2) "module_name", // placeholder: Move module name (e.g., "pay") "function_name", // placeholder: Move function name (e.g., "split") ["0xTYPE_TAG"], // placeholder: list of type arguments (can be empty) ["IOTA_JSON_ARGUMENTS"], // placeholder: list of arguments in IOTA JSON format "0xOPTIONAL_GAS_OBJECT_ID", // placeholder: gas object (optional, or use one from signer's owned coins) "1000000", // placeholder: gas budget (as string, BigInt) "Commit" // placeholder: execution mode (e.g., "Commit" or "DevInspect") ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "digest": "0xTRANSACTION_DIGEST", // placeholder: transaction hash "effects": { "status": { "status": "success" // execution status }, "executedEpoch": "123", // epoch in which transaction was executed "gasUsed": { "computationCost": "1000000", "storageCost": "50000", "storageRebate": "45000", "nonRefundableStorageFee": "0" }, "created": [ { "owner": { "AddressOwner": "0xSIGNER_ADDRESS" }, "reference": { "objectId": "0xCREATED_OBJECT_ID", "version": 12345678, "digest": "0xOBJECT_DIGEST" } } ], "mutated": [ { "owner": { "AddressOwner": "0xSIGNER_ADDRESS" }, "reference": { "objectId": "0xMUTATED_OBJECT_ID", "version": 12345678, "digest": "0xMUTATED_OBJECT_DIGEST" } } ], "deleted": [ { "objectId": "0xDELETED_OBJECT_ID", "version": 12345678, "digest": "0xDELETED_OBJECT_DIGEST" } ], "gasObject": { "owner": { "AddressOwner": "0xSIGNER_ADDRESS" }, "reference": { "objectId": "0xGAS_OBJECT_ID", "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } } }, "events": [ { "id": { "txDigest": "0xTRANSACTION_DIGEST", "eventSeq": "0" }, "packageId": "0xPACKAGE_ID", "transactionModule": "module_name", "sender": "0xSIGNER_ADDRESS", "type": "0xPACKAGE::module::EventName", "parsedJson": { "key": "value" } } ], "timestampMs": "1690000000000", "checkpoint": "1234567" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota/iota-rpc/ title: IOTA — iota, unsafe (1/3) source: docs/rpc-service/chains/chains-api/iota/iota-rpc.mdx --- # IOTA — iota, unsafe (1/3) > API reference for [IOTA](/rpc-service/chains/chains-api/iota/). [All methods ->](/rpc-service/chains/chains-api/iota/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/iota/iota-rpc-p2/) · [3](/rpc-service/chains/chains-api/iota/iota-rpc-p3/) ## `iota_getNormalizedMoveModulesByPackage` > Retrieves all normalized Move modules in a package. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `package< ObjectID >` (required): the object ID of the Move package whose modules should be retrieved in normalized form. ### Returns ``` BTreeMap< IotaMoveNormalizedModule > ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getNormalizedMoveModulesByPackage", "params": [ "0x1b33a3cf7eb5dde04ed7ae571db1763006811ff6b7bb35b3d1c780de153af9dd" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "fileFormatVersion": 6, "address": "0x1b33a3cf7eb5dde04ed7ae571db1763006811ff6b7bb35b3d1c780de153af9dd", "name": "request", "friends": [], "structs": {}, "exposedFunctions": {} }, "id": 1 } ``` --- ## `iota_getNormalizedMoveStruct` > Retrieves normalized representation of a Move struct. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `package< ObjectID >` (required): the object ID of the Move package that contains the module defining the struct. * `module_name< string >` (required): the name of the Move module within the package where the struct is defined. * `struct_name< string >` (required): the name of the struct whose normalized representation should be retrieved. ### Returns ``` IotaMoveNormalizedStruct< IotaMoveNormalizedStruct > ``` * `abilities< IotaMoveAbilitySet >` (required): the set of abilities (e.g., `copy`, `drop`, `store`, `key`) that define what operations are allowed on this struct type. * `fields<[ IotaMoveNormalizedField ]>` (required): list of fields defined in the struct, including each field's name and type. * `typeParameters<[ IotaMoveStructTypeParameter ]>` (required): list of type parameters for the struct, where each includes constraints such as required abilities. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getNormalizedMoveStruct", "params": [ "0x1b33a3cf7eb5dde04ed7ae571db1763006811ff6b7bb35b3d1c780de153af9dd", "assets_bag", "AssetsBag" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "abilities": { "abilities": [ "Store", "Key" ] }, "typeParameters": [], "fields": [ { "name": "id", "type": { "Struct": { "address": "0x2", "module": "object", "name": "UID", "typeArguments": [] } } }, { "name": "size", "type": "U64" } ] } } ``` --- ## `iota_getChainIdentifier` > Retrieves the unique identifier of the chain. Returns the first four bytes of the chain's genesis checkpoint digest. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns ``` String< string > ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getChainIdentifier", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "6364aad5" } ``` --- ## `iota_getCheckpoint` > Retrieves a checkpoint by sequence number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `id< CheckpointId >` (requried): checkpoint identifier, can use either checkpoint digest, or checkpoint sequence number as input. ### Returns ``` Checkpoint< Checkpoint > ``` * `checkpointCommitments<[ CheckpointCommitment ]>` (required): commitments to checkpoint state. * `digest< CheckpointDigest >` (required): the digest of this checkpoint. * `endOfEpochData< EndOfEpochData | null >` (optional): data present only on the final checkpoint of the epoch. * `epoch< BigInt_for_uint64 >` (required): the checkpoint's epoch ID. * `epochRollingGasCostSummary< GasCostSummary >` (required): the running total gas costs of all transactions included in the current epoch up to this checkpoint. * `networkTotalTransactions< BigInt_for_uint64 >` (required): total number of transactions committed since genesis, including those in this checkpoint. * `previousDigest< CheckpointDigest | null >` (optional): the digest of the previous checkpoint. * `sequenceNumber< BigInt_for_uint64 >` (required): the checkpoint’s sequence number. * `timestampMs< BigInt_for_uint64 >` (required): timestamp of the checkpoint in milliseconds since Unix epoch. Checkpoint timestamps are monotonic but may be equal across checkpoints originating from the same consensus commit. * `transactions<[ TransactionDigest ]>` (required): digests of transactions included in the checkpoint. * `validatorSignature< Base64 >` (required): the signature of the validator producing this checkpoint. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getCheckpoint", "params": ["1000"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "epoch": "0", "sequenceNumber": "1000", "digest": "FKxXqL6KKGG1UyguTu6daodhRuZ8G3GrXVqPNmJ76YXc", "networkTotalTransactions": "13995", "previousDigest": "2kC97pinzVSrBNmi7LVN9LGMiDAupRP6p54fceMHma9j", "epochRollingGasCostSummary": { "computationCost": "0", "computationCostBurned": "0", "storageCost": "0", "storageRebate": "0", "nonRefundableStorageFee": "0" }, "timestampMs": "1746433821035", "transactions": [ "7Vzm6UUEaeoML3ZvAxJ48mebKaNHPDzUM1fNABipe9dB", "5WNsm2PEbQv73KQ32ZA7AoSydXhma9LWGQRKrjL9BHHe", "9mbaYLV9Vp6T2pJ68LhWRtUo57zs5jCPoHq5FZkCmcVg", "8QS7YcDAKhnsHnkEvmkQ4sECp4fZaiVsVmQbB82BTSbe", "6wz7WS4CiQYwtFTdhmaH5AU1e7Scw3VZimHzhViDuoFn" ], "checkpointCommitments": [], "validatorSignature": "sCsUuGz4daTuwbPG9I+qLzFm3cF1Lq8kL+JYDL8/0DnT8/DbMj72DHhFNIC0uwuv" } } ``` --- ## `iota_getCheckpoints` > Retrieves a list of checkpoints. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `cursor< BigInt_for_uint64 >` (optional): an optional paging cursor. If provided, the query starts from the item after the specified cursor; defaults to the first item if not specified. * `limit< uint >` (optional): maximum number of items returned per page; defaults to `QUERY_MAX_RESULT_LIMIT_CHECKPOINTS` if not specified. * `descending_order< Boolean >` (required): query result ordering. If `true`, returns results in descending order (newest first); defaults to `false` for ascending order (oldest first). ### Returns ``` CheckpointPage< Page_for_Checkpoint_and_BigInt_for_uint64 > ``` `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first item. * `data<[ Checkpoint ]>` (required): list of checkpoint objects returned by the query. * `hasNextPage< Boolean >` (required): indicates whether more checkpoints are available beyond the current page. * `nextCursor< BigInt_for_uint64 | null >` (optional): cursor value to use for retrieving the next page of results; `null` if there are no more results. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getCheckpoints", "params": ["1004", 4, false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "data": [ { "epoch": "0", "sequenceNumber": "1005", "digest": "7YGc3Pj9PrtLj7hMEjm3ZBAxGRVns9prvdhzqg8CFCSi", "networkTotalTransactions": "14015", "previousDigest": "H4dJS4R6bTFDBcCyN8UyCdrp1wNfa9UFqxM31xPLztb7", "epochRollingGasCostSummary": { "computationCost": "0", "computationCostBurned": "0", "storageCost": "0", "storageRebate": "0", "nonRefundableStorageFee": "0" }, "timestampMs": "1746433822163", "transactions": [ "B8DSv1PRfMxg6hx4Vcb5zKwKUHK4PAasmGLvg4UBwrSV", "FqBheLcfG5fUo7y3yM4Hvy6QYTojqRWWmLkNw5hBSXZ5", "3L2Sz8Vhikqzxvqin2NhiNfdnHcopuBStGYXNBVyML7Y", "GhVbcW3ZrHjtLxrWWUCaNErNEw1JULazA4LDMoDBmvja", "AdnqzbVVUFX55GvvWLGBgXbbH4mnPhzaryHJ5Tab8YLX" ], "checkpointCommitments": [], "validatorSignature": "js9+DK5wdS2tJB46ygIa5fedn+0TfvgsmirQZ2QUa6ShVrOohrxKCGRY7bliQ985" } ], "nextCursor": "1008", "hasNextPage": true } } ``` --- ## `iota_getEvents` > Retrieves transaction events. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `transaction_digest< TransactionDigest >` (required): the digest of the transaction whose emitted events should be retrieved. ### Returns ``` Vec<[ Event ]> ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getEvents", "params": ["1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ { "id": { "txDigest": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G", "eventSeq": "0" }, "packageId": "0x0000000000000000000000000000000000000000000000000000000000000003", "transactionModule": "timelocked_staking", "sender": "0x1ee12dca0e798966a82f74c010c109e1bd0674f4f47517db6843f223bad5eb7c", "type": "0x3::validator::StakingRequestEvent", "parsedJson": { "amount": "2816564858653000", "epoch": "9", "pool_id": "0x829fcfaca1ce8ca42161469447c23a600b2df7215a5b784a51e930e323bdd3bb", "staker_address": "0x1ee12dca0e798966a82f74c010c109e1bd0674f4f47517db6843f223bad5eb7c", "validator_address": "0x37421363c5fd56c43325217b6c58b77f307d04a825ad8b49a38e7436ae422205" }, "bcsEncoding": "base64", "bcs": "gp/PrKHOjKQhYUaUR8I6YAst9yFaW3hKUekw4yO907s3QhNjxf1WxDMlIXtsWLd/MH0EqCWti0mjjnQ2rkIiBR7hLcoOeYlmqC90wBDBCeG9BnT09HUX22hD8iO61et8CQAAAAAAAABICeObpgEKAA==" } ] } ``` --- ## `iota_getLatestCheckpointSequenceNumber` > Retrieves the latest checkpoint sequence number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns ``` BigInt< BigInt_for_uint64 > ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getLatestCheckpointSequenceNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "3514321" } ``` --- ## `iota_getObject` > Retrieves object data by ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `object_id< ObjectID >` (required): the ID of the queried object. * `options< ObjectDataOptions >` (optional): options for specifying the content to be returned. ### Returns ``` IotaObjectResponse< IotaObjectResponse > ``` * `data< ObjectData | null >` (optional): the retrieved on-chain object data if found; null if the object does not exist or is not accessible. * `error< ObjectResponseError | null >` (optional): error details if the object could not be retrieved; null if the operation was successful. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getObject", "params": [ "0x9f5bc1dbdc77a1603835318928fcb4bfb8b80b59638ea86579aecdadb00e6a58", { "showType": true, "showOwner": true, "showPreviousTransaction": true, "showDisplay": false, "showContent": true, "showBcs": false, "showStorageRebate": true } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "data": { "objectId": "0x9f5bc1dbdc77a1603835318928fcb4bfb8b80b59638ea86579aecdadb00e6a58", "version": "13624397", "digest": "7igEiTswauamJfm8vKQq4htKzyEwTJKBUTP9RvfXaj2g", "type": "0x3::timelocked_staking::TimelockedStakedIota", "owner": { "AddressOwner": "0x1ee12dca0e798966a82f74c010c109e1bd0674f4f47517db6843f223bad5eb7c" }, "previousTransaction": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G", "storageRebate": "3009600", "content": { "dataType": "moveObject", "type": "0x3::timelocked_staking::TimelockedStakedIota", "fields": { "expiration_timestamp_ms": "1787097600000", "id": { "id": "0x9f5bc1dbdc77a1603835318928fcb4bfb8b80b59638ea86579aecdadb00e6a58" }, "label": "000000000000000000000000000000000000000000000000000000000000107a::stardust_upgrade_label::STARDUST_UPGRADE_LABEL", "staked_iota": { "type": "0x3::staking_pool::StakedIota", "fields": { "id": { "id": "0xc9b07d5e6148cf2f70bc2f4d013bbe2697764a4e6181f0610803aac940bb04cc" }, "pool_id": "0x829fcfaca1ce8ca42161469447c23a600b2df7215a5b784a51e930e323bdd3bb", "principal": "2816564858653000", "stake_activation_epoch": "10" } } } } } } } ``` --- ## `iota_getProtocolConfig` > Retrieves the current protocol configuration. Returns the protocol configuration for a specified version number. If no version is provided, the node returns the configuration corresponding to the latest epoch it has processed. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `version< BigInt_for_uint64 >` (optional): the protocol version to query. If omitted, the latest protocol config table for the node will be returned. ### Returns ``` ProtocolConfigResponse< ProtocolConfig > ``` * `attributes< Boolean >` (required): indicates whether Move object attributes are enabled in the current protocol version. * `featureFlags< Boolean >` (required): indicates whether Move feature flags are supported and active. * `maxSupportedProtocolVersion< ProtocolVersion >` (required): the highest protocol version supported by this node. * `minSupportedProtocolVersion< ProtocolVersion >` (required): the lowest protocol version supported by this node. * `protocolVersion< ProtocolVersion >` (required): the current protocol version this configuration applies to. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getProtocolConfig", "params": ["6"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "minSupportedProtocolVersion": "1", "maxSupportedProtocolVersion": "7", "protocolVersion": "6", "featureFlags": { "bridge": false, "convert_type_argument_error": true, "native_charging_v2": true, "passkey_auth": false, "zklogin_auth": false }, "attributes": { "base_gas_price": { "u64": "1000" }, "base_tx_cost_fixed": { "u64": "1000" }, "base_tx_cost_per_byte": { "u64": "0" }, "max_tx_gas": { "u64": "50000000000" }, "max_tx_size_bytes": { "u64": "131072" }, "max_gas_price": { "u64": "100000" }, "max_function_definitions": { "u64": "1000" }, "max_struct_definitions": { "u64": "200" }, "storage_gas_price": { "u64": "76" }, "storage_rebate_rate": { "u64": "10000" }, "event_emit_cost_base": { "u64": "52" }, "event_emit_output_cost_per_byte": { "u64": "10" }, "debug_print_base_cost": { "u64": "52" }, "object_runtime_max_num_cached_objects": { "u64": "1000" }, "validator_target_reward": { "u64": "767000000000000" }, "consensus_max_num_transactions_in_block": { "u64": "512" }, "ecdsa_k1_ecrecover_sha256_cost_base": { "u64": "500" }, "ed25519_ed25519_verify_cost_base": { "u64": "1802" }, "bls12381_bls12381_min_sig_verify_cost_base": { "u64": "44064" }, "group_ops_bls12381_g1_mul_cost": { "u64": "4842" }, "hash_sha3_256_base_cost": { "u64": "52" }, "type_name_get_base_cost": { "u64": "52" }, "vector_push_back_base_cost": { "u64": "52" }, "dynamic_field_add_child_object_cost_base": { "u64": "100" }, "package_publish_cost_fixed": { "u64": "1000" }, "package_publish_cost_per_byte": { "u64": "80" } } } } ``` --- ## `iota_getTotalTransactionBlocks` > Retrieves the total number of transaction blocks. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns ``` BigInt< BigInt_for_uint64 > ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getTotalTransactionBlocks", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "15406387" } ``` --- ## `iota_getTransactionBlock` > Retrieves a transaction block by digest. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `digest< TransactionDigest >` (required): the digest of the queried transaction. * `options< TransactionBlockResponseOptions >` (optional): specifying which parts of the transaction block to include in the response. ### Returns ``` IotaTransactionBlockResponse< TransactionBlockResponse > ``` * `balanceChanges< [BalanceChange] | null >` (optional): list of balance changes caused by the transaction, or null if not available. * `checkpoint< BigInt_for_uint64 | null >` (optional): the checkpoint number in which the transaction was included and finalized. Only available in the read API. * `confirmedLocalExecution< [boolean] | null >` (optional): indicates whether the transaction was confirmed by local execution; null if unknown or not applicable. * `digest< TransactionDigest >` (required): the digest of the queried transaction. * `effects< TransactionBlockEffects | null >` (optional): structured transaction effects, such as object mutations, deletions, and transfers. * `errors< [string] >` (optional): list of errors, if any, encountered during processing or execution. * `events< [Event] | null >` (optional): list of events emitted by the transaction, or null if none. * `objectChanges< [ObjectChange] | null >` (optional): list of on-chain object changes caused by the transaction, or null if not available. * `rawEffects< [string] >` (optional): BCS-encoded raw effect bytes, represented as base64 strings. * `rawTransaction< Base64 >` (optional): BCS-encoded SenderSignedData representing the full signed transaction; empty if show_raw_transaction is false. * `timestampMs< BigInt_for_uint64 | null >` (optional): timestamp (in milliseconds since Unix epoch) when the transaction was finalized. * `transaction< TransactionBlock | null >` (optional): the input transaction block data, or null if not available. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getTransactionBlock", "params": [ "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G", { "showInput": true, "showRawInput": false, "showEffects": true, "showEvents": true, "showObjectChanges": false, "showBalanceChanges": false, "showRawEffects": false } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "digest": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G", "transaction": { "data": { "messageVersion": "v1", "transaction": { "kind": "ProgrammableTransaction", "inputs": [{ "objectId": "0xee2f...ab72", "version": "1" }], "transactions": [{ "MoveCall": { "package": "0x3", "module": "timelocked_staking", "function": "request_add_stake", "arguments": [{ "Input": 1 }, { "Input": 0 }] } }] }, "sender": "0x1ee1...eb7c", "gasData": { "payment": [{ "objectId": "0x3aba...9593" }], "price": "1000", "budget": "5990000" } }, "txSignatures": ["AADfuE3s...YKIA=="] }, "effects": { "status": { "status": "success" }, "executedEpoch": "9", "gasUsed": { "computationCost": "1000000", "storageCost": "299037200", "storageRebate": "296027600" }, "created": [{ "reference": { "objectId": "0x9f5b...6a58" } }], "mutated": [{ "reference": { "objectId": "0x0000...0005" } }], "deleted": [{ "objectId": "0xee2f...ab72" }], "gasObject": { "reference": { "objectId": "0x3aba...9593" } }, "eventsDigest": "D2wXokf8VZsdpR3qGCNkoJXBFSSvoMGdwXqwYuReRuDe" }, "events": [{ "type": "0x3::validator::StakingRequestEvent", "parsedJson": { "amount": "2816564858653000", "epoch": "9", "pool_id": "0x829f...d3bb", "staker_address": "0x1ee1...eb7c", "validator_address": "0x3742...2205" } }], "timestampMs": "1747226554971", "checkpoint": "3513008" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota/iotax-p2/ title: IOTA — iotax, iota (2/3) source: docs/rpc-service/chains/chains-api/iota/iotax-p2.mdx --- # IOTA — iotax, iota (2/3) > API reference for [IOTA](/rpc-service/chains/chains-api/iota/). [All methods ->](/rpc-service/chains/chains-api/iota/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/iota/iotax/) · 2 · [3](/rpc-service/chains/chains-api/iota/iotax-p3/) ## `iotax_getLatestIotaSystemStateV2` > Retrieves the latest IOTA system state (v2 format). Retrieves the latest IOTA system state object on networks supporting protocol version `>= 5`. These are networks with node software release version `>= 0.11`. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns ``` IotaSystemStateSummary< IotaSystemStateSummary > ``` * `activeValidators<[ IotaValidatorSummary ]>` (required): the list of active validators in the current epoch. * `atRiskValidators<[ IotaAddress, BigInt_for_uint64 ]>` (required): map storing the number of epochs for which each validator has been below the low stake threshold. * `epoch< BigInt_for_uint64 >` (required): the current epoch ID, starting from 0. * `epochDurationMs< BigInt_for_uint64 >` (required): the duration of an epoch, in milliseconds. * `epochStartTimestampMs< BigInt_for_uint64 >` (required): Unix timestamp of the current epoch start. * `inactivePoolsId< ObjectID >` (required): ID of the object that maps from a staking pool ID to the inactive validator that has that pool as its staking pool. * `inactivePoolsSize< BigInt_for_uint64 >` (required): number of inactive staking pools. * `iotaTotalSupply< BigInt_for_uint64 >` (required): the current IOTA supply. * `iotaTreasuryCapId< ObjectID >` (required): the `TreasuryCap` object ID. * `maxValidatorCount< BigInt_for_uint64 >` (required): maximum number of active validators allowed in any epoch. * `minValidatorCount< BigInt_for_uint64 >` (required): minimum number of active validators allowed in any epoch. * `minValidatorJoiningStake< BigInt_for_uint64 >` (required): lower bound on the amount of stake required to become a validator. * `pendingActiveValidatorsId< ObjectID >` (required): ID of the object containing the list of new validators scheduled to join at the end of the epoch. * `pendingActiveValidatorsSize< BigInt_for_uint64 >` (required): number of new validators that will join at the end of the epoch. * `pendingRemovals<[ BigInt_for_uint64 ]>` (required): removal requests from validators, each element is an index pointing to `activeValidators`. * `protocolVersion< BigInt_for_uint64 >` (required): the current protocol version, starting from 1. * `referenceGasPrice< BigInt_for_uint64 >` (required): the reference gas price for the current epoch. * `safeMode< Boolean >` (required): indicates whether the system is running in downgraded safe mode due to a non-recoverable bug. * `safeModeComputationRewards< BigInt_for_uint64 >` (required): amount of computation rewards accumulated and not yet distributed during safe mode. * `safeModeNonRefundableStorageFee< BigInt_for_uint64 >` (required): amount of non-refundable storage fee accumulated during safe mode. * `safeModeStorageCharges< BigInt_for_uint64 >` (required): amount of storage charges accumulated and not yet distributed during safe mode. * `safeModeStorageRebates< BigInt_for_uint64 >` (required): amount of storage rebates accumulated and not yet burned during safe mode. * `stakingPoolMappingsId< ObjectID >` (required): ID of the object that maps from staking pool IDs to validator IOTA addresses. * `stakingPoolMappingsSize< BigInt_for_uint64 >` (required): number of staking pool mappings. * `storageFundNonRefundableBalance< BigInt_for_uint64 >` (required): non-refundable portion of the storage fund from rebates and leftover rewards. * `storageFundTotalObjectStorageRebates< BigInt_for_uint64 >` (required): total storage rebates for all on-chain objects stored in the storage fund. * `systemStateVersion< BigInt_for_uint64 >` (required): current version of the system state data structure type. * `totalStake< BigInt_for_uint64 >` (required): total stake from all active validators at the beginning of the epoch. * `validatorCandidatesId< ObjectID >` (required): ID of the object that stores preactive validators, mapping addresses to validator structs. * `validatorCandidatesSize< BigInt_for_uint64 >` (required): number of preactive validators. * `validatorLowStakeGracePeriod< BigInt_for_uint64 >` (required): number of epochs a validator can remain under the low stake threshold before being removed. * `validatorLowStakeThreshold< BigInt_for_uint64 >` (required): stake threshold below which validators are considered at risk and subject to removal after the grace period. * `validatorReportRecords<[ IotaAddress, array ]>` (required): map storing records of validators reporting each other. * `validatorVeryLowStakeThreshold< BigInt_for_uint64 >` (required): stake threshold below which validators are removed immediately at epoch change, with no grace period. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getLatestIotaSystemStateV2", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "V2": { "epoch": "8", "protocolVersion": "7", "systemStateVersion": "2", "iotaTotalSupply": "4606135837711000000", "iotaTreasuryCapId": "0x03f980dbd802f9cae9a91a95c7d8918d53e960a529224a4fe949f16ed0a0bfe6", "storageFundTotalObjectStorageRebates": "142099092400", "storageFundNonRefundableBalance": "0", "referenceGasPrice": "1000", "safeMode": false, "safeModeStorageCharges": "0", "safeModeComputationCharges": "0", "safeModeComputationChargesBurned": "0", "safeModeStorageRebates": "0", "safeModeNonRefundableStorageFee": "0", "epochStartTimestampMs": "1747121947622", "epochDurationMs": "86400000", "minValidatorCount": "4", "maxValidatorCount": "150", "minValidatorJoiningStake": "2000000000000000", "validatorLowStakeThreshold": "1500000000000000", "validatorVeryLowStakeThreshold": "1000000000000000", "validatorLowStakeGracePeriod": "7", "totalStake": "1593618205314001166", "committeeMembers": ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", ...], "activeValidators": [ { "iotaAddress": "0xa69363ce32b9b1e5b9c7480232ca6799068daa7c22c3d8cc53632246c354b9ff", "authorityPubkeyBytes": "hhTzcuJ0oEm+i3IQsoLp3tIODqhN69i6CcF2BiM6D/zzrNz7WTpYs1UFCLG1hp01AP314/jW/NoZ/esH6LvVwFDWu3LlL78rpUMnrob+jxzUpFszfGGRG1HVBthRsthH", "networkPubkeyBytes": "cgaeXKN4Rg/Z6ffKCoRudauC5PHwrq13kpPG620EeR8=", "protocolPubkeyBytes": "mlAC5S1B2MngnAUL/xdSCFFy4Pkg/nl1Tz59wSo1gDY=", "proofOfPossessionBytes": "iWqAfqA1pnrZybpC9onttc1hyTy7kFUgdgu3Dod2TqxiCpaLfxXXIpATuwohTKdt", "name": "Nansen", "description": "Nansen is a leading on-chain analytics platform founded in 2020, and is now one of the most trusted names in crypto, serving traders and institutions. Disclaimer: delegating comes with slashing risks", "imageUrl": "https://raw.githubusercontent.com/nansen-ai/staking-brand-assets/refs/heads/main/nansen_logo.png", "projectUrl": "https://nansen.ai", "netAddress": "/dns/iota-mainnet-validator.nansen.ai/tcp/8080/http", "p2pAddress": "/dns/iota-mainnet-validator.nansen.ai/udp/8084", "primaryAddress": "/dns/iota-mainnet-validator.nansen.ai/udp/8081", "nextEpochAuthorityPubkeyBytes": null, "nextEpochProofOfPossession": null, "nextEpochNetworkPubkeyBytes": null, "nextEpochProtocolPubkeyBytes": null, "nextEpochNetAddress": null, "nextEpochP2pAddress": null, "nextEpochPrimaryAddress": null, "votingPower": "709", "operationCapId": "0x8c257442fdc3108e909a6e640d698183b5b659b4b91e49299b7bdec8eae77498", "gasPrice": "1000", "commissionRate": "1000", "nextEpochStake": "107971890702362012", "nextEpochGasPrice": "1000", "nextEpochCommissionRate": "1000", "stakingPoolId": "0x650976e1fcdc34715fcd3c3fc855fe53f8fb1975d71ef0a14c70def314f29cd0", "stakingPoolActivationEpoch": "0", "stakingPoolDeactivationEpoch": null, "stakingPoolIotaBalance": "112369730917907092", "rewardsPool": "446972976946139", "poolTokenBalance": "111674731070595754", "pendingStake": "714511436394942", "pendingTotalIotaWithdraw": "5112351651940022", "pendingPoolTokenWithdraw": "5080732072641612", "exchangeRatesId": "0x6cac6ce099478b8502a3610cd5731fd506cdc68904f22140c2dc969baa5edccd", "exchangeRatesSize": "9" } ], "pendingActiveValidatorsId": "0x0c5baa1518f8bde68dbff9187e1c6ee4902991ec458dadac56bdad36d1dd1a6f", "pendingActiveValidatorsSize": "0", "pendingRemovals": [], "stakingPoolMappingsId": "0x833c0d40c9ff97d5a58a5ddebee25beaee26a87d9d75935f918aea8ddcd77afe", "stakingPoolMappingsSize": "50", "inactivePoolsId": "0x1fdfc877c137ad53da70bf3173a59c2cae85268226918a071b00879d01ffee5e", "inactivePoolsSize": "3", "validatorCandidatesId": "0xbd088ad9621996a89da1f3ec01b360fad990b7e37499967b585248191210d7ad", "validatorCandidatesSize": "9", "atRiskValidators": [], "validatorReportRecords": [] } } } ``` --- ## `iotax_getReferenceGasPrice` > Retrieves the current reference gas price. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns ``` BigInt< BigInt_for_uint64 > ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getReferenceGasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "1000" } ``` --- ## `iotax_getStakes` > Retrieves all stakes for a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `owner< IotaAddress >` (required): the owner's IOTA address. ### Returns ``` Vec<[ DelegatedStake ]> ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getStakes", "params": ["0x303db99c56283dba10c014f90fce2691cba6e7ea661fd3331d95b6e76ada9a19"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "validatorAddress": "0x303db99c56283dba10c014f90fce2691cba6e7ea661fd3331d95b6e76ada9a19", "stakingPool": "0xf544f15d1c3fadcc60fa74717a0039607c64af9919ecad396716909768b3ba96", "stakes": [ { "stakedIotaId": "0x4bab00a6e80e6271351ea8d2ebf9658bed92a7fb9f9e9778c7279dee0d47cfbb", "stakeRequestEpoch": "7", "stakeActiveEpoch": "8", "principal": "4279860002232", "status": "Active", "estimatedReward": "0" }, { "stakedIotaId": "0x58cd59f365ff591d10fe67f6b449098940562c7fa7cdaf6783b7bc99ed0c292b", "stakeRequestEpoch": "1", "stakeActiveEpoch": "2", "principal": "7232810014145", "status": "Active", "estimatedReward": "25499919585" } ] } ] } ``` --- ## `iotax_getStakesByIds` > Retrieves stakes by stake object IDs. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `staked_iota_ids<[ ObjectID ]>` (required): list of object IDs representing IOTA coin objects that have been staked by the validator. ### Returns ``` Vec<[ DelegatedStake ]> ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getStakesByIds", "params": [ [ "0x37e9ed4fe1b3781210575cdbb42a9599dc3b42ae12a6cd29f4f6b071522062d1", "0x474a511684bc5323b3688ff3a7df5c2e99140e91a4cc010976f8ba5ee8e489b3" ] ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ { "validatorAddress": "0x8e2e13c2ecfda356f07d008885b7bb82befb4d602245c3bff98ad59863162dd8", "stakingPool": "0x49976354d0dc89ea6f0102c653f737d223ea4c0623e9d3e3ce73cb49f38bb0eb", "stakes": [ { "stakedIotaId": "0x37e9ed4fe1b3781210575cdbb42a9599dc3b42ae12a6cd29f4f6b071522062d1", "stakeRequestEpoch": "5", "stakeActiveEpoch": "6", "principal": "7455240000000", "status": "Active", "estimatedReward": "7132473715" }, { "stakedIotaId": "0x474a511684bc5323b3688ff3a7df5c2e99140e91a4cc010976f8ba5ee8e489b3", "stakeRequestEpoch": "7", "stakeActiveEpoch": "8", "principal": "6833970003564", "status": "Active", "estimatedReward": "0" } ] } ] } ``` --- ## `iotax_getTimelockedStakes` > Retrieves all timelocked stakes for an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `owner< IotaAddress >` (required): the owner's IOTA address. ### Returns ``` Vec<[ DelegatedTimelockedStake ]> ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getTimelockedStakes", "params": ["0x8e2e13c2ecfda356f07d008885b7bb82befb4d602245c3bff98ad59863162dd8"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `iotax_getTimelockedStakesByIds` > Retrieves timelocked stakes by object IDs. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `timelocked_staked_iota_ids<[ ObjectID ]>` (required): list of object IDs representing IOTA coin objects that have been staked with a time lock. ### Returns ``` Vec<[ DelegatedTimelockedStake ]> ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getTimelockedStakesByIds", "params": [["0x", "0x"]], "id": 1 }' ``` ","0x"]]} /> ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "id": "0xabc123...", "stake_amount": "1000000000", "start_epoch": 5200, "unlock_epoch": 5300, "owner": "0x94f1a597b4e8f709a396f7f6b1482bdcd65a673d111e49286c527fab7c2d0961", "status": "Staked", "validator_address": "0x8a8b61fe5e6ff7d70c6cbff8b6c3cf2cb74ff67236beed1e92b9e651e0e19f3b" }, { "id": "0xdef456...", "stake_amount": "2000000000", "start_epoch": 5180, "unlock_epoch": 5280, "owner": "0x94f1a597b4e8f709a396f7f6b1482bdcd65a673d111e49286c527fab7c2d0961", "status": "Unstaked", "validator_address": "0x7b72a2cd3efbbde451a9f3f179edf65ff07f3a0616b72c1a95e12a1bd176c918" } ] } ``` --- ## `iotax_getValidatorsApy` > Retrieves the annual percentage yield (APY) for validators. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns ``` ValidatorApys< ValidatorApys > ``` * `apys<[ ValidatorApy ]>` (required) * `epoch< BigInt_for_uint64 >` (required) ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getValidatorsApy", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "apys": [ { "address": "0xa69363ce32b9b1e5b9c7480232ca6799068daa7c22c3d8cc53632246c354b9ff", "apy": 0.23075268854918127 }, { "address": "0x864c651958094732a1227134cf7cab7587f05a399398804552553fbc01dba4e7", "apy": 0.232642723786573 } ], "epoch": "8" } } ``` --- ## `iota_getMoveFunctionArgTypes` > Retrieves argument types for a Move function. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `package< ObjectID >` (required): the object ID of the Move package that contains the target module. * `module< string >` (required): the name of the Move module where the function is defined. * `function< string >` (required): the name of the Move function for which to retrieve the argument types. ### Returns ``` Vec<[ MoveFunctionArgType ]> ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getMoveFunctionArgTypes", "params": [ "0x1b33a3cf7eb5dde04ed7ae571db1763006811ff6b7bb35b3d1c780de153af9dd", "request", "create_and_send_request" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "Pure", { "Object": "ByValue" }, "Pure", "Pure", "Pure", "Pure", "Pure", { "Object": "ByMutableReference" } ] } ``` --- ## `iota_getNormalizedMoveFunction` > Retrieves normalized representation of a Move function. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `package< ObjectID >` (required): the object ID of the Move package that contains the module definition. * `module_name< string >` (required): the name of the Move module in the specified package. * `function_name< string >` (required): the name of the function within the module whose normalized representation should be retrieved. ### Returns ``` IotaMoveNormalizedFunction< IotaMoveNormalizedFunction > ``` * `isEntry< Boolean >` (required): indicates whether the function is an `entry` function, meaning it can be invoked directly in a transaction. * `parameters<[ IotaMoveNormalizedType ]>` (required): list of types representing the function's input parameters, in normalized Move type format. * `return<[ IotaMoveNormalizedType ]>` (required): list of types representing the function's return values, in normalized Move type format. * `typeParameters<[ IotaMoveAbilitySet ]>` (required): list of type parameters declared by the function, each associated with a set of required abilities (e.g., copy, drop, store). * `visibility< IotaMoveVisibility >` (required): the visibility of the function — e.g., `public`, `private`, or `friend` — which defines where and how the function can be accessed. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getNormalizedMoveFunction", "params": [ "0x1b33a3cf7eb5dde04ed7ae571db1763006811ff6b7bb35b3d1c780de153af9dd", "request", "create_and_send_request" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "visibility": "Public", "isEntry": false, "typeParameters": [], "parameters": [ "Address", { "Struct": { "address": "0x1b33a3cf7eb5dde04ed7ae571db1763006811ff6b7bb35b3d1c780de153af9dd", "module": "assets_bag", "name": "AssetsBag", "typeArguments": [] } }, "U32", "U32", { "Vector": { "Vector": "U8" } }, { "Vector": "U8" }, "U64", { "MutableReference": { "Struct": { "address": "0x2", "module": "tx_context", "name": "TxContext", "typeArguments": [] } } } ], "return": [] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota/iotax-p3/ title: IOTA — iotax, iota (3/3) source: docs/rpc-service/chains/chains-api/iota/iotax-p3.mdx --- # IOTA — iotax, iota (3/3) > API reference for [IOTA](/rpc-service/chains/chains-api/iota/). [All methods ->](/rpc-service/chains/chains-api/iota/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/iota/iotax/) · [2](/rpc-service/chains/chains-api/iota/iotax-p2/) · 3 ## `iota_getNormalizedMoveModule` > Retrieves normalized representation of a Move module. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `package< ObjectID >` (required): the object ID of the Move package that contains the target module. * `module_name< string >` (required): the name of the Move module within the specified package whose normalized representation should be retrieved. ### Returns ``` IotaMoveNormalizedModule< IotaMoveNormalizedModule > ``` * `address< string >` (required): the on-chain address (in hex format) where the Move module is published. * `exposedFunctions< IotaMoveNormalizedFunction >` (required): a mapping of all functions exposed by the module, each including its name, parameters, return types, visibility, and entry status. * `fileFormatVersion< uint32 >` (required): the version number of the Move bytecode file format used by this module. * `friends<[ IotaMoveModuleId ]>` (required): list of module IDs that are declared as "friends" of this module — allowing access to its friend-visible members. * `name< string >` (required): the name of the module. * `structs< IotaMoveNormalizedStruct >` (required): a mapping of all struct definitions declared in the module, each including its fields, abilities, and type parameters. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_getNormalizedMoveModule", "params": [ "0x1b33a3cf7eb5dde04ed7ae571db1763006811ff6b7bb35b3d1c780de153af9dd", "request" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "fileFormatVersion": 6, "address": "0x1b33a3cf7eb5dde04ed7ae571db1763006811ff6b7bb35b3d1c780de153af9dd", "name": "request", "friends": [], "structs": {}, "exposedFunctions": {} }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota/iotax/ title: IOTA — iotax, iota (1/3) source: docs/rpc-service/chains/chains-api/iota/iotax.mdx --- # IOTA — iotax, iota (1/3) > API reference for [IOTA](/rpc-service/chains/chains-api/iota/). [All methods ->](/rpc-service/chains/chains-api/iota/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/iota/iotax-p2/) · [3](/rpc-service/chains/chains-api/iota/iotax-p3/) ## `iotax_getAllBalances` > Retrieves all coin balances for an account. Retrieves the total coin balance for all coin type, owned by the address owner. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `owner< IotaAddress >` (required): the owner's IOTA address. ### Returns Gets all balances for the address in the request. ``` Vec<[ Balance ]> ``` ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getAllBalances", "params": ["0x94f1a597b4e8f709a396f7f6b1482bdcd65a673d111e49286c527fab7c2d0961"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": [ { "coinType": "0x2::iota::IOTA", "coinObjectCount": 15, "totalBalance": "3000000000" } ], "id": 1 } ``` --- ## `iotax_getAllCoins` > Retrieves all coins held by an account. Retrieves all Coin objects owned by an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `owner< IotaAddress >` (required): the owner's IOTA address. * `cursor< ObjectID >`(optional): paging cursor. * `limit< uint >` (optional): maximum number of items per page. ### Returns ``` CoinPage< Page_for_Coin_and_ObjectID > ``` `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first item. * `data<[ Coin ]>` (required) * `hasNextPage< Boolean >` (required) * `nextCursor< ObjectID | null >` (optional) ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getAllCoins", "params": [ "0x2762540744dfaeda69885db1f8e85c8c02e471ce41914aea9a85b3e6d63996a5" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "data": [ { "coinType": "0x2::iota::IOTA", "coinObjectId": "0x37904c3a2a5c5309afb2c622418f9b703522ff3ae28e61c202f47b1e4b536851", "version": "94", "digest": "8A6oR6tnJgyxJEPo8sb697QxmFedsZSttkAZpZTv66oM", "balance": "9998019600", "previousTransaction": "C9RF1uxim4uUQbMqrdNusJgVsxHwKEJgGyPnZ7BuTrqm" } ], "nextCursor": "0x37904c3a2a5c5309afb2c622418f9b703522ff3ae28e61c202f47b1e4b536851", "hasNextPage": false } } ``` --- ## `iotax_getBalance` > Retrieves the balance of a specific coin for an account. Retrieves the total coin balance for one coin type, owned by the address owner. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `owner< IotaAddress >` (required): the owner's IOTA address. * `coin_type< string >` (optional): type names for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC), default to 0x2::iota::IOTA if not specified. ### Returns Gets the balance of the specified type of coin for the address in the request. ``` Balance< Balance > ``` * `coinObjectCount< uint >` (required) * `coinType< string >` (required) * `totalBalance< BigInt_for_uint128 >` (required) ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getBalance", "params": [ "0x51ceab2edc89f74730e683ebee65578cb3bc9237ba6fca019438a9737cf156ae", "0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "coinType": "0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC", "coinObjectCount": 15, "totalBalance": "15" }, "id": 1 } ``` --- ## `iotax_getCirculatingSupply` > Retrieves the circulating supply of a coin. Retrieves the circulating supply summary. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns ``` IotaCirculatingSupply< IotaCirculatingSupply > ``` Provides a summary of the circulating IOTA supply. * `atCheckpoint< uint64 >` (required): timestamp (UTC) when the circulating supply was calculated. * `circulatingSupplyPercentage< >` (required): percentage of total supply that is currently circulating (range: 0.0 to 1.0). * `value< uint64 >` (required): circulating supply in NANOS at the given timestamp. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getCirculatingSupply", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "value": 3751592581236347000, "circulatingSupplyPercentage": 0.8146128347879668, "atCheckpoint": 2771976 } } ``` --- ## `iotax_getCoinMetadata` > Retrieves metadata of a coin (name, symbol, etc.). ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `coin_type< string >` (required): type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC). ### Returns ``` IotaCoinMetadata< IotaCoinMetadata > ``` * `decimals< uint8 >` (required): number of decimal places the coin uses. * `description< string >` (required): description of the token. * `iconUrl< [string,null] >` (optional): URL for the token logo. * `id< ObjectID | null >` (optional): object id for the CoinMetadata object. * `name< string >` (required): name for the token. * `symbol< string >` (required): symbol for the token. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getCoinMetadata", "params": ["0x2::iota::IOTA"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "decimals": 9, "name": "IOTA", "symbol": "IOTA", "description": "The main (gas)token of the IOTA Network.", "iconUrl": "https://iota.org/logo.png", "id": "0xd02db1bb647dfcc94f35b82a14e8bab07661be3e6d4b022bdc7ee63eed0728f8" } } ``` --- ## `iotax_getCoins` > Retrieves all existing coins. Retrieves all `Coin` objects owned by an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `owner< IotaAddress >` (required): the owner's IOTA address. * `coin_type< string >` (optional): type name for the coin (e.g., 0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC), default to 0x2::iota::IOTA if not specified. * `cursor< ObjectID >` (optional): paging cursor. * `limit< uint >` (optional): maximum number of items per page. ### Returns ``` CoinPage< Page_for_Coin_and_ObjectID > ``` `next_cursor` points to the last item in the page; Reading with `next_cursor` will start from the next item after `next_cursor` if `next_cursor` is `Some`, otherwise it will start from the first item. * `data<[ Coin ]>` (required) * `hasNextPage< Boolean >` (required) * `nextCursor< ObjectID | null >` (optional) ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getCoins", "params": [ "0x2762540744dfaeda69885db1f8e85c8c02e471ce41914aea9a85b3e6d63996a5" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "data": [ { "coinType": "0x2::iota::IOTA", "coinObjectId": "0x37904c3a2a5c5309afb2c622418f9b703522ff3ae28e61c202f47b1e4b536851", "version": "94", "digest": "8A6oR6tnJgyxJEPo8sb697QxmFedsZSttkAZpZTv66oM", "balance": "9998019600", "previousTransaction": "C9RF1uxim4uUQbMqrdNusJgVsxHwKEJgGyPnZ7BuTrqm" } ], "nextCursor": "0x37904c3a2a5c5309afb2c622418f9b703522ff3ae28e61c202f47b1e4b536851", "hasNextPage": false } } ``` --- ## `iotax_getTotalSupply` > Retrieves the total minted supply of a coin. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `coin_type< string >` (required): type name for the coin (e.g., `0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC`) ### Returns ``` Supply< Supply > ``` * `value< BigInt_for_uint64 >` (required) ### Request example Gets total supply for the type of coin provided. ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getTotalSupply", "params": ["0x2::iota::IOTA"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "value": "4605368858708000000" } } ``` --- [//]: # (**Extended**:) [//]: # () [//]: # (## `iotax_getAllEpochAddressMetrics`) [//]: # () [//]: # (> Retrieves address metrics for all epochs.) [//]: # () [//]: # (Address related metrics. Exclusively served by the indexer.) [//]: # () [//]: # (### Parameters) [//]: # () [//]: # ( * `id` (integer; required): a request ID (example: 1).) [//]: # ( * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0).) [//]: # ( * `method` (string; required): a method used for the request.) [//]: # ( * `params` (array; required):) [//]: # () [//]: # ( * `descending_order< Boolean >` (optional)) [//]: # () [//]: # (### Returns) [//]: # () [//]: # (```) [//]: # (Vec<[ AddressMetrics ]>) [//]: # (```) [//]: # () [//]: # (### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "jsonrpc": "2.0",) [//]: # ( "method": "iotax_getAllEpochAddressMetrics",) [//]: # ( "params": [],) [//]: # ( "id": 1) [//]: # ( }') [//]: # (```) [//]: # () [//]: # (### Response example) [//]: # () [//]: # (Method not found) [//]: # () [//]: # (---) [//]: # () [//]: # (## `iotax_getCheckpointAddressMetrics`) [//]: # () [//]: # (> Retrieves address metrics at a specific checkpoint.) [//]: # () [//]: # (Address related metrics. Exclusively served by the indexer.) [//]: # () [//]: # (### Parameters) [//]: # () [//]: # ( * `id` (integer; required): a request ID (example: 1).) [//]: # ( * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0).) [//]: # ( * `method` (string; required): a method used for the request.) [//]: # ( * `params` (array; required):) [//]: # () [//]: # ( * `checkpoint< uint64 >` (required)) [//]: # () [//]: # (### Returns) [//]: # () [//]: # (```) [//]: # (AddressMetrics< AddressMetrics >) [//]: # (```) [//]: # () [//]: # (Provides metrics about the addresses.) [//]: # () [//]: # ( * `checkpoint< uint64 >` (required): the checkpoint sequence number at which the metrics were computed.) [//]: # ( * `cumulativeActiveAddresses< uint64 >` (required): the count of sender addresses.) [//]: # ( * `cumulativeAddresses< uint64 >` (required): the count of sender and recipient addresses.) [//]: # ( * `dailyActiveAddresses< uint64 >` (required): the count of daily unique sender addresses.) [//]: # ( * `epoch< uint64 >` (required): the epoch to which the checkpoint is assigned.) [//]: # ( * `timestampMs< uint64 >` (required): the checkpoint timestamp.) [//]: # () [//]: # (### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "jsonrpc": "2.0",) [//]: # ( "method": "iotax_getCheckpointAddressMetrics",) [//]: # ( "params": [3110054],) [//]: # ( "id": 1) [//]: # ( }') [//]: # (```) [//]: # () [//]: # (### Response example) [//]: # () [//]: # (Method not found.) [//]: # () [//]: # (---) [//]: # () [//]: # ( * [`iotax_getCurrentEpoch`]() — retrieves the current epoch.) [//]: # ( * [`iotax_getDynamicFieldObject`]() — retrieves a specific dynamic field object.) [//]: # ( * [`iotax_getDynamicFields`]() — retrieves dynamic fields associated with an object.) [//]: # ( * [`iotax_getEpochMetrics`]() — retrieves network metrics for a given epoch.) [//]: # ( * [`iotax_getEpochs`]() — retrieves a list of past epochs.) [//]: # ( * [`iotax_getLatestAddressMetrics`]() — retrieves the most recent address metrics.) [//]: # ( * [`iotax_getMoveCallMetrics`]() — retrieves metrics related to Move function calls.) [//]: # ( * [`iotax_getNetworkMetrics`]() — retrieves overall network performance metrics.) [//]: # ( * [`iotax_getOwnedObjects`]() — retrieves all objects owned by an address.) [//]: # ( * [`iotax_getTotalTransactions`]() — retrieves the total number of transactions.) [//]: # ( * [`iotax_queryEvents`]() — retrieves events matching specific filters.) [//]: # ( * [`iotax_queryTransactionBlocks`]() — retrieves transaction blocks based on query parameters.) [//]: # ( * [`iotax_subscribeEvent`]() — subscribes to real-time event updates.) [//]: # ( * [`iotax_subscribeTransaction`]() — subscribes to real-time transaction updates.) [//]: # () [//]: # (---) **** ## `iotax_getCommitteeInfo` > Retrieves the committee information for the asked `epoch`. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `epoch< BigInt_for_uint64 >` (optional): the epoch of interest. If None, default to the latest epoch. ### Returns ``` IotaCommittee< CommitteeInfo > ``` * `epoch< BigInt_for_uint64 >` (required) * `validators<[ AuthorityPublicKeyBytes, BigInt_for_uint64 ]>` (required) ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getCommitteeInfo", "params": ["8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "epoch": "8", "validators": [ [ "gKPp7Gab6+i8KuWl7JgAXg8qgQ6T4Srzpa02cwK+tvOq0zIq8Ma9kCtyEKD604BeBjls9uxNRZj3tkcYIsTI7Z4WCINMfMb4FLQqSqZVxDVVH+XF//dip505b8Zkp0AJ", "135" ], [ "gWZ1ZRkn0PswgR/mNtobDIpRbwo8KzLo3hEjeOz6xFhrI22AHt1pzbgAFwTtkP02DYCjAotyPK/8rMhi5vDQKGx5YQj2SnqJIa6LsHX+e7jouBdzmwUsDJgiKq4OUb+Y", "179" ] ] } } ``` --- ## `iotax_getLatestIotaSystemState` > Retrieves the latest IOTA system state. Retrieves the latest IOTA system state object on networks supporting protocol version `< 5`. These are networks with node software release version `< 0.11`. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns ``` IotaSystemStateSummaryV1< IotaSystemStateSummaryV1 > ``` This is the JSON-RPC type for the `IotaSystemStateV1` object. It flattens all fields to make them top-level fields such that it as minimum dependencies to the internal data structures of the IOTA system state type. * `activeValidators<[ IotaValidatorSummary ]>` (required): the list of active validators in the current epoch. * `atRiskValidators<[ IotaAddress, BigInt_for_uint64 ]>` (required): map storing the number of epochs for which each validator has been below the low stake threshold. * `epoch< BigInt_for_uint64 >` (required): the current epoch ID, starting from 0. * `epochDurationMs< BigInt_for_uint64 >` (required): the duration of an epoch, in milliseconds. * `epochStartTimestampMs< BigInt_for_uint64 >` (required): Unix timestamp of the current epoch start. * `inactivePoolsId< ObjectID >` (required): ID of the object that maps from a staking pool ID to the inactive validator that has that pool as its staking pool. * `inactivePoolsSize< BigInt_for_uint64 >` (required): number of inactive staking pools. * `iotaTotalSupply< BigInt_for_uint64 >` (required): the current IOTA supply. * `iotaTreasuryCapId< ObjectID >` (required): the `TreasuryCap` object ID. * `maxValidatorCount< BigInt_for_uint64 >` (required): maximum number of active validators allowed in any epoch. * `minValidatorCount< BigInt_for_uint64 >` (required): minimum number of active validators allowed in any epoch. * `minValidatorJoiningStake< BigInt_for_uint64 >` (required): lower bound on the amount of stake required to become a validator. * `pendingActiveValidatorsId< ObjectID >` (required): ID of the object containing the list of new validators scheduled to join at the end of the epoch. * `pendingActiveValidatorsSize< BigInt_for_uint64 >` (required): number of new validators that will join at the end of the epoch. * `pendingRemovals<[ BigInt_for_uint64 ]>` (required): removal requests from validators, each element is an index pointing to `activeValidators`. * `protocolVersion< BigInt_for_uint64 >` (required): the current protocol version, starting from 1. * `referenceGasPrice< BigInt_for_uint64 >` (required): the reference gas price for the current epoch. * `safeMode< Boolean >` (required): indicates whether the system is running in downgraded safe mode due to a non-recoverable bug. * `safeModeComputationRewards< BigInt_for_uint64 >` (required): amount of computation rewards accumulated and not yet distributed during safe mode. * `safeModeNonRefundableStorageFee< BigInt_for_uint64 >` (required): amount of non-refundable storage fee accumulated during safe mode. * `safeModeStorageCharges< BigInt_for_uint64 >` (required): amount of storage charges accumulated and not yet distributed during safe mode. * `safeModeStorageRebates< BigInt_for_uint64 >` (required): amount of storage rebates accumulated and not yet burned during safe mode. * `stakingPoolMappingsId< ObjectID >` (required): ID of the object that maps from staking pool IDs to validator IOTA addresses. * `stakingPoolMappingsSize< BigInt_for_uint64 >` (required): number of staking pool mappings. * `storageFundNonRefundableBalance< BigInt_for_uint64 >` (required): non-refundable portion of the storage fund from rebates and leftover rewards. * `storageFundTotalObjectStorageRebates< BigInt_for_uint64 >` (required): total storage rebates for all on-chain objects stored in the storage fund. * `systemStateVersion< BigInt_for_uint64 >` (required): current version of the system state data structure type. * `totalStake< BigInt_for_uint64 >` (required): total stake from all active validators at the beginning of the epoch. * `validatorCandidatesId< ObjectID >` (required): ID of the object that stores preactive validators, mapping addresses to validator structs. * `validatorCandidatesSize< BigInt_for_uint64 >` (required): number of preactive validators. * `validatorLowStakeGracePeriod< BigInt_for_uint64 >` (required): number of epochs a validator can remain under the low stake threshold before being removed. * `validatorLowStakeThreshold< BigInt_for_uint64 >` (required): stake threshold below which validators are considered at risk and subject to removal after the grace period. * `validatorReportRecords<[ IotaAddress, array ]>` (required): map storing records of validators reporting each other. * `validatorVeryLowStakeThreshold< BigInt_for_uint64 >` (required): stake threshold below which validators are removed immediately at epoch change, with no grace period. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getLatestIotaSystemState", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "epoch": "8", "protocolVersion": "7", "systemStateVersion": "2", "iotaTotalSupply": "4606135837711000000", "iotaTreasuryCapId": "0x03f980dbd802f9cae9a91a95c7d8918d53e960a529224a4fe949f16ed0a0bfe6", "storageFundTotalObjectStorageRebates": "142099092400", "storageFundNonRefundableBalance": "0", "referenceGasPrice": "1000", "safeMode": false, "safeModeStorageCharges": "0", "safeModeComputationRewards": "0", "safeModeStorageRebates": "0", "safeModeNonRefundableStorageFee": "0", "epochStartTimestampMs": "1747121947622", "epochDurationMs": "86400000", "minValidatorCount": "4", "maxValidatorCount": "150", "minValidatorJoiningStake": "2000000000000000", "validatorLowStakeThreshold": "1500000000000000", "validatorVeryLowStakeThreshold": "1000000000000000", "validatorLowStakeGracePeriod": "7", "totalStake": "1593618205314001166", "activeValidators": [ { "iotaAddress": "0xa69363ce32b9b1e5b9c7480232ca6799068daa7c22c3d8cc53632246c354b9ff", "authorityPubkeyBytes": "hhTzcuJ0oEm+i3IQsoLp3tIODqhN69i6CcF2BiM6D/zzrNz7WTpYs1UFCLG1hp01AP314/jW/NoZ/esH6LvVwFDWu3LlL78rpUMnrob+jxzUpFszfGGRG1HVBthRsthH", "networkPubkeyBytes": "cgaeXKN4Rg/Z6ffKCoRudauC5PHwrq13kpPG620EeR8=", "protocolPubkeyBytes": "mlAC5S1B2MngnAUL/xdSCFFy4Pkg/nl1Tz59wSo1gDY=", "proofOfPossessionBytes": "iWqAfqA1pnrZybpC9onttc1hyTy7kFUgdgu3Dod2TqxiCpaLfxXXIpATuwohTKdt", "name": "Nansen", "description": "Nansen is a leading on-chain analytics platform founded in 2020, and is now one of the most trusted names in crypto, serving traders and institutions. Disclaimer: delegating comes with slashing risks", "imageUrl": "https://raw.githubusercontent.com/nansen-ai/staking-brand-assets/refs/heads/main/nansen_logo.png", "projectUrl": "https://nansen.ai", "netAddress": "/dns/iota-mainnet-validator.nansen.ai/tcp/8080/http", "p2pAddress": "/dns/iota-mainnet-validator.nansen.ai/udp/8084", "primaryAddress": "/dns/iota-mainnet-validator.nansen.ai/udp/8081", "nextEpochAuthorityPubkeyBytes": null, "nextEpochProofOfPossession": null, "nextEpochNetworkPubkeyBytes": null, "nextEpochProtocolPubkeyBytes": null, "nextEpochNetAddress": null, "nextEpochP2pAddress": null, "nextEpochPrimaryAddress": null, "votingPower": "709", "operationCapId": "0x8c257442fdc3108e909a6e640d698183b5b659b4b91e49299b7bdec8eae77498", "gasPrice": "1000", "commissionRate": "1000", "nextEpochStake": "107971890702362012", "nextEpochGasPrice": "1000", "nextEpochCommissionRate": "1000", "stakingPoolId": "0x650976e1fcdc34715fcd3c3fc855fe53f8fb1975d71ef0a14c70def314f29cd0", "stakingPoolActivationEpoch": "0", "stakingPoolDeactivationEpoch": null, "stakingPoolIotaBalance": "112369730917907092", "rewardsPool": "446972976946139", "poolTokenBalance": "111674731070595754", "pendingStake": "714511436394942", "pendingTotalIotaWithdraw": "5112351651940022", "pendingPoolTokenWithdraw": "5080732072641612", "exchangeRatesId": "0x6cac6ce099478b8502a3610cd5731fd506cdc68904f22140c2dc969baa5edccd", "exchangeRatesSize": "9" } ], "pendingActiveValidatorsId": "0x0c5baa1518f8bde68dbff9187e1c6ee4902991ec458dadac56bdad36d1dd1a6f", "pendingActiveValidatorsSize": "0", "pendingRemovals": [], "stakingPoolMappingsId": "0x833c0d40c9ff97d5a58a5ddebee25beaee26a87d9d75935f918aea8ddcd77afe", "stakingPoolMappingsSize": "50", "inactivePoolsId": "0x1fdfc877c137ad53da70bf3173a59c2cae85268226918a071b00879d01ffee5e", "inactivePoolsSize": "3", "validatorCandidatesId": "0xbd088ad9621996a89da1f3ec01b360fad990b7e37499967b585248191210d7ad", "validatorCandidatesSize": "9", "atRiskValidators": [], "validatorReportRecords": [] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota/unsafe-p2/ title: IOTA — unsafe, iota (2/2) source: docs/rpc-service/chains/chains-api/iota/unsafe-p2.mdx --- # IOTA — unsafe, iota (2/2) > API reference for [IOTA](/rpc-service/chains/chains-api/iota/). [All methods ->](/rpc-service/chains/chains-api/iota/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/iota/unsafe/) · 2 ## `unsafe_requestWithdrawTimelockedStake` > Withdraws timelocked stake from a validator's staking pool. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `timelocked_staked_iota< ObjectID >` (required): the object ID of the TimelockedStakedIota to be withdrawn. * `gas< ObjectID >` (required): the gas object to be used for paying transaction fees. * `gas_budget< BigInt_for_uint64 >` (required): the maximum amount of gas the transaction is allowed to consume. The transaction will fail if this budget is exceeded. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects used to pay for the transaction execution. * `inputObjects< [InputObjectKind] >` (required): the input objects involved in the transaction, including the TimelockedStakedIota object and any supporting references. * `txBytes< Base64 >` (required): the transaction payload serialized in BCS format (without its type tag), and encoded as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_requestWithdrawTimelockedStake", "params": [ "0xSIGNER_ADDRESS", // signer "0xTIMELOCKED_STAKED_IOTA_OBJECT_ID", // timelocked_staked_iota "0xGAS_OBJECT_ID", // gas "5000000" // gas_budget ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xTIMELOCKED_STAKED_IOTA_OBJECT_ID", "objectType": "staking::TimelockedStakedIota" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_BYTES" } } ``` --- ## `unsafe_splitCoin` > Creates an unsigned transaction to split a coin into specified amounts. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `coin_object_id< ObjectID >` (required): the object ID of the coin to be split. * `split_amounts< [BigInt_for_uint64] >` (required): a list of amounts to split from the coin. Each value represents a new coin to be created with that amount. * `gas< ObjectID >` (optional): the gas object to be used for paying transaction fees. If omitted, the node selects one from the signer's assets. * `gas_budget< BigInt_for_uint64 >` (required): the maximum gas allowed for this transaction. The transaction will fail if this limit is exceeded. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects used to pay for the execution of the transaction. * `inputObjects< [InputObjectKind] >` (required): the objects involved in the transaction, including the coin being split and any other necessary references. * `txBytes< Base64 >` (required): the transaction payload serialized in BCS format (without its type tag), and encoded as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_splitCoin", "params": [ "0xSIGNER_ADDRESS", // signer "0xCOIN_OBJECT_ID", // coin_object_id ["1000", "2000", "3000"], // split_amounts<[BigInt_for_uint64]> "0xOPTIONAL_GAS_OBJECT_ID", // gas (optional, can be null) "5000000" // gas_budget ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xCOIN_OBJECT_ID", "objectType": "coin::Coin<0x2::iota::IOTA>" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_BYTES" } } ``` --- ## `unsafe_splitCoinEqual` > Creates an unsigned transaction to split a coin into equal parts. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `coin_object_id< ObjectID >` (required): the object ID of the coin to be split. * `split_count< BigInt_for_uint64 >` (required): the number of equally sized coins to create from the original coin. The total coin value will be evenly divided among them. * `gas< ObjectID >` (optional): the gas object to be used for transaction fee payment. If omitted, the node will select one automatically from the signer’s holdings. * `gas_budget< BigInt_for_uint64 >` (required): the gas budget for the transaction. The transaction fails if this amount is exceeded during execution. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects used to pay for the transaction execution. * `inputObjects< [InputObjectKind] >` (required): the input objects involved in the transaction, including the coin being split. * `txBytes< Base64 >` (required): the transaction payload serialized using BCS (without its type tag) and encoded as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_splitCoinEqual", "params": [ "0xSIGNER_ADDRESS", // signer "0xCOIN_OBJECT_ID", // coin_object_id "3", // split_count "0xOPTIONAL_GAS_OBJECT_ID", // gas (optional, can be null) "5000000" // gas_budget ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xCOIN_OBJECT_ID", "objectType": "coin::Coin<0x2::iota::IOTA>" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_BYTES" } } ``` --- ## `unsafe_transferIota` > Creates an unsigned transaction to transfer IOTA coins. Creates an unsigned transaction to send IOTA coin object to an IOTA address. The IOTA object is also used as the gas object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `iota_object_id< ObjectID >` (required): the object ID of the IOTA coin to be used in the transaction. * `gas_budget< BigInt_for_uint64 >` (required): the gas budget for the transaction. The transaction will fail if gas usage exceeds this amount. * `recipient< IotaAddress >` (required): the IOTA address of the recipient who will receive the transferred amount. * `amount< BigInt_for_uint64 >` (optional): the amount of IOTA to be split from the original coin and transferred to the recipient. If omitted, the entire coin may be transferred. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects used to pay for executing the transaction. * `inputObjects< [InputObjectKind] >` (required): the input objects involved in the transaction, including the IOTA coin and any other dependencies. * `txBytes< Base64 >` (required): the transaction data, serialized using BCS (without its type tag) and encoded as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_transferIota", "params": [ "0xSIGNER_ADDRESS", // signer "0xIOTA_OBJECT_ID", // iota_object_id "5000000", // gas_budget "0xRECIPIENT_ADDRESS", // recipient "100000000" // amount (optional) ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xIOTA_OBJECT_ID", "objectType": "coin::Coin<0x2::iota::IOTA>" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_BYTES" } } ``` --- ## `unsafe_transferObject` > Creates an unsigned transaction to transfer an on-chain object. Creates an unsigned transaction to transfer an object from one address to another. The object's type must allow public transfers. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `object_id< ObjectID >` (required): the object ID of the item to be transferred. * `gas< ObjectID >` (optional): the gas object to be used for paying transaction fees. If not specified, the node selects one automatically from the signer's assets. * `gas_budget< BigInt_for_uint64 >` (required): the maximum gas allowed for this transaction. The transaction will fail if this amount is exceeded. * `recipient< IotaAddress >` (required): the IOTA address of the recipient who will receive the transferred object. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects used to pay for executing the transaction. * `inputObjects< [InputObjectKind] >` (required): the input objects involved in the transaction, including the object being transferred and any related dependencies. * `txBytes< Base64 >` (required): the transaction payload serialized using BCS (without its type tag) and encoded as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_transferObject", "params": [ "0xSIGNER_ADDRESS", // signer "0xOBJECT_ID", // object_id "0xOPTIONAL_GAS_ID", // gas (optional, can be null) "5000000", // gas_budget "0xRECIPIENT_ADDRESS" // recipient ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xOBJECT_ID", "objectType": "example::CustomObjectType" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_BYTES" } } ``` --- ## `iota_devInspectTransactionBlock` > Simulates a transaction block for debugging and inspection. Runs the transaction in dev-inspect mode. Which allows for nearly any transaction (or Move call) with any arguments. Detailed results are provided, including both the transaction effects and any return values. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `sender_address< IotaAddress >` (required): the IOTA address initiating the dev inspect call. * `tx_bytes< Base64 >` (required): the BCS-encoded TransactionKind (not TransactionData). This includes only the transaction logic without gasBudget and gasPrice. * `gas_price< BigInt_for_uint64 >` (optional): the reference gas price to use for calculating gas usage. No actual gas is charged. If omitted, the system will use the default reference gas price. * `epoch< BigInt_for_uint64 >` (optional): the epoch during which to simulate the call. If not provided, it will default to the current epoch from the latest system state. * `additional_args< DevInspectArgs >` (optional): additional simulation configuration, including: `gas_budget`, `gas_objects`, `gas_sponsor`, `skip_checks`. ### Returns ``` DevInspectResults< DevInspectResults > ``` * `effects< TransactionBlockEffects >` (required): the simulated summary of effects that would likely occur if the transaction were executed. Note: not all dev-inspected transactions are valid for execution. * `error< [string, null] >` (optional): any execution error encountered during simulation, if applicable. * `events< [Event] >` (required): the list of events that would likely be emitted by the transaction if it were run. * `rawEffects< [string] >` (optional): raw data representation of the transaction effects that were simulated. * `rawTxnData< [string] >` (optional): raw data representation of the transaction itself used in the dev inspection. * `results< [IotaExecutionResult, null] >` (optional): execution results from running the transaction, including any return values or outputs from function calls. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_devInspectTransactionBlock", "params": [ "0x94f1a597b4e8f709a396f7f6b1482bdcd65a673d111e49286c527fab7c2d0961", // sender_address "BASE64_ENCODED_TX_BYTES", // tx_bytes "1", // gas_price (optional) "1000", // epoch (optional) { "gas_budget": "1000000", // gas_budget (optional) "gas_objects": ["0xGAS_OBJECT_ID"], // gas_objects<[ObjectID]> (optional) "gas_sponsor": "0xSPONSOR_ADDRESS", // gas_sponsor (optional) "skip_checks": true // skip_checks (optional) } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "effects": { // Summary of effects that would likely occur if the transaction were executed }, "error": null, "events": [ // List of events that would likely be emitted by the transaction ], "rawEffects": [ // Raw data representation of the transaction effects ], "rawTxnData": [ // Raw data representation of the transaction itself ], "results": [ // Execution results from running the transaction, including return values ] } } ``` --- ## `iota_dryRunTransactionBlock` > Simulates execution of a transaction block without committing it. Returns transaction execution effects including the gas cost summary, while the effects are not committed to the chain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `tx_bytes< Base64 >` (required): the transaction payload encoded as a base64 string. This must be the BCS-encoded `TransactionKind` (not `TransactionData`), meaning it contains only the logic of the transaction without metadata such as `gasBudget` or `gasPrice`. ### Returns ``` DryRunTransactionBlockResponse< DryRunTransactionBlockResponse > ``` * `balanceChanges< [BalanceChange] >` (required): a list of balance changes resulting from the execution of the transaction. * `effects< TransactionBlockEffects >` (required): summary of transaction effects, including created, mutated, and deleted objects, along with gas usage and status. * `events< [Event] >` (required): events emitted during the transaction execution. * `input< TransactionBlockData >` (required): the transaction input data, including sender, gas settings, and execution logic. * `objectChanges< [ObjectChange] >` (required): a list of changes made to on-chain objects, including object creation, mutation, and deletion. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_dryRunTransactionBlock", "params": [ "BASE64_ENCODED_TX_BYTES", // tx_bytes { "sender": "0xSENDER_ADDRESS", // sender "gasBudget": "1000000", // gas_budget "gasPrice": "1" // gas_price (optional) }, false // skipChecks (optional) ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "balanceChanges": [ { "owner": "0xSENDER_ADDRESS", "coinType": "0x2::iota::IOTA", "amount": "-100000" }, { "owner": "0xRECIPIENT_ADDRESS", "coinType": "0x2::iota::IOTA", "amount": "100000" } ], "effects": { "status": "success", "created": [], "mutated": [], "deleted": [], "gasUsed": "50000" }, "events": [ { "type": "0x2::iota::TransferEvent", "sender": "0xSENDER_ADDRESS", "recipient": "0xRECIPIENT_ADDRESS", "amount": "100000" } ], "input": { "sender": "0xSENDER_ADDRESS", "gasBudget": "1000000", "gasPrice": "1", "kind": { "Transfer": { "recipient": "0xRECIPIENT_ADDRESS", "amount": "100000" } } }, "objectChanges": [], "error": null } } ``` --- ## `iota_executeTransactionBlock` > Executes and commits a transaction block to the network. Executes the transaction and optionally waits for the result. Supported request types: 1. `WaitForEffectsCert` – Waits for the `TransactionEffectsCert` before returning the response. This mode serves as a proxy for transaction finality. 2. `WaitForLocalExecution` – Waits for the `TransactionEffectsCert` and ensures the node has executed the transaction locally before responding. This guarantees that the node is aware of the transaction for subsequent client queries. If the node fails to execute the transaction in time, the response includes a `false` flag indicating the failure. If neither is specified, the default behavior is `WaitForEffectsCert`—unless `options.show_events` or `options.show_effects` is set to `true`, in which case `WaitForLocalExecution` is used. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `tx_bytes< Base64 >` (required): BCS-serialized transaction data bytes (excluding the type tag), encoded as a base64 string. * `signatures< [Base64] >` (required): a list of signatures, each encoded as base64. Each entry must be in the format: flag || signature || public_key. The signatures must be committed to the intent message derived from the transaction data. * `options< TransactionBlockResponseOptions >` (optional): configuration options to specify which parts of the transaction response should be returned (e.g., events, effects, inputs). * `request_type< ExecuteTransactionRequestType >` (optional): the type of request execution behavior. If not provided, it will be inferred from options. Default is WaitForEffectsCert. ### Returns ``` IotaTransactionBlockResponse< TransactionBlockResponse > ``` * `balanceChanges< [BalanceChange, null] >` (optional): a list of balance changes resulting from the execution of the transaction. * `checkpoint< BigInt_for_uint64 | null >` (optional): the checkpoint number at which this transaction was finalized. Only available in read APIs, not execution endpoints. * `confirmedLocalExecution< [boolean, null] >` (optional): indicates whether the node has successfully executed the transaction locally. * `digest< TransactionDigest >` (required): the unique digest of the executed transaction. * `effects< TransactionBlockEffects | null >` (optional): the effects of the transaction, including status, object mutations, and gas usage. * `errors< [string] >` (optional): a list of errors encountered during transaction execution, if any. * `events< [Event, null] >` (optional): a list of events emitted during the transaction execution. * `objectChanges< [ObjectChange, null] >` (optional): a list of changes to on-chain objects, such as creations, deletions, or mutations. * `rawEffects< [string] >` (optional): the raw, serialized representation of transaction effects. * `rawTransaction< Base64 >` (optional): BCS-encoded `SenderSignedData` representing the transaction, including input object references. Will be empty if `options.show_raw_transaction` is false. * `timestampMs< BigInt_for_uint64 | null >` (optional): the Unix timestamp (in milliseconds) when the transaction was finalized. * `transaction< TransactionBlock | null >` (optional): the input data of the transaction, including sender, gas settings, and logic. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iota_executeTransactionBlock", "params": [ "BASE64_ENCODED_TX_BYTES", // tx_bytes [ "BASE64_ENCODED_SIGNATURE_1", // signatures[] "BASE64_ENCODED_SIGNATURE_2" ], { "show_input": true, "show_effects": true, "show_events": true, "show_object_changes": true, "show_raw_transaction": true, "show_balance_changes": true }, "WaitForLocalExecution" // request_type (optional) ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "digest": "9XZBtYjprrsNzL4QXHj1SmttfAWhu7A8iTfbbJcYkHQx", "transaction": { "sender": "0x1a2b3c...abcd", "gasBudget": "1000000", "kind": { "MoveCall": { "package": "0x2", "module": "pay", "function": "split", "arguments": [ ... ] } } }, "effects": { "status": "success", "gasUsed": "50000", "created": [ ... ], "mutated": [ ... ], "deleted": [ ... ] }, "events": [ { "type": "0x2::coin::SplitEvent", "sender": "0x1a2b3c...abcd", "details": { "amount": "500000", "recipient": "0x4d5e6f...beef" } } ], "balanceChanges": [ { "owner": "0x1a2b3c...abcd", "coinType": "0x2::iota::IOTA", "amount": "-500000" }, { "owner": "0x4d5e6f...beef", "coinType": "0x2::iota::IOTA", "amount": "500000" } ], "objectChanges": [ ... ], "rawTransaction": "BASE64_ENCODED_SENDER_SIGNED_DATA", "timestampMs": "1747234567890", "confirmedLocalExecution": true } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iota/unsafe/ title: IOTA — unsafe, iota (1/2) source: docs/rpc-service/chains/chains-api/iota/unsafe.mdx --- # IOTA — unsafe, iota (1/2) > API reference for [IOTA](/rpc-service/chains/chains-api/iota/). [All methods ->](/rpc-service/chains/chains-api/iota/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/iota/unsafe-p2/) ## `unsafe_pay` > Creates a transaction to transfer coins to multiple recipients. Sends `Coin` to a list of recipient addresses, where `T` can be any supported coin type. The amounts must correspond to each recipient in the list. The object specified in the `gas` field will be used to pay the transaction fee. The `gas` object must not be included in the `input_coins`. If no `gas` object is provided, the RPC server will automatically select one. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `input_coins< [ObjectID] >` (required): the list of IOTA coin object IDs to be used for this transaction. * `recipients< [IotaAddress] >` (required): the list of recipient addresses. The length must match the `amounts` array. * `amounts< [BigInt_for_uint64] >` (required): the list of amounts to send to each corresponding recipient. * `gas< ObjectID >` (optional): the gas object used to pay for transaction execution. If not provided, the node will automatically select one from the signer's assets. * `gas_budget< BigInt_for_uint64 >` (required): the gas limit for the transaction. The transaction will fail if this limit is exceeded. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects that will be used in the transaction. * `inputObjects< [InputObjectKind] >` (required): the input objects that are referenced and consumed during transaction execution. * `txBytes< Base64 >` (required): the BCS-encoded transaction data (excluding the type tag), represented as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_pay", "params": [ "0xSIGNER_ADDRESS", // IOTA address of the sender [ "0xINPUT_COIN_1", // Coin object IDs to be used "0xINPUT_COIN_2" ], [ "0xRECIPIENT_ADDRESS_1", // Recipient addresses "0xRECIPIENT_ADDRESS_2" ], [ "1000000", // Amounts to transfer (must match recipient count) "2500000" ], "0xOPTIONAL_GAS_OBJECT_ID", // Optional: gas object (omit or set to null to auto-select) "5000000" // Gas budget (as string) ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "digest": "0xTRANSACTION_DIGEST", "effects": { "status": { "status": "success" }, "executedEpoch": "123", "gasUsed": { "computationCost": "1000000", "storageCost": "80000", "storageRebate": "75000", "nonRefundableStorageFee": "0" }, "mutated": [ { "owner": { "AddressOwner": "0xSIGNER_ADDRESS" }, "reference": { "objectId": "0xPRIMARY_COIN_OBJECT_ID", "version": 12345678, "digest": "0xUPDATED_OBJECT_DIGEST" } } ], "deleted": [ { "objectId": "0xMERGED_COIN_OBJECT_ID", "version": 12345678, "digest": "0xDELETED_OBJECT_DIGEST" } ], "gasObject": { "owner": { "AddressOwner": "0xSIGNER_ADDRESS" }, "reference": { "objectId": "0xGAS_OBJECT_ID", "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } } }, "events": [], "timestampMs": "1690000000000", "checkpoint": "1234567" } } ``` --- ## `unsafe_payAllIota` > Creates a transaction to transfer all IOTA coins to a single recipient. Sends all IOTA from multiple coin objects to a single recipient. This method supports IOTA coin only and does not require a separate gas coin object. The `pay_all_iota` operation performs the following steps: 1. Aggregates the total IOTA from all input coins and consolidates it into the first input coin. 2. Transfers the updated first coin to the recipient and uses it as the gas object for the transaction. 3. After execution, the first input coin holds the remaining balance: `sum(input_coins) - actual_gas_cost`. 4. All other input coins (except the first) are deleted. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `input_coins< [ObjectID] >` (required): the IOTA coin object IDs to be used in the transaction, including the coin that will be used to pay for gas. * `recipient< IotaAddress >` (required): the address to receive the consolidated IOTA. * `gas_budget< BigInt_for_uint64 >` (required): the maximum amount of gas allowed for the transaction. The transaction will fail if this budget is exceeded. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects used in the transaction execution. * `inputObjects< [InputObjectKind] >` (required): the input objects that are referenced and processed during the transaction. * `txBytes< Base64 >` (required): the BCS-encoded transaction data, without its type tag, represented as a base64-encoded string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_payAllIota", "params": [ "0xSIGNER_ADDRESS", // IOTA address of the sender [ "0xINPUT_COIN_ID_1", // Input coins (must include coin used for gas) "0xINPUT_COIN_ID_2" ], "0xRECIPIENT_ADDRESS", // Recipient address "5000000" // Gas budget (as string) ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", // gas object used "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xINPUT_COIN_ID_1", // first coin used and retained "objectType": "coin::Coin<0x2::iota::IOTA>" }, { "objectId": "0xINPUT_COIN_ID_2", // coin that was merged and deleted "objectType": "coin::Coin<0x2::iota::IOTA>" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_DATA" // base64-encoded BCS transaction bytes } } ``` --- ## `unsafe_payIota` > Creates a transaction to transfer IOTA coins to multiple recipients. Sends IOTA coins to a list of recipient addresses based on a corresponding list of amounts. This method supports IOTA coin only and does not require a separate gas coin object. The `pay_iota` operation performs the following: 1. Debits each `input_coin` to create new coin objects corresponding to the specified amounts and assigns them to the matching recipients. 2. Accumulates any remaining IOTA from the input coins into the first input coin and uses it as the gas coin object. 3. After execution, the balance of the first input coin is: `sum(input_coins) - sum(amounts) - actual_gas_cost`. 4. All other input coins, except the first one, are deleted. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `input_coins< [ObjectID] >` (required): the list of IOTA coin object IDs to be used in this transaction, including the coin that will cover gas fees. * `recipients< [IotaAddress] >` (required): the list of recipient addresses. The length must match the amounts list. * `amounts< [BigInt_for_uint64] >` (required): the list of amounts to transfer to each corresponding recipient, in the same order as recipients. * g`as_budget< BigInt_for_uint64 >` (required): the maximum gas allowed for the transaction. The transaction fails if this budget is exceeded. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects used to pay for the transaction execution. * `inputObjects< [InputObjectKind] >` (required): the input objects referenced and consumed during the transaction. * `txBytes< Base64 >` (required): the BCS-encoded transaction data (without a type tag), represented as a base64-encoded string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_payIota", "params": [ "0xSIGNER_ADDRESS", // IOTA address of the sender [ "0xINPUT_COIN_ID_1", // IOTA coin object IDs (including the one for gas) "0xINPUT_COIN_ID_2" ], [ "0xRECIPIENT_ADDRESS_1", // Recipient addresses "0xRECIPIENT_ADDRESS_2" ], [ "1000000", // Amounts to send (must match recipients) "2500000" ], "5000000" // Gas budget (as string) ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", // gas object used "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xINPUT_COIN_ID_1", // first coin retained and used for gas "objectType": "coin::Coin<0x2::iota::IOTA>" }, { "objectId": "0xINPUT_COIN_ID_2", // coin that was consumed "objectType": "coin::Coin<0x2::iota::IOTA>" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_DATA" // base64-encoded BCS transaction bytes } } ``` --- ## `unsafe_publish` > Creates an unsigned transaction to publish Move modules. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `sender< IotaAddress >` (required): the IOTA address of the transaction signer. * `compiled_modules< [Base64] >` (required): the compiled Move modules, encoded in base64 format. * `dependencies< [ObjectID] >` (required): a list of object IDs representing the transitive dependencies required by the Move package. * `gas< ObjectID >` (optional): the gas coin object to use for paying transaction fees. If not specified, the node will auto-select one from the sender's assets. * `gas_budget< BigInt_for_uint64 >` (required): the gas budget for the transaction. The transaction will fail if gas consumption exceeds this value. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects used to pay for the transaction execution. * `inputObjects< [InputObjectKind] >` (required): the input objects that are referenced, mutated, or consumed during the transaction. * `txBytes< Base64 >` (required): the transaction payload, serialized in BCS format without its type tag, and encoded as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_publish", "params": [ "0xSIGNER_ADDRESS", // sender [ "BASE64_COMPILED_MODULE_1", // compiled_modules<[Base64]> "BASE64_COMPILED_MODULE_2" ], [ "0xDEPENDENCY_OBJECT_ID_1", // dependencies<[ObjectID]> "0xDEPENDENCY_OBJECT_ID_2" ], "0xOPTIONAL_GAS_OBJECT_ID", // gas (optional) "10000000" // gas_budget ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", // Gas object used "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xSIGNER_ADDRESS", "objectType": "0x2::account::Account" }, { "objectId": "0xDEPENDENCY_OBJECT_ID_1", "objectType": "0x1::move_stdlib::Module" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_BYTES" } } ``` --- ## `unsafe_requestAddStake` > Creates a request to add stake. Adds stake to a validator's staking pool using multiple coins and amount. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `coins< [ObjectID] >` (required): the list of `Coin` object IDs to be staked in this transaction. * `amount< BigInt_for_uint64 >` (optional): the amount to stake. If omitted, the total balance from the provided coin objects is used. * `validator< IotaAddress >` (required): the IOTA address of the validator to which the stake is delegated. * `gas< ObjectID >` (optional): the gas object used to pay transaction fees. If not specified, one will be selected automatically from the signer's assets. * `gas_budget< BigInt_for_uint64 >` (required): the maximum amount of gas allocated for the transaction. The transaction fails if this budget is exceeded. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects that will be used to pay for the transaction. * `inputObjects< [InputObjectKind] >` (required): the input objects referenced in the transaction, including coins and validator-related inputs. * `txBytes< Base64 >` (required): the transaction data serialized in BCS format (excluding the type tag) and encoded as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_requestAddStake", "params": [ "0xSIGNER_ADDRESS", // signer [ "0xCOIN_OBJECT_ID_1", // coins<[ObjectID]> "0xCOIN_OBJECT_ID_2" ], "1000000000", // amount (optional, can be null) "0xVALIDATOR_ADDRESS", // validator "0xOPTIONAL_GAS_OBJECT_ID", // gas (optional, can be null) "5000000" // gas_budget ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xCOIN_OBJECT_ID_1", "objectType": "coin::Coin<0x2::iota::IOTA>" }, { "objectId": "0xCOIN_OBJECT_ID_2", "objectType": "coin::Coin<0x2::iota::IOTA>" }, { "objectId": "0xVALIDATOR_ADDRESS", "objectType": "staking::Validator" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_BYTES" } } ``` --- ## `unsafe_requestAddTimelockedStake` > Adds a timelocked stake. Adds timelocked stake to a validator's staking pool using multiple balances and amount. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `locked_balance< ObjectID >` (required): the object ID of the `TimeLock>` that will be staked. * `validator< IotaAddress >` (required): the IOTA address of the validator to whom the stake is being delegated. * `gas< ObjectID >` (required): the gas object used to pay for the transaction. This must be explicitly provided. * `gas_budget< BigInt_for_uint64 >` (required): the gas budget for the transaction. The transaction will fail if the actual gas used exceeds this value. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects used to pay for the transaction execution. * `inputObjects< [InputObjectKind] >` (required): the input objects involved in the transaction, such as the locked balance object and validator address. * `txBytes< Base64 >` (required): the transaction data, serialized in BCS format (without its type tag) and encoded as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_requestAddTimelockedStake", "params": [ "0xSIGNER_ADDRESS", // signer "0xLOCKED_BALANCE_OBJECT_ID", // locked_balance "0xVALIDATOR_ADDRESS", // validator "0xGAS_OBJECT_ID", // gas "5000000" // gas_budget ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xLOCKED_BALANCE_OBJECT_ID", "objectType": "timelock::TimeLock>" }, { "objectId": "0xVALIDATOR_ADDRESS", "objectType": "staking::Validator" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_BYTES" } } ``` --- ## `unsafe_requestWithdrawStake` > Withdraws stake from a validator's staking pool. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `signer< IotaAddress >` (required): the IOTA address of the transaction signer. * `staked_iota< ObjectID >` (required): the object ID of the StakedIota that is to be withdrawn. * `gas< ObjectID >` (optional): the gas object to be used for transaction fees. If not specified, the node will automatically select one from the signer's holdings. * `gas_budget< BigInt_for_uint64 >` (required): the maximum gas allowed for the transaction. The transaction will fail if gas consumption exceeds this value. ### Returns ``` TransactionBlockBytes< TransactionBlockBytes > ``` * `gas< [ObjectRef] >` (required): the gas objects used to pay for the transaction execution. * `inputObjects< [InputObjectKind] >` (required): the input objects involved in the transaction, including the staked IOTA object and any additional references. * `txBytes< Base64 >` (required): the transaction payload, serialized in BCS format (excluding its type tag), and encoded as a base64 string. ### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unsafe_requestWithdrawStake", "params": [ "0xSIGNER_ADDRESS", // signer "0xSTAKED_IOTA_OBJECT_ID", // staked_iota "0xOPTIONAL_GAS_OBJECT_ID", // gas (optional, can be null) "5000000" // gas_budget ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "gas": [ { "objectId": "0xGAS_OBJECT_ID", "version": 12345678, "digest": "0xGAS_OBJECT_DIGEST" } ], "inputObjects": [ { "objectId": "0xSTAKED_IOTA_OBJECT_ID", "objectType": "staking::StakedIota" } ], "txBytes": "BASE64_ENCODED_TRANSACTION_BYTES" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iotex/ title: IoTeX description: IoTeX is an EVM-compatible platform with a vision of the Internet of Trusted Things. 21 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/iotex/index.mdx --- # IoTeX
> IoTeX API is available on [Web3 API platform](https://www.ankr.com/rpc/iotex). *IoTeX* is an EVM-compatible platform with a vision of the Internet of Trusted Things. It is a decentralized ecosystem set up to guarantee security and trust between humans and machines. IoTeX supports self-sovereign users to solely own and control their devices, as well as the data and value they generate. In order for your Web3 application to interact with IoTeX — either by reading blockchain data or sending transactions to the network — it must connect to an IoTeX node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/iotex/web3/#web3_clientversion) — returns the current client version. * [`net_version`](/rpc-service/chains/chains-api/iotex/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/iotex/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_protocolversion`](/rpc-service/chains/chains-api/iotex/web3/#eth_protocolversion) — returns the current Ethereum protocol version. * [`eth_gasPrice`](/rpc-service/chains/chains-api/iotex/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_blockNumber`](/rpc-service/chains/chains-api/iotex/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/iotex/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/iotex/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/iotex/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/iotex/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getCode`](/rpc-service/chains/chains-api/iotex/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/iotex/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/iotex/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/iotex/web3/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/iotex/web3/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getLogs`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/iotex/web3/#web3_clientversion) - [`net_version`](/rpc-service/chains/chains-api/iotex/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/iotex/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/iotex/web3/#eth_protocolversion) - [`eth_gasPrice`](/rpc-service/chains/chains-api/iotex/web3/#eth_gasprice) - [`eth_blockNumber`](/rpc-service/chains/chains-api/iotex/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/iotex/web3/#eth_getbalance) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/iotex/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/iotex/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/iotex/web3/#eth_getblocktransactioncountbynumber) - [`eth_getCode`](/rpc-service/chains/chains-api/iotex/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/iotex/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/iotex/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/iotex/web3/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/iotex/web3/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_gettransactionreceipt) - [`eth_getLogs`](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iotex/web3-p2/ title: IoTeX — web3, net, eth (2/2) source: docs/rpc-service/chains/chains-api/iotex/web3-p2.mdx --- # IoTeX — web3, net, eth (2/2) > API reference for [IoTeX](/rpc-service/chains/chains-api/iotex/). [All methods ->](/rpc-service/chains/chains-api/iotex/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/iotex/web3/) · 2 ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "author": "0x63C144292716bf162a961FF5ef62ed379140b965", "number": "0x1b4", "hash": "0x8fadc5e2bf4025c4c6dbba84474c0db68ffa147b9c540d306cd739792aadf211", "parentHash": "0x906acb6e624980dcf39b080ef674dbdcc63fe79145bc5b1cb59fbd7fe2b50c15", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "transactionsRoot": "0xc3f5575e091bca9544f4be33543417087d0055dbfaa00fa87b8daae1e3b190cf", "stateRoot": "0xa1a8eb9a2424f01403ed35dd58a30f2b6df29867177ff91b13308b08b1cf6bea", "receiptsRoot": "0xd8eb436222fc46edd96d8d31aac4a74cbb0e69d8cfdd3d43417c170b7a2388df", "miner": "0x63C144292716bf162a961FF5ef62ed379140b965", "difficulty": "0xfffffffffffffffffffffffffffffffe", "totalDifficulty": "0xff14700000000000000000000000486001d72", "extraData": "0x", "size": "0x1", "gasLimit": "0x0", "gasUsed": "0x0", "timestamp": "0x5cbd334e", "transactions": [], "step": "373422302", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xc5043f", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x00005a74000000fec7bf1f56c60d8fc0903da29d13b8e151c768c8630b999b4c", "blockNumber": "0xc5043f", "from": "0xc473ba887c10ec39533fa734d95be5712c556bb1", "gas": "0x445c0", "gasPrice": "0x2e90edd000", "hash": "0x37c19dd4771fd81cd2d0f3379e47dc4c11ff31f74b771ef631b162db0e0b5167", "input": "0xb3d16931000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000003e63e6ae34fcb270f19fdbe83d506e803fdc402ef650000000000000000000003e5971d049b7bde4ca9192a461708ebb54c8ebc08430000000b53affd05137f800021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000000000000000000000000000000000000000000400000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c8300000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d", "nonce": "0xcd", "to": "0xc6e3567cc9cef8cc243343186cb64b4fc9d7cd0c", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "v": "0x218", "r": "0x6bfc4a999f4f3aeea39a872d3b1a44b5f9dae0ffb27c4bb1e1bbb77a473742ff", "s": "0x5ea8bc05b9de3617dd7242ef263defaea92fa239e0f8695d51e5ae335c21de31" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3c9329b765d88c03d18f87dc1f2b5138c89d9a415d5c73dc7827b87aca176c8e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/iotex/web3/ title: IoTeX — web3, net, eth (1/2) source: docs/rpc-service/chains/chains-api/iotex/web3.mdx --- # IoTeX — web3, net, eth (1/2) > API reference for [IoTeX](/rpc-service/chains/chains-api/iotex/). [All methods ->](/rpc-service/chains/chains-api/iotex/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/iotex/web3-p2/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "v1.9.1/go version go1.19.3 linux/amd64" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "4689" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "64", "id": 1 } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xe8d4a51000" } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1507f7c" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2c85c3ecfcb5fb" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x36c1d18"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xb6" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/iotex/web3-p2/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kaia/ title: Kaia description: Kaia is an EVM-compatible Layer 1 public blockchain designed to bring Web3 services to millions of users across… 27 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/kaia/index.mdx --- # Kaia
> Kaia API is available on [Web3 API platform](https://www.ankr.com/rpc/kaia). *Kaia* is an EVM-compatible Layer 1 public blockchain designed to bring Web3 services to millions of users across Asia. Formed through the merger of the Klaytn and Finschia blockchains — initially developed by Kakao and LINE respectively — Kaia aims to integrate a broad user base with vast on-chain assets and technology to help builders promptly implement and expand their ideas with successful results. Key Features of Kaia: * **High Performance**: Kaia achieves immediate transaction finality with a 1-second block time, processing approximately 4,000 transactions per second. * **User Accessibility**: By integrating with popular messaging apps like KakaoTalk and LINE, Kaia provides easy access to existing Web2 users, facilitating seamless onboarding to Web3 services. * **Developer-Friendly Environment**: Kaia offers EVM equivalence, allowing developers to deploy existing Ethereum-based applications with minimal modifications. Planned support for CosmWasm and integration with industry-leading cross-chain bridges provide developers with unparalleled flexibility. * **Scalability**: The network's modular architecture supports customizable and easily deployable service chains as Layer 2 solutions, enhancing scalability for high-throughput services. * **Governance**: Kaia implements an on-chain governance system designed to be fair and inclusive, with voting rights proportional to the amount of KAIA tokens staked. In order for your Web3 application to interact with Kaia — either by reading blockchain data or sending transactions to the network — it must connect to a Kaia node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## EVM Methods
* [`web3_clientVersion`](/rpc-service/chains/chains-api/kaia/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/kaia/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/kaia/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/kaia/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/kaia/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/kaia/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/kaia/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/kaia/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/kaia/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/kaia/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/kaia/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/kaia/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/kaia/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/kaia/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/kaia/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/kaia/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/kaia/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/kaia/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/kaia/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kaia/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/kaia/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/kaia/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/kaia/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/kaia/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/kaia/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/kaia/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/kaia/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/kaia/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/kaia/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/kaia/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/kaia/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/kaia/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/kaia/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/kaia/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/kaia/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/kaia/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/kaia/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/kaia/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kaia/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/kaia/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/kaia/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kaia/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/kaia/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kaia/web3-p2/ title: Kaia — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/kaia/web3-p2.mdx --- # Kaia — web3, net, eth (2/3) > API reference for [Kaia](/rpc-service/chains/chains-api/kaia/). [All methods ->](/rpc-service/chains/chains-api/kaia/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/kaia/web3/) · 2 · [3](/rpc-service/chains/chains-api/kaia/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": null, "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6018" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xcc9890534e3b8f33d5ab6d88a4b527a1869981a4b78b4adf35262caa882d5653", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5d21dba00", "difficulty": "0x1", "extraData": "0x", "gasLimit": "0xe8d4a50fff", "gasUsed": "0x3589e", "hash": "0xcc9890534e3b8f33d5ab6d88a4b527a1869981a4b78b4adf35262caa882d5653", "logsBloom": "0x00000000000000000000000000000000000000000000000080000004100000000000000000000000000000000100800000000000000000000000000000000000000000000000000000000008000000000400000000000000400000000000000008000000020000000000000000c80800000000000000000000000010000000000000000000000400004000000000000000000000000000000010000400000000000000000000000000000000000000001000000000000000000000000820000000000002000000000000000000000000000002000000000000000000000020000000000000010000800000000040000000000000000000001800000000000000", "miner": "0xed6ee8a1877f9582858dbe2509abb0ac33e5f24e", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x6d28d8a", "parentHash": "0x7aa3d6e85de572864174ec430c2809c9401f5abd798765704ee7620d2d87caae", "receiptsRoot": "0x065260f50d5a7d30f2c4b4cba501e8f421fdf0eca78aed3fc2dd84e3a00073bd", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0xd40", "stateRoot": "0x442c12efd3235a82ad539cf6ab827bc4e551662531e0e2768aae8e4b5b61ddbe", "timestamp": "0x63eb5e40", "totalDifficulty": "0x6d28d8b", "transactions": [ "0x1461063cff2c33b93fdc4769774bdf8eab5f7036f5a19a9fff9ef2caf0ed586a", "0x282a43264fe886bdd3026f6e8e644312532bb02b48c2c1759ae53b3ff3f46e21", "0x0ed52be4882ca9af5c29c59ed429118a1d0b214b97eed22b63543ac06dbd9af9" ], "transactionsRoot": "0x83613a33dbfebd29ce9821cb9415cb27f73e60eb8f5e44c4adb65b0e597021f2", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x6D28D8A", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5d21dba00", "difficulty": "0x1", "extraData": "0x", "gasLimit": "0xe8d4a50fff", "gasUsed": "0x3589e", "hash": "0xcc9890534e3b8f33d5ab6d88a4b527a1869981a4b78b4adf35262caa882d5653", "logsBloom": "0x00000000000000000000000000000000000000000000000080000004100000000000000000000000000000000100800000000000000000000000000000000000000000000000000000000008000000000400000000000000400000000000000008000000020000000000000000c80800000000000000000000000010000000000000000000000400004000000000000000000000000000000010000400000000000000000000000000000000000000001000000000000000000000000820000000000002000000000000000000000000000002000000000000000000000020000000000000010000800000000040000000000000000000001800000000000000", "miner": "0xed6ee8a1877f9582858dbe2509abb0ac33e5f24e", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x6d28d8a", "parentHash": "0x7aa3d6e85de572864174ec430c2809c9401f5abd798765704ee7620d2d87caae", "receiptsRoot": "0x065260f50d5a7d30f2c4b4cba501e8f421fdf0eca78aed3fc2dd84e3a00073bd", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0xd40", "stateRoot": "0x442c12efd3235a82ad539cf6ab827bc4e551662531e0e2768aae8e4b5b61ddbe", "timestamp": "0x63eb5e40", "totalDifficulty": "0x6d28d8b", "transactions": [ { "blockHash": "0xcc9890534e3b8f33d5ab6d88a4b527a1869981a4b78b4adf35262caa882d5653", "blockNumber": "0x6d28d8a", "from": "0x0c59754497698cf7084b7d5f7e5cfae2ea4ff36b", "gas": "0x186a0", "gasPrice": "0xba43b7400", "hash": "0x1461063cff2c33b93fdc4769774bdf8eab5f7036f5a19a9fff9ef2caf0ed586a", "input": "0xa9059cbb00000000000000000000000092af7988324ff1b4f0ff55061304060f63f5ca710000000000000000000000000000000000000000000000000de0b6b3a7640000", "nonce": "0x1ed", "to": "0x275f942985503d8ce9558f8377cc526a3aba3566", "transactionIndex": "0x0", "value": "0x0", "type": "0x0", "v": "0x4055", "r": "0xa9c6402c7b760cff910499e9f4368f81f72366e62e474bac3dc24970de67f6c1", "s": "0x39193fe77dd56f3cb9e48bcf4087f4008d4794f886c77709bfff4233c8c01cc7" } ], "transactionsRoot": "0x83613a33dbfebd29ce9821cb9415cb27f73e60eb8f5e44c4adb65b0e597021f2", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x0ed52be4882ca9af5c29c59ed429118a1d0b214b97eed22b63543ac06dbd9af9"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xcc9890534e3b8f33d5ab6d88a4b527a1869981a4b78b4adf35262caa882d5653", "blockNumber": "0x6d28d8a", "from": "0xd5ae677feed771de3c08524364a1895ce21e220e", "gas": "0x493e0", "gasPrice": "0x174876e800", "hash": "0x0ed52be4882ca9af5c29c59ed429118a1d0b214b97eed22b63543ac06dbd9af9", "input": "0xa9059cbb000000000000000000000000d7f931d02cdf5b7e031faf6537b93ad9c506c059000000000000000000000000000000000000000000000015b96d2345c85d8000", "nonce": "0x3445", "to": "0x9a6469aac7cd70385bdca6fa9e9356acec9c5b16", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "v": "0x4055", "r": "0xf0f7a67a7c7cfcc72d7503cac7597e7d2ea9df6a7d4f2aca06c17bc1c406f66d", "s": "0x171ddc9344e16d2e19ea4433f18d27453979d9c18ad7292fa6bac1eb31aa06d8" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xcc9890534e3b8f33d5ab6d88a4b527a1869981a4b78b4adf35262caa882d5653", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xcc9890534e3b8f33d5ab6d88a4b527a1869981a4b78b4adf35262caa882d5653", "blockNumber": "0x6d28d8a", "from": "0x0c59754497698cf7084b7d5f7e5cfae2ea4ff36b", "gas": "0x186a0", "gasPrice": "0xba43b7400", "hash": "0x1461063cff2c33b93fdc4769774bdf8eab5f7036f5a19a9fff9ef2caf0ed586a", "input": "0xa9059cbb00000000000000000000000092af7988324ff1b4f0ff55061304060f63f5ca710000000000000000000000000000000000000000000000000de0b6b3a7640000", "nonce": "0x1ed", "to": "0x275f942985503d8ce9558f8377cc526a3aba3566", "transactionIndex": "0x0", "value": "0x0", "type": "0x0", "v": "0x4055", "r": "0xa9c6402c7b760cff910499e9f4368f81f72366e62e474bac3dc24970de67f6c1", "s": "0x39193fe77dd56f3cb9e48bcf4087f4008d4794f886c77709bfff4233c8c01cc7" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x33a8fbb29792b49f7bd3e82a8f5f980438dc73ee416b946a7e19de4bc5aa8d4d", "blockNumber": "0x6d29301", "from": "0xbe02aba56bae1624e2c4f029e3a79308e2a19e98", "gas": "0xf4240", "gasPrice": "0xae9f7bcc00", "hash": "0xe15398d4fd67722a0adab5840252fa79cc60f91f870d3af7d83274eca7127a8e", "input": "0xb912b308000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000002733333737393633343538343034313738393230353732303132393432343330303235353033323600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007a4d466b77457759484b6f5a497a6a3043415159494b6f5a497a6a304441516344516741457369556b665044416448454d304c4e687357356736536f574f5042434b46636e5045475478596e44755a323758716b4e637630595843326b7474733667714375656a64587044594e5a66346c73464e66787767436577000000000000000000000000000000000000000000000000000000000000000000000000002836363330633637626630336533656462356365343266653932663933633936346666626130613431000000000000000000000000000000000000000000000000", "nonce": "0x5deca57", "to": "0x42d877932366dcaff751405c3185393f2803962d", "transactionIndex": "0x0", "value": "0x0", "type": "0x0", "v": "0x4055", "r": "0x31620883f9c0c52dedb5cc971adb2df1309e2d0f26b4eb59aaa1f99c61ba331a", "s": "0x1d28013d102fdbb4db9191c6c0a4403127c3f7cc079109494ff1568976358bae" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kaia/web3-p3/ title: Kaia — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/kaia/web3-p3.mdx --- # Kaia — web3, net, eth (3/3) > API reference for [Kaia](/rpc-service/chains/chains-api/kaia/). [All methods ->](/rpc-service/chains/chains-api/kaia/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/kaia/web3/) · [2](/rpc-service/chains/chains-api/kaia/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x0ed52be4882ca9af5c29c59ed429118a1d0b214b97eed22b63543ac06dbd9af9"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xcc9890534e3b8f33d5ab6d88a4b527a1869981a4b78b4adf35262caa882d5653", "blockNumber": "0x6d28d8a", "contractAddress": null, "cumulativeGasUsed": "0x3589e", "effectiveGasPrice": "0x5d21dba00", "from": "0xd5ae677feed771de3c08524364a1895ce21e220e", "gasUsed": "0x103f5", "logs": [ { "address": "0x9a6469aac7cd70385bdca6fa9e9356acec9c5b16", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000d5ae677feed771de3c08524364a1895ce21e220e", "0x000000000000000000000000d7f931d02cdf5b7e031faf6537b93ad9c506c059" ], "data": "0x000000000000000000000000000000000000000000000015b96d2345c85d8000", "blockNumber": "0x6d28d8a", "transactionHash": "0x0ed52be4882ca9af5c29c59ed429118a1d0b214b97eed22b63543ac06dbd9af9", "transactionIndex": "0x2", "blockHash": "0xcc9890534e3b8f33d5ab6d88a4b527a1869981a4b78b4adf35262caa882d5653", "logIndex": "0x2", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000400000000000000000000000000000000000000000000000000000000880000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000001000000000000000000000000000000000000002000000000000000000000000000002000000000000000000000000000000000000010000000000000040000000000000000000000800000000000000", "status": "0x1", "to": "0x9a6469aac7cd70385bdca6fa9e9356acec9c5b16", "transactionHash": "0x0ed52be4882ca9af5c29c59ed429118a1d0b214b97eed22b63543ac06dbd9af9", "transactionIndex": "0x2", "type": "0x0" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xd5ae677feed771de3c08524364a1895ce21e220e"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kaia/web3/ title: Kaia — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/kaia/web3.mdx --- # Kaia — web3, net, eth (1/3) > API reference for [Kaia](/rpc-service/chains/chains-api/kaia/). [All methods ->](/rpc-service/chains/chains-api/kaia/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/kaia/web3-p2/) · [3](/rpc-service/chains/chains-api/kaia/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Klaytn/v1.0.3/linux-amd64/go1.22.1" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "8217" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x66720b300" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): none. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0xbfd7dd5ea8f7407c17965d4678327468001c3e9c" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xa3c77ee" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xaa920f7b9039e556d2442113f1fd339e4927dd9a", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4f11f44d83e358f1f1" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x8e19dc520cc1fd908c95f0c7a15fb3b48feda7051cb01bcfd094348e34ba2be8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x16" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xA3C7A17"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x16" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x8e19dc520cc1fd908c95f0c7a15fb3b48feda7051cb01bcfd094348e34ba2be8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0xA3C7A17"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x7f5923e9c58d759a446705bcfe2493b10788f4c7", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/kaia/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/kaia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x7f5923e9c58d759a446705bcfe2493b10788f4c7" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/cosmos-rest-methods-2/ title: Kava — Cosmos REST methods source: docs/rpc-service/chains/chains-api/kava/cosmos-rest-methods-2.mdx --- # Kava — Cosmos REST methods > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) ### `/cosmos/tx/v1beta1/txs` > Fetches txs by event. #### Parameters * `events` (array[string]): a list of transaction event type. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Transactions. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/tx/v1beta1/txs ``` #### Response example ```json { "txs": [ { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] } ], "tx_responses": [ { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/tx/v1beta1/txs` > Broadcasts a transaction. #### Parameters * `` (object; required): ```json { "tx_bytes": "string", "mode": "BROADCAST_MODE_UNSPECIFIED" } ``` #### Returns Broadcasted transaction. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/tx/v1beta1/txs ```` #### Response example ```json { "tx_response": { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } } ``` --- ### `/cosmos/tx/v1beta1/txs/{hash}` > Fetches a tx by hash. #### Parameters * `hash` (string, hex; required): a tx hash to query, encoded as a hex string. #### Returns Transaction. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/tx/v1beta1/txs/{hash} ``` #### Response example ```json { "tx": { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] }, "tx_response": { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/ title: Kava — Cosmos REST methods (2/4) source: docs/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2.mdx --- # Kava — Cosmos REST methods (2/4) > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) > > Part 2 of 4: [1](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/) · 2 · [3](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/) · [4](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/) ### `/cosmos/slashing/v1beta1/signing_infos/{cons_address}` > Retrieves the signing info of given cons address. #### Parameters * `cons_address` (string, required): an address to query signing info for. #### Returns The signing info of all specified cons address. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/slashing/v1beta1/signing_infos/{cons_address} ``` #### Response example ```json { "val_signing_info": { "address": "string", "start_height": "string", "index_offset": "string", "jailed_until": "2021-01-19T06:34:40.106Z", "tombstoned": true, "missed_blocks_counter": "string" } } ``` --- ### Staking methods ### `/cosmos/staking/v1beta1/delegations/{delegator_addr}` > Retrieves all delegations of a given delegator address. #### Parameters * `delegator_addr` (string, required): a delegator address to query for. * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Delegations from a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/delegations/{delegator_addr} ``` #### Response example ```json { "delegation_responses": [ { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations` > Retrieves the redelegations of a given address. #### Parameters * `delegator_addr` (string, required): a delegator address to query for. * `src_validator_addr` (string): the validator address to redelegate from. * `dst_validator_addr` (string): the validator address to redelegate to. * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` `string, uint64`: a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Delegations from a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations ``` #### Response example ```json { "redelegation_responses": [ { "redelegation": { "delegator_address": "string", "validator_src_address": "string", "validator_dst_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T06:58:45.718Z", "initial_balance": "string", "shares_dst": "string" } ] }, "entries": [ { "redelegation_entry": { "creation_height": "string", "completion_time": "2021-01-19T06:58:45.718Z", "initial_balance": "string", "shares_dst": "string" }, "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations` > Retrieves all unbonding delegations of a given delegator address. #### Parameters * `delegator_addr` (string, required): a delegator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Unbonding delegations from a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations ``` #### Response example ```json { "unbonding_responses": [ { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T07:01:25.628Z", "initial_balance": "string", "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators` > Retrieves all validators info for given delegator address. #### Parameters * `delegator_addr` (string; required): a delegator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Validator info for a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators ``` #### Response example ```json { "validators": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:06:38.006Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:06:38.006Z" }, "min_self_delegation": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}` > Retrieves validator info for a given delegator-validator pair. #### Parameters * `delegator_addr` (string; required): a delegator address to query for. * `validator_addr` (string; required): a validator address to query for. #### Returns Validator info for a given delegator pair. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr} ``` #### Response example ```json { "validator": { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:08:34.100Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:08:34.100Z" }, "min_self_delegation": "string" } } ``` --- ### `/cosmos/staking/v1beta1/historical_info/{height}` > Retrieves the historical info for a given height. #### Parameters * `height` (string, int64): defines at which height to query the historical info for. #### Returns Historical info for a given height. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/historical_info/{height} ``` #### Response example ```json { "hist": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2021-01-19T07:13:57.974Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "valset": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:13:57.974Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:13:57.974Z" }, "min_self_delegation": "string" } ] } } ``` --- ### `/cosmos/staking/v1beta1/params` > Retrieves the staking parameters. #### Parameters None. #### Returns Staking parameters. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/params ``` #### Response example ```json { "params": { "unbonding_time": "string", "max_validators": 0, "max_entries": 0, "historical_entries": 0, "bond_denom": "string" } } ``` --- ### `/cosmos/staking/v1beta1/pool` > Retrieves the pool info. #### Parameters None. #### Returns Pool info. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/pool ``` #### Response example ```json { "pool": { "not_bonded_tokens": "string", "bonded_tokens": "string" } } ``` --- ### /cosmos/staking/v1beta1/validators > Retrieves all validators that match the given status. #### Parameters * `status` (string): a status to query validators by. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Validators that match the given status. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/validators ``` #### Response example ```json { "validators": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:21:25.914Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:21:25.914Z" }, "min_self_delegation": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}` > Retrieves validator info for a given validator address. #### Parameters * `validator_addr` (string; required): a validator address to query for. #### Returns Validator info for a given validator address. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/validators/{validator_addr} ``` #### Response example ```json { "validator": { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:25:26.679Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:25:26.679Z" }, "min_self_delegation": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations` > Retrieves delegate info for a given validator. #### Parameters * `validator_addr` (string; required): a validator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` `string, uint64`: a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Delegate info for a given validator. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/validators/{validator_addr}/delegations ``` #### Response example ```json { "delegation_responses": [ { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}` > Retrieves delegate info for a given validator-delegator pair. #### Parameters * `validator_addr` (string; required): a validator address to query for. * `delegator_addr` (string; required): a delegator address to query for. #### Returns Delegate info for a given validator delegator pair. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr} ``` #### Response example ```json { "delegation_response": { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation` > Retrieves unbonding info for a given validator-delegator pair. #### Parameters * `validator_addr` (string; required): a validator address to query for. * `delegator_addr` (string; required): a delegator address to query for. #### Returns Unbonding info for a given validator delegator pair. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation ``` #### Response example ```json { "unbond": { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T07:35:28.235Z", "initial_balance": "string", "balance": "string" } ] } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations` > Retrieves unbonding delegations of a validator. #### Parameters * `validator_addr` (string, required): a validator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Unbonding info for a given validator. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations ``` #### Response example ```json { "unbonding_responses": [ { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T07:37:20.281Z", "initial_balance": "string", "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### Upgrade methods ### `/cosmos/upgrade/v1beta1/applied_plan/{name}` > Retrieves a previously applied upgrade plan by its name. #### Parameters * `name` (string; required): a name of the applied plan to query for. #### Returns Previously applied upgrade plan. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/upgrade/v1beta1/applied_plan/{name} ``` #### Response example ```json { "height": "string" } ``` --- ### `/cosmos/upgrade/v1beta1/current_plan` > Retrieves the current upgrade plan. #### Parameters * `name` (string; required): a name of the applied plan to query for. #### Returns Current upgrade plan. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/upgrade/v1beta1/current_plan ``` #### Response example ```json { "plan": { "name": "string", "time": "2021-01-19T07:49:08.875Z", "height": "string", "info": "string", "upgraded_client_state": { "type_url": "string", "value": "string" } } } ``` --- ### `/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}` > Retrieves the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain, not supported with legacy querier. #### Parameters * `last_height` (string, int64): a required last height under which next consensus state is stored. #### Returns Consensus state. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height} ``` #### Response example ```json { "upgraded_consensus_state": { "type_url": "string", "value": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/ title: Kava — Cosmos REST methods (3/4) source: docs/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3.mdx --- # Kava — Cosmos REST methods (3/4) > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) > > Part 3 of 4: [1](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/) · [2](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/) · 3 · [4](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/) ### Ibc core methods ### `/ibc/core/channel/v1beta1/channels` > Retrieves all the IBC channels of a chain. #### Parameters * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns IBC channels of a chain. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels ``` #### Response example ```json { "channels": [ { "state": "STATE_UNINITIALIZED_UNSPECIFIED", "ordering": "ORDER_NONE_UNSPECIFIED", "counterparty": { "port_id": "string", "channel_id": "string" }, "connection_hops": [ "string" ], "version": "string", "port_id": "string", "channel_id": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}` > Retrieves an IBC Channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. #### Returns IBC channels of a chain. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id} ``` #### Response example ```json { "channel": { "state": "STATE_UNINITIALIZED_UNSPECIFIED", "ordering": "ORDER_NONE_UNSPECIFIED", "counterparty": { "port_id": "string", "channel_id": "string" }, "connection_hops": [ "string" ], "version": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state` > Retrieves the client state for the channel associated with the provided channel identifiers. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. #### Returns Client state. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state ``` #### Response example ```json { "identified_client_state": { "client_id": "string", "client_state": { "type_url": "string", "value": "string" } }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}` > Retrieves the consensus state for the channel associated with the provided channel identifiers. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `revision_number` (string, uint64; required): a revision number of the consensus state. * `revision_height` string, uint64; required: a revision height of the consensus state. #### Returns Consensus state. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height} ``` #### Response example ```json { "consensus_state": { "type_url": "string", "value": "string" }, "client_id": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence` > Retrieves the next receive sequence for a given channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. #### Returns Next receive sequence. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence ``` #### Response example ```json { "next_sequence_receive": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements` > Retrieves all the packet acknowledgements associated with a channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Packet acknowledgements. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements ``` #### Response example ```json { "acknowledgements": [ { "port_id": "string", "channel_id": "string", "sequence": "string", "data": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}` > Retrieves a stored packet acknowledgement hash. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `sequence` (string, uint64): a packet sequence. #### Returns Packet acknowledgements. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence} ``` #### Response example ```json { "acknowledgement": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments` > Retrieves all the packet commitments hashes associated with a channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Packet commitments. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments ``` #### Response example ```json { "commitments": [ { "port_id": "string", "channel_id": "string", "sequence": "string", "data": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks` > Retrieves all the unreceived IBC acknowledgements associated with a channel and sequences. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `packet_ack_sequence` (array[string]): a required list of acknowledgement sequences. #### Returns Unreceived IBC acknowledgements. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks ``` #### Response example ```json { "sequences": [ "string" ], "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets` > Retrieves all the unreceived IBC packets associated with a channel and sequences. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `packet_commitment_sequences` (array[string]): a list of packet sequences. #### Returns Unreceived IBC packets. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets ``` #### Response example ```json { "sequences": [ "string" ], "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}` > Retrieves a stored packet commitment hash. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `packet_commitment_sequences` (array[string]): a list of packet sequences. #### Returns Packet commitment hash. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence} ``` #### Response example ```json { "commitment": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}` > Checks whether a given packet sequence has been received on the queried chain. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `sequence` (string, uint64): a required packet sequence. #### Returns Whether the given packet has been received or not. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence} ``` #### Response example ```json { "received": true, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/connections/{connection}/channels` > Retrieves all the channels associated with a connection end. #### Parameters * `connection` (string, required): a connection unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` string($uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Channels associated with a connection. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/channel/v1beta1/connections/{connection}/channels ``` #### Response example ```json { "channels": [ { "state": "STATE_UNINITIALIZED_UNSPECIFIED", "ordering": "ORDER_NONE_UNSPECIFIED", "counterparty": { "port_id": "string", "channel_id": "string" }, "connection_hops": [ "string" ], "version": "string", "port_id": "string", "channel_id": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/client/v1beta1/params` > Retrieves all parameters of the IBC client. #### Parameters None. #### Returns Params of the IBC client. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/client/v1beta1/params ``` #### Response example ```json { "params": { "allowed_clients": [ "string" ] } } ``` --- ### `/ibc/core/client/v1beta1/client_states` > Retrieves all the IBC light clients of a chain. #### Parameters * `pagination.key` (string; byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string; uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string; uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns IBC light clients. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/client/v1beta1/client_states ``` #### Response example ```json { "client_states": [ { "client_id": "string", "client_state": { "type_url": "string", "value": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/ibc/core/client/v1beta1/client_states/{client_id}` > Retrieves an IBC light client. #### Parameters * `client_id` (string; required): a client state unique identifier. #### Returns IBC light client from client_id. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/client/v1beta1/client_states/{client_id} ``` #### Response example ```json { "client_state": { "type_url": "string", "value": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/client/v1beta1/consensus_states/{client_id}` > Retrieves all the consensus state associated with a given client. #### Parameters * `client_id` (string; required): a client unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Consensus state associated with given client #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/client/v1beta1/consensus_states/{client_id} ``` #### Response example ```json { "consensus_states": [ { "height": { "revision_number": "string", "revision_height": "string" }, "consensus_state": { "type_url": "string", "value": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}` > Retrieves a consensus state associated with a client state at a given height. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `revision_number` (string, uint64): a required consensus state revision number. * `revision_height`(string, uint64): a required consensus state revision height. * `latest_height` (boolean): overrides the height field and queries the latest stored consensus state. #### Returns Consensus state associated with a client state at a given height. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height} ``` #### Response example ```json { "consensus_state": { "type_url": "string", "value": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/client_connections/{client_id}` > Retrieves the connection paths associated with a client state. #### Parameters * `client_id` (string, required): a client identifier associated with a connection. #### Returns Connections paths associated with a client state. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/connection/v1beta1/client_connections/{client_id} ``` #### Response example ```json { "connection_paths": [ "string" ], "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/connections` > Retrieves all the IBC connections of a chain. #### Parameters * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns IBC connections. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/connection/v1beta1/connections ``` #### Response example ```json { "connections": [ { "id": "string", "client_id": "string", "versions": [ { "identifier": "string", "features": [ "string" ] } ], "state": "STATE_UNINITIALIZED_UNSPECIFIED", "counterparty": { "client_id": "string", "connection_id": "string", "prefix": { "key_prefix": "string" } }, "delay_period": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/connections/{connection_id}` > Retrieves an IBC connection end. #### Parameters * `connection_id` (string; required): a connection unique identifier. #### Returns IBC connections end. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/connection/v1beta1/connections/{connection_id} ``` #### Response example ```json { "connection": { "client_id": "string", "versions": [ { "identifier": "string", "features": [ "string" ] } ], "state": "STATE_UNINITIALIZED_UNSPECIFIED", "counterparty": { "client_id": "string", "connection_id": "string", "prefix": { "key_prefix": "string" } }, "delay_period": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/connections/{connection_id}/client_state` > Retrieves the client state associated with the connection. #### Parameters * `connection_id` (string; required): a connection unique identifier. #### Returns Client state. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/connection/v1beta1/connections/{connection_id}/client_state ``` #### Response example ```json { "identified_client_state": { "client_id": "string", "client_state": { "type_url": "string", "value": "string" } }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/ title: Kava — Cosmos REST methods (4/4) source: docs/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4.mdx --- # Kava — Cosmos REST methods (4/4) > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) > > Part 4 of 4: [1](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/) · [2](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/) · [3](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/) · 4 ### `/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}` > Retrieves the consensus state associated with the connection. #### Parameters * `connection_id` (string; required): a connection unique identifier. * `revision_number` (string, uint64): a required revision number. * `revision_height` (string, uint64): a required revision height. #### Returns Consensus state. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height} ``` #### Response example ```json { "consensus_state": { "type_url": "string", "value": "string" }, "client_id": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### Ibc applications methods ### `/ibc/applications/transfer/v1beta1/denom_traces` > Retrieves all denomination traces. #### Parameters * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Denomination traces. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/applications/transfer/v1beta1/denom_traces ``` #### Response example ```json { "denom_traces": [ { "path": "string", "base_denom": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/ibc/applications/transfer/v1beta1/denom_traces/{hash}` > Retrieves a denomination trace information by hash. #### Parameters * `hash` (string, hex; required): a hash of the denomination trace information. #### Returns Denomination traces. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/applications/transfer/v1beta1/denom_traces/{hash} ``` #### Response example ```json { "denom_trace": { "path": "string", "base_denom": "string" } } ``` --- ### `/ibc/applications/transfer/v1beta1/params` > Retrieves all parameters of the IBC transfer module. #### Parameters None. #### Returns Parameters of the IBC transfer module. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/ibc/applications/transfer/v1beta1/params ``` #### Response example ```json { "params": { "send_enabled": true, "receive_enabled": true } } ``` --- ### Tx methods ### `/cosmos/tx/v1beta1/simulate` > Simulates executing a transaction for estimating gas usage. #### Parameters * `` (object; required): ```json { "tx": { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] } } ``` #### Returns Estimated gas usage. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/tx/v1beta1/simulate ```` #### Response example ```json { "gas_info": { "gas_wanted": "string", "gas_used": "string" }, "result": { "data": "string", "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string", "index": true } ] } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/cosmos-rest-methods/ title: Kava — Cosmos REST methods (1/4) source: docs/rpc-service/chains/chains-api/kava/cosmos-rest-methods.mdx --- # Kava — Cosmos REST methods (1/4) > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) > > Part 1 of 4: 1 · [2](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/) · [3](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/) · [4](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/) ### `/cosmos/bank/v1beta1/balances/{address}` > Retrieves the balance of all coins for a single account. #### Parameters * `address`(string; required): an address to query balances for. * `pagination.key` (string, byte): value returned in `PageResponse.next_key` to begin querying the next page most efficiently. Only one of offset or key should be set. * `pagination.offset` (string, uint64): numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set. * `pagination.limit` (string, uint64): total number of results to be returned in the result page. If left empty it will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. `count_total` is only respected when `offset` is used, it is ignored when `key` is set. #### Returns Balance of all coins for a single account. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/bank/v1beta1/balances/{address} ``` #### Response example ```json { "balances": [ { "denom": "string", "amount": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` ### `/cosmos/bank/v1beta1/balances/{address}/{denom}` > Retrieves balance of a single coin for a single account. #### Parameters * `address` (string; required): an address to query balances for. * `denom` (string; required): a coin denom to query balances for. #### Returns Balance of the specific coin for a single account. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/bank/v1beta1/balances/{address}/{denom} ``` #### Response example ```shell { "balance": { "denom": "string", "amount": "string" } } ``` ### `/cosmos/bank/v1beta1/params` > Retrieves the parameters of x/bank module. #### Parameters None. #### Returns Parameters of x/bank module. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/bank/v1beta1/params ``` #### Response example ```json { "params": { "send_enabled": [ { "denom": "string", "enabled": true } ], "default_send_enabled": true } } ``` --- ### `/cosmos/bank/v1beta1/supply` > Retrieves the total supply of all coins. #### Parameters None. #### Returns Supply of all coins. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/bank/v1beta1/supply ``` #### Response example ```json { "supply": [ { "denom": "string", "amount": "string" } ] } ``` --- ### Distribution methods ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards` > Retrieves the total rewards accrued by each validator. #### Parameters * `delegator_address` (string; required): a delegator address to query for. #### Returns Rewards from each validator. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards ``` #### Response example ```shell { "rewards": [ { "validator_address": "string", "reward": [ { "denom": "string", "amount": "string" } ] } ], "total": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}` > Retrieves the total rewards accrued by a delegation. #### Parameters * `delegator_address` (string; required): a delegator address to query for. * `validator_address` (string; required): a validator address to query for. #### Returns Total rewards accrued by a delegation for a specific validator. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address} ``` #### Response example ```json { "rewards": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators` > Retrieves the validators of a delegator. #### Parameters * `delegator_address` (string; required): a delegator address to query for. #### Returns Validators for a given delegator. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators ``` #### Response example ```json { "validators": [ "string" ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address` > Retrieves withdraw address of a delegator. #### Parameters * `delegator_address` (string, required): a delegator address to query for. #### Returns Withdraw address of delegator. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address ``` #### Response example ```json { "withdraw_address": "string" } ``` --- ### `/cosmos/distribution/v1beta1/params` > Retrieves params of the distribution module. #### Parameters None. #### Returns Params of the distribution module. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/distribution/v1beta1/params ``` #### Response example ```json { "params": { "community_tax": "string", "base_proposer_reward": "string", "bonus_proposer_reward": "string", "withdraw_addr_enabled": true } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/commission` > Retrieves accumulated commission for a validator. #### Parameters * `validator_address` (string; required): a validator address to query for. #### Returns Total commission for a validator. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/distribution/v1beta1/validators/{validator_address}/commission ``` #### Response example ```json { "commission": { "commission": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards` > Retrieves the rewards of a validator address. #### Parameters * `validator_address` (string; required): validator address to query for. #### Returns Total outstanding rewards for a validator. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards ``` #### Response example ```json { "rewards": { "rewards": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/slashes` > Retrieves slash events of a validator. #### Parameters * `validator_address` (string; required): a validator address to query for. * `starting_height` (string, uint64): the optional starting height to query the hashes * `ending_height` (string, uint64): the optional ending height to query the hashes * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns All slash events of a validator. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/distribution/v1beta1/validators/{validator_address}/slashes ``` #### Response example ```json { "slashes": [ { "validator_period": "string", "fraction": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### Evidence methods ### `/cosmos/evidence/v1beta1/evidence` > Retrieves all evidence. #### Parameters * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns All evidence. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/evidence/v1beta1/evidence ``` #### Response example ```json { "evidence": [ { "type_url": "string", "value": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/evidence/v1beta1/evidence/{evidence_hash}` > Retrieves evidence based on evidence hash. #### Parameters * `evidence_hash` (string, byte): the hash of the requested evidence. #### Returns Evidence for a given hash. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/evidence/v1beta1/evidence/{evidence_hash} ``` #### Response example ```json { "evidence": { "type_url": "string", "value": "string" } } ``` --- ### Gov methods ### `/cosmos/gov/v1beta1/params/{params_type}` > Retrieves all parameters of the gov module. #### Parameters * `params_type` (string, required): parameters to query for; possible values: `voting`, `tallying`, or `deposit`. #### Returns Parameters of the gov module. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/gov/v1beta1/params/{params_type} ``` #### Response example ```json { "voting_params": { "voting_period": "string" }, "deposit_params": { "min_deposit": [ { "denom": "string", "amount": "string" } ], "max_deposit_period": "string" }, "tally_params": { "quorum": "string", "threshold": "string", "veto_threshold": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals` > Retrieves all proposals based on given status. #### Parameters * `proposal_status`: defines status of the proposals. See below for different options. Default value = PROPOSAL_STATUS_UNSPECIFIED. Other statuses: * `PROPOSAL_STATUS_UNSPECIFIED`: default proposal status. * `PROPOSAL_STATUS_DEPOSIT_PERIOD`: defines a proposal status during the deposit period. * `PROPOSAL_STATUS_VOTING_PERIOD`: defines a proposal status during the voting period. * `PROPOSAL_STATUS_PASSED`: defines a proposal status of a proposal that has passed. * `PROPOSAL_STATUS_REJECTED`: defines a proposal status of a proposal that has been rejected. * `PROPOSAL_STATUS_FAILED`: defines a proposal status of a proposal that has failed. * `voter` (string): defines the voter address for the proposals. * `depositor` (string): defines the deposit addresses from the proposals. * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Proposals based on given status. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/gov/v1beta1/proposals ``` #### Response example ```json { "proposals": [ { "proposal_id": "string", "content": { "type_url": "string", "value": "string" }, "status": "PROPOSAL_STATUS_UNSPECIFIED", "final_tally_result": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" }, "submit_time": "2021-01-19T03:03:05.413Z", "deposit_end_time": "2021-01-19T03:03:05.413Z", "total_deposit": [ { "denom": "string", "amount": "string" } ], "voting_start_time": "2021-01-19T03:03:05.413Z", "voting_end_time": "2021-01-19T03:03:05.413Z" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}` > Retrieves proposal details based on `ProposalID`. #### Parameters * `proposal_id` (string; required): a unique id of the proposal. #### Returns Proposal details based on proposalID. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/gov/v1beta1/proposals/{proposal_id} ``` #### Response example ```json { "proposal": { "proposal_id": "string", "content": { "type_url": "string", "value": "string" }, "status": "PROPOSAL_STATUS_UNSPECIFIED", "final_tally_result": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" }, "submit_time": "2021-01-19T03:30:27.807Z", "deposit_end_time": "2021-01-19T03:30:27.807Z", "total_deposit": [ { "denom": "string", "amount": "string" } ], "voting_start_time": "2021-01-19T03:30:27.807Z", "voting_end_time": "2021-01-19T03:30:27.807Z" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` > Retrieves all deposits of a single proposal. #### Parameters * `proposal_id` (string, uint64; required): a unique id of the proposal. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns All deposits based on a proposalID. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits ``` #### Response example ```json { "deposits": [ { "proposal_id": "string", "depositor": "string", "amount": [ { "denom": "string", "amount": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}` > Retrieves single deposit information based `proposalID` and `depositAddr`. #### Parameters * `proposal_id` (string, uint64): a required unique id of the proposal. * `depositor` (string): the deposit addresses from the proposals. #### Returns Single deposit based on a proposalID. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor} ``` #### Response example ```json { "deposit": { "proposal_id": "string", "depositor": "string", "amount": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/tally` > Retrieves the tally of a proposal vote. #### Parameters * `proposal_id` (string, uint64): a required unique ID of the proposal. #### Returns Tally of proposal vote. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/gov/v1beta1/proposals/{proposal_id}/tally ``` #### Response example ```json { "tally": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/votes` > Retrieves the votes of a given proposal. #### Parameters * `proposal_id` (string($uint64), required): a unique id of the proposal * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Votes for a given proposal. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/gov/v1beta1/proposals/{proposal_id}/votes ``` #### Response example ```json { "votes": [ { "proposal_id": "string", "voter": "string", "option": "VOTE_OPTION_UNSPECIFIED" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}` > Retrieves voted information based on `proposalID` and `voterAddr`. #### Parameters * `proposal_id` (string, uint64; required): a unique ID of the proposal. * `voter` (string): the other address for the proposals. #### Returns Votes for a given proposal. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter} ``` #### Response example ```json { "vote": { "proposal_id": "string", "voter": "string", "option": "VOTE_OPTION_UNSPECIFIED" } } ``` --- ### Mint methods ### `/cosmos/mint/v1beta1/annual_provisions` > Retrieves the current minting annual provisions value. #### Parameters None. #### Returns Value of minting annual provisions. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/mint/v1beta1/annual_provisions ``` #### Response example ```json { "error": "string", "code": 0, "message": "string", "details": [ { "type_url": "string", "value": "string" } ] } ``` --- ### `/cosmos/mint/v1beta1/inflation` > Retrieves the current minting inflation value. #### Parameters None. #### Returns Current minting inflation value. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/mint/v1beta1/inflation ``` #### Response example ```json { "inflation": "string" } ``` --- ### `/cosmos/mint/v1beta1/params` > Retrieves the total set of minting parameters #### Parameters None. #### Returns Total set of minting params. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/mint/v1beta1/params ``` #### Response example ```json { "params": { "mint_denom": "string", "inflation_rate_change": "string", "inflation_max": "string", "inflation_min": "string", "goal_bonded": "string", "blocks_per_year": "string" } } ``` --- ### Slashing methods ### `/cosmos/slashing/v1beta1/params` > Retrieves the slashing module parameters. #### Parameters None. #### Returns The parameters of a slashing module. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/slashing/v1beta1/params ``` #### Response example ```json { "params": { "signed_blocks_window": "string", "min_signed_per_window": "string", "downtime_jail_duration": "string", "slash_fraction_double_sign": "string", "slash_fraction_downtime": "string" } } ``` --- ### `/cosmos/slashing/v1beta1/signing_infos` > Retrieves signing info of all validators. #### Parameters * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns The signing info of all validators. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/slashing/v1beta1/signing_infos ``` #### Response example ```json { "info": [ { "address": "string", "start_height": "string", "index_offset": "string", "jailed_until": "2021-01-19T06:33:32.230Z", "tombstoned": true, "missed_blocks_counter": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/ title: Kava description: The Kava Network is the Layer-1 blockchain that combines the speed and scalability of the Cosmos SDK with the… 29 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/kava/index.mdx --- # Kava
> Kava API is available on [Web3 API platform](https://www.ankr.com/rpc/kava). The Kava Network is the Layer-1 blockchain that combines the speed and scalability of the Cosmos SDK with the developer support of Ethereum. Kava will empower developers to build for Web3 and next-gen blockchain technologies through its unique co-chain architecture. KAVA is the native governance and staking token of the Kava Network, enabling its decentralization and security. In order for your Web3 application to interact with Kava — either by reading blockchain data or sending transactions to the network — it must connect to a Kava node. Developers interact with the blockchain using the methods provided by the API. We support the following networks and protocols for Kava: * [EVM JSON-RPC API](/rpc-service/chains/chains-api/kava/#evm-json-rpc-methods) * [Tendermint JSON-RPC/REST API](/rpc-service/chains/chains-api/kava/#tendermint-json-rpcrest-methods) * [Cosmos REST API](/rpc-service/chains/chains-api/kava/#cosmos-rest-methods) Responses come in [JSON format](https://www.json.org/json-en.html). ## EVM JSON-RPC methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/kava/methods/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/kava/methods/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/kava/methods/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/kava/methods/#net_listening) — returns true if client is actively listening for network connections. * [`eth_protocolVersion`](/rpc-service/chains/chains-api/kava/methods/#eth_protocolversion) — returns the current protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/kava/methods/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/kava/methods/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/kava/methods/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/kava/methods/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/kava/methods/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/kava/methods/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/kava/methods/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/kava/methods/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/kava/methods/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/kava/methods/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/kava/methods/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/kava/methods/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/kava/methods/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kava/methods-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/kava/methods-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/kava/methods-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kava/methods-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/kava/methods-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Tendermint JSON-RPC/REST methods **Info — node information**: * [`blockchain`](/rpc-service/chains/chains-api/kava/information/#blockchain) — retrieves block headers (max: 20) for `minHeight <= height <= maxHeight`. * [`block`](/rpc-service/chains/chains-api/kava/information/#block) — retrieves a block at a specified height. * [`block_by_hash`](/rpc-service/chains/chains-api/kava/information/#block_by_hash) — retrieves a block by hash. * [`block_results`](/rpc-service/chains/chains-api/kava/information/#block_results) — retrieves block results at a specified height. * [`commit`](/rpc-service/chains/chains-api/kava/information/#commit) — retrieves commit results at a specified height. * [`validators`](/rpc-service/chains/chains-api/kava/information/#validators) — retrieves a validator set at a specified height. * [`genesis_chunked`](/rpc-service/chains/chains-api/kava/information/#genesis_chunked) — retrieves the Genesis in multiple chunks. * [`dump_consensus_state`](/rpc-service/chains/chains-api/kava/information/#dump_consensus_state) — retrieves consensus state. * [`consensus_state`](/rpc-service/chains/chains-api/kava/information-p2/#consensus_state) — retrieves consensus state. * [`consensus_params`](/rpc-service/chains/chains-api/kava/information-p2/#consensus_params) — retrieves consensus parameters. * [`unconfirmed_txs`](/rpc-service/chains/chains-api/kava/information-p2/#unconfirmed_txs) — retrieves the list of unconfirmed transactions. * [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/kava/information-p2/#num_unconfirmed_txs) — retrieves data about unconfirmed transactions. * [`tx_search`](/rpc-service/chains/chains-api/kava/information-p2/#tx_search) — searches for transactions. * [`block_search`](/rpc-service/chains/chains-api/kava/information-p2/#block_search) — searches for blocks by `BeginBlock` and `EndBlock` events. * [`tx`](/rpc-service/chains/chains-api/kava/information-p2/#tx) — retrieves transactions by hash. **Tx — transactions broadcast information**: * [`broadcast_tx_sync`](/rpc-service/chains/chains-api/kava/information-p2/#broadcast_tx_sync) — returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. * [`broadcast_tx_async`](/rpc-service/chains/chains-api/kava/information-p2/#broadcast_tx_async) — returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. * [`broadcast_tx_commit`](/rpc-service/chains/chains-api/kava/information-p2/#broadcast_tx_commit) — returns with the responses from `CheckTx` and `DeliverTx`. * [`check_tx`](/rpc-service/chains/chains-api/kava/information-p2/#check_tx) — checks the transaction without executing it. **ABCI — ABCI info**: * [`abci_info`](/rpc-service/chains/chains-api/kava/information-p3/#abci_info) — retrieves info about the application. * [`abci_query`](/rpc-service/chains/chains-api/kava/information-p3/#abci_query) — queries the application for some information. --- ## Methods ### Methods - [`web3_clientVersion`](/rpc-service/chains/chains-api/kava/methods/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/kava/methods/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/kava/methods/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/kava/methods/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/kava/methods/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/kava/methods/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/kava/methods/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/kava/methods/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/kava/methods/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/kava/methods/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/kava/methods/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/kava/methods/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/kava/methods/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/kava/methods/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/kava/methods/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/kava/methods/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/kava/methods/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/kava/methods/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/kava/methods-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kava/methods-p3/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/kava/methods-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/kava/methods-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kava/methods-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/kava/methods-p3/#eth_getlogs) ### Information, Transactions, ABCI, Cosmos REST methods - [`blockchain`](/rpc-service/chains/chains-api/kava/information/#blockchain) - [`block`](/rpc-service/chains/chains-api/kava/information/#block) - [`block_by_hash`](/rpc-service/chains/chains-api/kava/information/#block_by_hash) - [`block_results`](/rpc-service/chains/chains-api/kava/information/#block_results) - [`commit`](/rpc-service/chains/chains-api/kava/information/#commit) - [`validators`](/rpc-service/chains/chains-api/kava/information/#validators) - [`genesis_chunked`](/rpc-service/chains/chains-api/kava/information/#genesis_chunked) - [`dump_consensus_state`](/rpc-service/chains/chains-api/kava/information/#dump_consensus_state) - [`consensus_state`](/rpc-service/chains/chains-api/kava/information-p2/#consensus_state) - [`consensus_params`](/rpc-service/chains/chains-api/kava/information-p2/#consensus_params) - [`unconfirmed_txs`](/rpc-service/chains/chains-api/kava/information-p2/#unconfirmed_txs) - [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/kava/information-p2/#num_unconfirmed_txs) - [`tx_search`](/rpc-service/chains/chains-api/kava/information-p2/#tx_search) - [`block_search`](/rpc-service/chains/chains-api/kava/information-p2/#block_search) - [`tx`](/rpc-service/chains/chains-api/kava/information-p2/#tx) - [`broadcast_tx_sync`](/rpc-service/chains/chains-api/kava/information-p2/#broadcast_tx_sync) - [`Parameters`](/rpc-service/chains/chains-api/kava/methods/#parameters) - [`broadcast_tx_async`](/rpc-service/chains/chains-api/kava/information-p2/#broadcast_tx_async) - [`broadcast_tx_commit`](/rpc-service/chains/chains-api/kava/information-p2/#broadcast_tx_commit) - [`check_tx`](/rpc-service/chains/chains-api/kava/information-p2/#check_tx) - [`abci_info`](/rpc-service/chains/chains-api/kava/information-p3/#abci_info) - [`abci_query`](/rpc-service/chains/chains-api/kava/information-p3/#abci_query) - [`Auth methods`](/rpc-service/chains/chains-api/kava/information-p3/#auth-methods) - [`/cosmos/auth/v1beta1/accounts/{address}`](/rpc-service/chains/chains-api/kava/information-p3/#cosmosauthv1beta1accountsaddress) - [`/cosmos/auth/v1beta1/params`](/rpc-service/chains/chains-api/kava/information-p3/#cosmosauthv1beta1params) - [`Bank methods`](/rpc-service/chains/chains-api/kava/information-p3/#bank-methods) ### Cosmos REST methods - [`/cosmos/bank/v1beta1/balances/{address}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosbankv1beta1balancesaddress) - [`/cosmos/bank/v1beta1/balances/{address}/{denom}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosbankv1beta1balancesaddressdenom) - [`/cosmos/bank/v1beta1/params`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosbankv1beta1params) - [`/cosmos/bank/v1beta1/supply`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosbankv1beta1supply) - [`Distribution methods`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#distribution-methods) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosdistributionv1beta1delegatorsdelegator_addressrewards) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosdistributionv1beta1delegatorsdelegator_addressrewardsvalidator_address) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosdistributionv1beta1delegatorsdelegator_addressvalidators) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosdistributionv1beta1delegatorsdelegator_addresswithdraw_address) - [`/cosmos/distribution/v1beta1/params`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosdistributionv1beta1params) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/commission`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosdistributionv1beta1validatorsvalidator_addresscommission) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosdistributionv1beta1validatorsvalidator_addressoutstanding_rewards) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/slashes`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosdistributionv1beta1validatorsvalidator_addressslashes) - [`Evidence methods`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#evidence-methods) - [`/cosmos/evidence/v1beta1/evidence`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosevidencev1beta1evidence) - [`/cosmos/evidence/v1beta1/evidence/{evidence_hash}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosevidencev1beta1evidenceevidence_hash) - [`Gov methods`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#gov-methods) - [`/cosmos/gov/v1beta1/params/{params_type}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosgovv1beta1paramsparams_type) - [`/cosmos/gov/v1beta1/proposals`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosgovv1beta1proposals) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_id) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_iddeposits) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_iddepositsdepositor) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/tally`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_idtally) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_idvotes) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_idvotesvoter) - [`Mint methods`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#mint-methods) - [`/cosmos/mint/v1beta1/annual_provisions`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosmintv1beta1annual_provisions) - [`/cosmos/mint/v1beta1/inflation`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosmintv1beta1inflation) - [`/cosmos/mint/v1beta1/params`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosmintv1beta1params) - [`Slashing methods`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#slashing-methods) - [`/cosmos/slashing/v1beta1/params`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosslashingv1beta1params) - [`/cosmos/slashing/v1beta1/signing_infos`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods/#cosmosslashingv1beta1signing_infos) - [`/cosmos/slashing/v1beta1/signing_infos/{cons_address}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosslashingv1beta1signing_infoscons_address) - [`Staking methods`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#staking-methods) - [`/cosmos/staking/v1beta1/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegationsdelegator_addr) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegatorsdelegator_addrredelegations) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegatorsdelegator_addrunbonding_delegations) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidators) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidatorsvalidator_addr) - [`/cosmos/staking/v1beta1/historical_info/{height}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1historical_infoheight) - [`/cosmos/staking/v1beta1/params`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1params) - [`/cosmos/staking/v1beta1/pool`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1pool) - [`/cosmos/staking/v1beta1/validators`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1validators) - [`/cosmos/staking/v1beta1/validators/{validator_addr}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addr) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrdelegations) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addr) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addrunbonding_delegation) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrunbonding_delegations) - [`Upgrade methods`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#upgrade-methods) - [`/cosmos/upgrade/v1beta1/applied_plan/{name}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosupgradev1beta1applied_planname) - [`/cosmos/upgrade/v1beta1/current_plan`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosupgradev1beta1current_plan) - [`/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p2/#cosmosupgradev1beta1upgraded_consensus_statelast_height) - [`Ibc core methods`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibc-core-methods) - [`/ibc/core/channel/v1beta1/channels`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channels) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_id) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idclient_state) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idconsensus_staterevisionrevision_numberheightrevision_height) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idnext_sequence) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_acknowledgements) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_ackssequence) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitments) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitmentspacket_ack_sequencesunreceived_acks) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitmentspacket_commitment_sequencesunreceived_packets) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitmentssequence) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_receiptssequence) - [`/ibc/core/channel/v1beta1/connections/{connection}/channels`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccorechannelv1beta1connectionsconnectionchannels) - [`/ibc/client/v1beta1/params`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibcclientv1beta1params) - [`/ibc/core/client/v1beta1/client_states`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccoreclientv1beta1client_states) - [`/ibc/core/client/v1beta1/client_states/{client_id}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccoreclientv1beta1client_statesclient_id) - [`/ibc/core/client/v1beta1/consensus_states/{client_id}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccoreclientv1beta1consensus_statesclient_id) - [`/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccoreclientv1beta1consensus_statesclient_idrevisionrevision_numberheightrevision_height) - [`/ibc/core/connection/v1beta1/client_connections/{client_id}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1client_connectionsclient_id) - [`/ibc/core/connection/v1beta1/connections`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1connections) - [`/ibc/core/connection/v1beta1/connections/{connection_id}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1connectionsconnection_id) - [`/ibc/core/connection/v1beta1/connections/{connection_id}/client_state`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1connectionsconnection_idclient_state) - [`/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/#ibccoreconnectionv1beta1connectionsconnection_idconsensus_staterevisionrevision_numberheightrevision_height) - [`Ibc applications methods`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/#ibc-applications-methods) - [`/ibc/applications/transfer/v1beta1/denom_traces`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/#ibcapplicationstransferv1beta1denom_traces) - [`/ibc/applications/transfer/v1beta1/denom_traces/{hash}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/#ibcapplicationstransferv1beta1denom_traceshash) - [`/ibc/applications/transfer/v1beta1/params`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/#ibcapplicationstransferv1beta1params) - [`Tx methods`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/#tx-methods) - [`/cosmos/tx/v1beta1/simulate`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-p4/#cosmostxv1beta1simulate) ### Cosmos REST methods - [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-2/#cosmostxv1beta1txs-1) - [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-2/#cosmostxv1beta1txs-1) - [`/cosmos/tx/v1beta1/txs/{hash}`](/rpc-service/chains/chains-api/kava/cosmos-rest-methods-2/#cosmostxv1beta1txshash) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/information-p2/ title: Kava — Information, Transactions, ABCI, Cosmos REST methods (2/3) source: docs/rpc-service/chains/chains-api/kava/information-p2.mdx --- # Kava — Information, Transactions, ABCI, Cosmos REST methods (2/3) > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/kava/information/) · 2 · [3](/rpc-service/chains/chains-api/kava/information-p3/) ## Information ### `consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns Consensus state results. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/consensus_state ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "round_state": { "height/round/step": "13213043/0/6", "start_time": "2024-12-23T15:53:01.989949876Z", "proposal_block_hash": "78CB001605FE99454B82944CB47D65D093629DDD38454260E7B7980874A6A5D7", "locked_block_hash": "78CB001605FE99454B82944CB47D65D093629DDD38454260E7B7980874A6A5D7", "valid_block_hash": "78CB001605FE99454B82944CB47D65D093629DDD38454260E7B7980874A6A5D7", "height_vote_set": [ { "round": 0, "prevotes": [ "Vote{0:279EAD5DD43F 13213043/00/SIGNED_MSG_TYPE_PREVOTE(Prevote) 78CB001605FE 619E4C697B2C @ 2024-12-23T15:53:02.160332603Z}", "Vote{1:BD417EAD7FF9 13213043/00/SIGNED_MSG_TYPE_PREVOTE(Prevote) 78CB001605FE 82F0E2036082 @ 2024-12-23T15:53:02.374084828Z}" ], "prevotes_bit_array": "BA{88:xxxxxxxxxx__xxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxx_xxxxxxxxxxxxxxx} 110520639/117416870 = 0.94", "precommits": [ "Vote{0:279EAD5DD43F 13213043/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 78CB001605FE 92F18B4F01EA @ 2024-12-23T15:53:02.551832113Z}", "nil-Vote", "Vote{2:BFA6235D9556 13213043/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 78CB001605FE 0FB040BC54A6 @ 2024-12-23T15:53:02.563127503Z}", "nil-Vote" ], "precommits_bit_array": "BA{88:x_x_x________x_x__x_xx____x__xxxx___x_xx_xx_xxx_xxx__x___xxx__xx_xxx__x___x___xx___xxxx_} 52462972/117416870 = 0.45" }, { "round": 1, "prevotes": [ "nil-Vote", "nil-Vote" ], "prevotes_bit_array": "BA{88:________________________________________________________________________________________} 0/117416870 = 0.00", "precommits": [ "nil-Vote", "nil-Vote" ], "precommits_bit_array": "BA{88:________________________________________________________________________________________} 0/117416870 = 0.00" } ], "proposer": { "address": "026D3C349592A1A1D6534744106D7B0453E3C565", "index": 29 } } } } ``` --- ### `consensus_params` > Retrieves consensus parameters. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be returned. #### Returns Consensus parameters results. #### Request parameters ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_params", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/consensus_params?height=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block_height": "1", "consensus_params": { "block": { "max_bytes": "200000", "max_gas": "20000000" }, "evidence": { "max_age_num_blocks": "1000000", "max_age_duration": "6000000000000000", "max_bytes": "50000" }, "validator": { "pub_key_types": [ "ed25519" ] }, "version": { "app": "0" } } } } ``` --- ### `unconfirmed_txs` > Retrieves the list of unconfirmed transactions. #### Parameters
* `limit` (integer; default: 30; max: 100): the maximum number of unconfirmed transactions to return. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unconfirmed_txs", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/unconfirmed_txs?limit=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "n_txs": "2", "total": "4", "total_bytes": "2012", "txs": [ "CoYBCoMBCiQva2F2YS5wcmljZWZlZWQudjFiZXRhMS5Nc2dQb3N0UHJpY2USWwora2F2YTE5cmprNXFtbXd5d256ZmNjd3p5bjAyanl3Z3B3anFmNjBhZmo5MhILdXNkeDp1c2Q6MzAaEjcxODkzMDAwMDAwMDAwMDA2OSILCPHVsLsGEMCO5TcSagpSCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohA31VSgUTeXh1kcCYwNrx04+4ItSC8M6wuKV96JLq9G0pEgQKAggBGJHBFxIUCg4KBXVrYXZhEgU1MDAwMBDwkwkaQKvIEvEmlpm5Xuw9on+NLx53kPmvw3QI2Fic1/IDowITWeN8bbGHdomSC1cdnrtZ8rxaBUnfpLM7Yisnk4cqcl4=", "CoQBCoEBCiQva2F2YS5wcmljZWZlZWQudjFiZXRhMS5Nc2dQb3N0UHJpY2USWQora2F2YTF1ZWFrN256ZXNtM3BuZXY2bG5ncDZsZ2swcnkwMmRqejhwanBjZxIIdXNkeDp1c2QaEjczMzg5OTk5OTk5OTk5OTk5NyIMCLSAp7sGEMCR+NQCEmkKUgpGCh8vY29zbW9zLmNyeXB0by5zZWNwMjU2azEuUHViS2V5EiMKIQJh+Rd6tFqIDMHzDY2LUqIfd6iQjaxEk7kCf/PggVVILxIECgIIARj78XASEwoNCgV1a2F2YRIENTAwMBDwkwkaQNH1d9rV6P0l8EktESQ6pSg1htx5I8FNNit3kfg/bOXqJ0c5PxTgBfeitv167yLxWxyXBWaJueQGMVh8KOHi1W0=" ] } } ``` --- ### `num_unconfirmed_txs` > Retrieves data on unconfirmed transactions. #### Parameters
None. #### Returns The status of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "num_unconfirmed_txs", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/num_unconfirmed_txs ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "n_txs": "0", "total": "0", "total_bytes": "0", "txs": null } } ``` --- ### `tx_search` > Searches for transactions with their results. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height and txhash. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx_search", "params": { "query": "tx.height=13225811", "prove": true, "page": "1", "per_page": "5", "order_by": "desc" }, "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/tx_search?query=tx.height%3D13225811&prove=true&page=1&per_page=5&order_by=desc ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "txs": [], "total_count": "0" } } ``` --- ### `block_search` > Searches for blocks by `BeginBlock` and `EndBlock` events. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height. #### Returns The list of paginated blocks matching the search criteria. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_search", "params": { "query": "block.height=13225811", "page": "1", "per_page": "10", "order_by": "desc" }, "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/block_search?query=block.height%3D13225811&page=1&per_page=10&order_by=desc ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blocks": [ { "block_id": { "hash": "F054E236608C0E65DFE9231F9332D7F54F1A282D4C2C3DA6B35FAED5D4EE9169", "parts": { "total": 1, "hash": "4F02FC67A8503D1D5428EE6D1209FC5BC1BB67382DBDB53F38C3FD0783B2FC8A" } }, "block": { "header": { "version": { "block": "11" }, "chain_id": "kava_2222-10", "height": "13225811", "time": "2024-12-24T12:58:00.512093988Z", "last_block_id": { "hash": "304F208093FA799825FA221EB9B517B73A0879E6D9B971DD28FDF96F564EEC7C", "parts": { "total": 1, "hash": "4158FCF92A13A2A5F8D466BD0189EB466DDD5D1FCA7ACF0E40069A8A0B775792" } }, "last_commit_hash": "CCFD88F120E554844A8DED71E1DAF3FA8089B1D7CFDC276917C8A5E34FDE6DBD", "data_hash": "2E1EC915F83863741270A49157E2787F5F34F3B0E2E67BB1527368F8BA05D1CD", "validators_hash": "7C3AABDFAA6A53BF1C63DC025201337CA9CB3F7DE8A51EA0C54B2CEBDCEF6E39", "next_validators_hash": "7C3AABDFAA6A53BF1C63DC025201337CA9CB3F7DE8A51EA0C54B2CEBDCEF6E39", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "2AA5FE48061351DF5DD4F79C25A902466C31975199BEE286FE294273DB4FBF4A", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07" }, "data": { "txs": [ "CrIHCv4GCh8vZXRoZXJtaW50LmV2bS52MS5Nc2dFdGhlcmV1bVR4EtoGCpMGChovZXRoZXJtaW50LmV2bS52MS5MZWdhY3lUeBL0BQiXvhMSDDEwMTAwMDAwMDAwMBjJ9hgiKjB4ODE1ZjI3QTU2MTcxMUE2QjA0YmNFM0FhNjVjNUQ5QTE5NDVBNWVFQioBMDLkBHgmYbwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGdqr9oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA..." ] }, "evidence": { "evidence": [] }, "last_commit": { "height": "13225810", "round": 0, "block_id": { "hash": "304F208093FA799825FA221EB9B517B73A0879E6D9B971DD28FDF96F564EEC7C", "parts": { "total": 1, "hash": "4158FCF92A13A2A5F8D466BD0189EB466DDD5D1FCA7ACF0E40069A8A0B775792" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07", "timestamp": "2024-12-24T12:58:00.458392974Z", "signature": "LU+rS0/HPXczwL9jxzAWYHSck0ORgzD9MGLXx6POcKO2XpNnHRG8/QsxDSs4Ouy3hO9AAiG0RNUWBrVlgjlpBg==" } ] } } } ], "total_count": "1" } } ``` --- ### `tx` > Retrieves a transaction by hash. #### Parameters
* `hash` (string; required): a hash of a transaction to retrieve. * `prove` (boolean; default: false): adds proofs of the transaction's inclusion in the block. #### Returns Transaction info. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx", "params": ["4B6D8FEA3786BFC6152EAEA791C4DAF00C41E93DAD56A7230B565179CD29CAA1", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/tx?hash=4B6D8FEA3786BFC6152EAEA791C4DAF00C41E93DAD56A7230B565179CD29CAA1&prove=true ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "hash": "4B6D8FEA3786BFC6152EAEA791C4DAF00C41E93DAD56A7230B565179CD29CAA1", "height": "12345", "index": 2, "tx_result": { "code": 0, "log": "Success", "events": [ { "type": "transfer", "attributes": [ { "key": "sender", "value": "kava1xyz..." }, { "key": "recipient", "value": "kava1abc..." }, { "key": "amount", "value": "10000ukava" } ] } ] }, "tx": "BASE64_ENCODED_TX", // The transaction itself in Base64 format "proof": { "root_hash": "0xABC123...", "data": "BASE64_ENCODED_PROOF", "proof": { /* Detailed proof structure */ } } } } ``` --- ## Transactions ### `broadcast_tx_sync` > Returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. ### Parameters
* `tx` (string; required): the signed transaction, encoded as Base64. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_sync", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/broadcast_tx_sync?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "code": 0, "data": "", "log": "transaction successfully broadcasted", "hash": "0xABC123..." // The transaction hash } } ``` --- ### `broadcast_tx_async` > Returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). 3. A node is offline. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the Base64-encoded signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_async", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/broadcast_tx_async?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "code": 0, "data": "", "log": "", "hash": "0xABC123..." // Transaction hash } } ``` --- ### `broadcast_tx_commit` > Returns with the responses from `CheckTx` and `DeliverTx`. :::warning Use only for testing and development. In production, use `BroadcastTxSync` or `BroadcastTxAsync`. You can subscribe for the transaction result using JSON-RPC via a websocket (see [CometBFT docs](https://docs.cometbft.com/v0.34/core/subscription.html)). ::: :::tip CONTRACT: only returns error if `mempool.CheckTx()` errs or if we timeout waiting for tx to commit. If `CheckTx` or `DeliverTx` fails, no error will be returned, but the result will contain a non-OK ABCI code. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. ::: #### Parameters
* `tx` (string; required): the Base64-encoded signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_commit", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/broadcast_tx_commit?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "check_tx": { "code": 0, "data": "", "log": "Transaction checked successfully" }, "deliver_tx": { "code": 0, "data": "", "log": "Transaction delivered successfully", "events": [ { "type": "transfer", "attributes": [ { "key": "sender", "value": "kava1xyz..." }, { "key": "recipient", "value": "kava1abc..." }, { "key": "amount", "value": "10000ukava" } ] } ] }, "hash": "0xABC123...", "height": "12345" } } ``` --- ### `check_tx` > Checks the transaction without executing it. The transaction won't be added to the mempool. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the Base64-encoded signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "check_tx", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/check_tx?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "code": 0, "data": "", "log": "Transaction is valid", "events": [ { "type": "transfer", "attributes": [ { "key": "sender", "value": "kava1xyz..." }, { "key": "recipient", "value": "kava1abc..." }, { "key": "amount", "value": "10000ukava" } ] } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/information-p3/ title: Kava — Information, Transactions, ABCI, Cosmos REST methods (3/3) source: docs/rpc-service/chains/chains-api/kava/information-p3.mdx --- # Kava — Information, Transactions, ABCI, Cosmos REST methods (3/3) > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/kava/information/) · [2](/rpc-service/chains/chains-api/kava/information-p2/) · 3 ## ABCI ### `abci_info` > Retrieves application info. #### Parameters
None. #### Returns Application info. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_info", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/abci_info ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "response": { "data": "kava", "version": "0.27.0", "app_version": "8", "last_block_height": "13239641", "last_block_app_hash": "wLirVXfBEeq0jZcrshBGWS7AGN19N7p8aQqMAiaIl+I=" } } } ``` --- ### `abci_query` > Queries the application for particular information. #### Parameters
* `path` (string; required): a path to the data ("/a/b/c"). * `data` (string; required): the hex-encoded data. * `height` (integer; default: 0): the height (0 means latest). * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. #### Returns Particular info according to the query submitted. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_query", "params": ["a/b/c", "the_data", "1", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/blockchain?path=%2Fa%2Fb%2Fc&data=the_data&height=1&prove=true ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "response": { "code": 0, "log": "", "info": "", "index": -1, "key": "0x6b61766131387879377a...", "value": "0x123456789abcdef", // Hex-encoded value "proofOps": null, "height": "12345", "codespace": "" } } } ``` --- ## Cosmos REST methods **Query**: * [Auth methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#auth-methods) * [Bank methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#bank-methods) * [Distribution methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#distribution-methods) * [Evidence methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#evidence-methods) * [Gov methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#gov-methods) * [Mint methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#mint-methods) * [Slashing methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods/#slashing-methods) * [Staking methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#staking-methods) * [Upgrade methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p2/#upgrade-methods) * [Ibc core methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p3/#ibc-core-methods) * [Ibc applications methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#ibc-applications-methods) **Service**: * [Tx methods](/rpc-service/chains/chains-api/allora/cosmos-rest-methods-p4/#tx-methods) ### Auth methods ### `/cosmos/auth/v1beta1/accounts/{address}` > Retrieves account details based on address. #### Parameters * `address` (string; required): an address to query for account details. #### Returns Account details. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/auth/v1beta1/accounts/{address} ``` #### Response example ```json { "account": { "type_url": "string", "value": "string" } } ``` --- ### `/cosmos/auth/v1beta1/params` > Retrieves all parameters. #### Parameters None. #### Returns Parameters. #### Request example ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/auth/v1beta1/params ``` #### Response example ```json { "params": { "max_memo_characters": "string", "tx_sig_limit": "string", "tx_size_cost_per_byte": "string", "sig_verify_cost_ed25519": "string", "sig_verify_cost_secp256k1": "string" } } ``` --- ### Bank methods --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/information/ title: Kava — Information, Transactions, ABCI, Cosmos REST methods (1/3) source: docs/rpc-service/chains/chains-api/kava/information.mdx --- # Kava — Information, Transactions, ABCI, Cosmos REST methods (1/3) > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/kava/information-p2/) · [3](/rpc-service/chains/chains-api/kava/information-p3/) ## Information ### `blockchain` > Retrieves block headers for `minHeight <= height <= maxHeight`. At most 20 items will return for the `minHeight` or `maxHeight` parameters specified. If `maxHeight` does not yet exist, the blocks up to the current height will return. If `minHeight` does not exist (pruning), the earliest existing height will be used. #### Parameters
* `minHeight` (integer): the minimum block height to return. * `maxHeight` (integer): the maximum block height to return. #### Returns Block headers, in descending order (highest first). #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "blockchain", "params": ["1", "2"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/blockchain?minHeight=1&maxHeight=2 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "last_height": "13211309", "block_metas": [ { "block_id": { "hash": "606AA3A0B325273C27FCD254D528DCCB968351ECF4C045920517A5269D76DB4E", "parts": { "total": 1, "hash": "8B827E255B0EFF6D3D66315F9460D180D7A1988A5281DE11699CE204A0308E79" } }, "block_size": "6590", "header": { "version": { "block": "11" }, "chain_id": "kava_2222-10", "height": "2", "time": "2022-05-25T18:39:32.196946927Z", "last_block_id": { "hash": "9D2AF876309BB9174604004A813DCFEE94F4947B08C5BB4C1A042F318488851E", "parts": { "total": 1, "hash": "510794F966632A503431FE4515D6C15D49BCFEA9E6753E06E582C8D26C826294" } }, "last_commit_hash": "093DC4B1414DE776AAC2388AAD616FCAC5E783930420710395732259CA023DB8", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "next_validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "4107A4EABA68DEF282B97D5071440DFB121307B524B0E2B64D7F348CB57E74A9", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "330871F4F79EF8572E4AB3A64A45AF0C88AFC24E" }, "num_txs": "0" }, { "block_id": { "hash": "9D2AF876309BB9174604004A813DCFEE94F4947B08C5BB4C1A042F318488851E", "parts": { "total": 1, "hash": "510794F966632A503431FE4515D6C15D49BCFEA9E6753E06E582C8D26C826294" } }, "block_size": "339", "header": { "version": { "block": "11" }, "chain_id": "kava_2222-10", "height": "1", "time": "2022-05-25T17:00:00Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "next_validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "BFA6235D95564560A73460860B8D6F847360A31B" }, "num_txs": "0" } ] } } ``` --- ### `block` > Retrieves a block at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block is to be fetched. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/blockchain?height=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block_id": { "hash": "9D2AF876309BB9174604004A813DCFEE94F4947B08C5BB4C1A042F318488851E", "parts": { "total": 1, "hash": "510794F966632A503431FE4515D6C15D49BCFEA9E6753E06E582C8D26C826294" } }, "block": { "header": { "version": { "block": "11" }, "chain_id": "kava_2222-10", "height": "1", "time": "2022-05-25T17:00:00Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "next_validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "BFA6235D95564560A73460860B8D6F847360A31B" }, "data": { "txs": [] }, "evidence": { "evidence": [] }, "last_commit": { "height": "0", "round": 0, "block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "signatures": [] } } } } ``` --- ### `block_by_hash` > Retrieves a block by hash. #### Parameters
* `hash` (string; required): the Base64-encoded block hash. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_by_hash", "params": ["CZDLbPv0DScQ6hUoCceUnqdDEnaoPrG8RoNcoTekAKg="], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/block_by_hash?hash=0x0990cb6cfbf40d2710ea152809c7949ea7431276a83eb1bc46835ca137a400a8 ``` #### Response example ```json { "jsonrpc": "2.0", "id": -1, "result": { "block_id": { "hash": "0990CB6CFBF40D2710EA152809C7949EA7431276A83EB1BC46835CA137A400A8", "parts": { "total": 1, "hash": "BDB709FCE6291C69976F6AA6BADFAB768CCF7347CCE381D2DBE581AB1AFF1147" } }, "block": { "header": { "version": { "block": "11" }, "chain_id": "kava_2222-10", "height": "13211369", "time": "2024-12-23T13:06:40.249128874Z", "last_block_id": { "hash": "11E9C2ED7F9E6F494030DD8E6BA2887193FDBE4DCEF694193470780C56838A09", "parts": { "total": 1, "hash": "FE6664A16EA56C07254298EE325FEC08A60473A76200E959C51CABA007FCC423" } }, "last_commit_hash": "2612A440646D3101752779E27EFE43EE17363A9B7DCBCFF2C13FD1C211E396AB", "data_hash": "B9B7F0546E07BB0F1E6837CEDC92C461A545A8E208D4F584A17B5471129DFB2E", "validators_hash": "98F5D4584BB1DF0122CC6CF68BC8772EE951737F0129502282B972F2CF7F7D89", "next_validators_hash": "98F5D4584BB1DF0122CC6CF68BC8772EE951737F0129502282B972F2CF7F7D89", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "883C909F30202624527F54653CB35A0A957EA6111ED9436F21F00E9271EB4599", "last_results_hash": "9EABEC2AD9A87ADAE8B4344675DCC4EECC8251B1FDFC5388A2469D30D1904AE3", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "BFA6235D95564560A73460860B8D6F847360A31B" }, "data": { "txs": [ "CrALCvwKCh8vZXRoZXJtaW50LmV2bS52MS5Nc2dFdGhlcmV1bVR4EtgKCpEKChovZXRoZXJtaW50LmV2bS52MS5MZWdhY3lUeBLyCQiQiiISCjEwMDAwMDAwMDAY8MghIioweGJENTI5MzBBZjVmMzllMkE3QmIyMUY5YjEwZGQzOTEyNGVjOEZmYmEqATAy5Ai+doO2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE9DUv06pMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmJWcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAADIbHwO+9akmzXocUxfWdmd4JoiWwAAAAAAAAAAAAAAAJGcHCZ7wGpwOeA..." ] }, "evidence": { "evidence": [] }, "last_commit": { "height": "13211368", "round": 0, "block_id": { "hash": "11E9C2ED7F9E6F494030DD8E6BA2887193FDBE4DCEF694193470780C56838A09", "parts": { "total": 1, "hash": "FE6664A16EA56C07254298EE325FEC08A60473A76200E959C51CABA007FCC423" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07", "timestamp": "2024-12-23T13:06:40.249128874Z", "signature": "CwycpLoHveYoT/euba+mH8nfUFWvUimMqPM98IFLZPGGIqJzirAndVRhZ8YqNeBU3QaXQnpGRq5lkbh6qnTeAQ==" }, { "block_id_flag": 2, "validator_address": "BC3E38E217AC3B03E61752C5C2F918FA6539166F", "timestamp": "2024-12-23T13:06:40.318172526Z", "signature": "AeGOEuMuAaJ8zB/DJYU8bJ75OL+FAQSfzUX1FnNiKgQ4ykulN+HppLM3rcJ1uXj+pc8pbN5V5db5SKzUJCsDCQ==" } ] } } } } ``` --- ### `block_results` > Retrieves block results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block info is to be fetched. #### Returns Block results. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_results", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/block_results?height=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "height": "1", "txs_results": null, "begin_block_events": [ { "type": "coin_received", "attributes": [ { "key": "receiver", "value": "kava1m3h30wlvsf8llruxtpukdvsy0km2kum85yn938", "index": true }, { "key": "amount", "value": "38487598ukava", "index": true } ] }, { "type": "block_gas", "attributes": [ { "key": "height", "value": "1", "index": true }, { "key": "amount", "value": "0", "index": true } ] } ], "validator_updates": null, "consensus_param_updates": { "block": { "max_bytes": "200000", "max_gas": "20000000" }, "evidence": { "max_age_num_blocks": "1000000", "max_age_duration": "6000000000000000", "max_bytes": "50000" }, "validator": { "pub_key_types": [ "ed25519" ] } } } } ``` --- ### `commit` > Retrieves commit results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be fetched. #### Returns Commit results. Canonical switches from false to true for block H once block H+1 has been committed, until then it's subjective and only reflects what this node has seen so far. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "commit", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/commit?height=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "signed_header": { "header": { "version": { "block": "11" }, "chain_id": "kava_2222-10", "height": "1", "time": "2022-05-25T17:00:00Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "next_validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "BFA6235D95564560A73460860B8D6F847360A31B" }, "commit": { "height": "1", "round": 1, "block_id": { "hash": "9D2AF876309BB9174604004A813DCFEE94F4947B08C5BB4C1A042F318488851E", "parts": { "total": 1, "hash": "510794F966632A503431FE4515D6C15D49BCFEA9E6753E06E582C8D26C826294" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "BD417EAD7FF9AC70A11A01F63FB40BBDEB0F1FD4", "timestamp": "2022-05-25T18:39:32.196946927Z", "signature": "6qT1+sJhXk3SmspA9v7FZUqyBegmM0w2LRRNx6NgO045cPmHhhHNl9gNAT4OaU1ISwPXVdaIret3VrPuJtA0AA==" }, { "block_id_flag": 2, "validator_address": "BFA6235D95564560A73460860B8D6F847360A31B", "timestamp": "2022-05-25T18:39:32.085034348Z", "signature": "sid5vAgVD5WHlrCTmwBYZBVHvoS1zDft4LPDpDs4vQg6HQfUQ2Pn8d8VaCYNSwSxbfQ2eu1OoJwjPgMwlwDzDQ==" } ] } }, "canonical": true } } ``` --- ### `validators` > Retrieves a validator set at a specified height. Validators are sorted by voting power. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the validator set corresponding to the latest block is to be fetched. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30; max: 100): a number of entries per page. #### Returns Commit results. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "validators", "params": ["1","1","30"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/validators?height=1&page=2&per_page=30 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block_height": "1", "validators": [ { "address": "BD417EAD7FF9AC70A11A01F63FB40BBDEB0F1FD4", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "sIKgJJY8szFPMmKA0GehzQvKwDNe7KECDE8O+XqPuwU=" }, "voting_power": "29204205", "proposer_priority": "-82888553" } ], "count": "30", "total": "100" } } ``` --- ### `genesis_chunked` > Retrieves Genesis in multiple chunks. Gets genesis document in multiple chunks to make it easier to iterate through larger genesis structures. Each chunk is produced by converting the genesis document to JSON and then splitting the resulting payload into 16MB blocks, and then Base64-encoding each block. #### Parameters
* `chunk` (integer; default: 0): a sequence number of the chunk to download. #### Returns A Genesis chunk response. #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "genesis_chunked", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/genesis_chunked?chunk=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "chunk": 0, "total": 1, "data": "Z2VuZXNpcwo=..." } } ``` --- ### `dump_consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns A complete consensus state. See the [Vote string description](https://pkg.go.dev/github.com/tendermint/tendermint/types?tab=doc#Vote.String). #### Request example ```shell curl -X POST https://rpc.ankr.com/kava_rpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "dump_consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/kava_rpc/dump_consensus_state ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "round_state": { "height": "13211550", "round": 0, "step": 1, "start_time": "2024-12-23T13:24:44.738595111Z", "commit_time": "2024-12-23T13:24:39.738595111Z", "validators": { "validators": [ { "address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "GFeC1pZ7fslcucbIsx44x9c0MPeJlLRb+WGG/wGflbw=" }, "voting_power": "21656144", "proposer_priority": "-52387076" } ], "proposer": { "address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "GFeC1pZ7fslcucbIsx44x9c0MPeJlLRb+WGG/wGflbw=" }, "voting_power": "21656144", "proposer_priority": "-52387076" } }, "proposal": null, "proposal_block": null, "proposal_block_parts": null, "locked_round": -1, "locked_block": null, "locked_block_parts": null, "valid_round": -1, "valid_block": null, "valid_block_parts": null, "votes": [ { "round": 0, "prevotes": [ "nil-Vote", "nil-Vote" ], "prevotes_bit_array": "BA{88:________________________________________________________________________________________} 0/117388861 = 0.00", "precommits": [ "nil-Vote", "nil-Vote" ], "precommits_bit_array": "BA{88:________________________________________________________________________________________} 0/117388861 = 0.00" } ], "commit_round": -1, "last_commit": { "votes": [ "Vote{0:279EAD5DD43F 13211549/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 2F31A8E1F581 8B6CEAA65010 @ 2024-12-23T13:24:39.500074271Z}", "Vote{1:BD417EAD7FF9 13211549/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 2F31A8E1F581 31E4D1FFA299 @ 2024-12-23T13:24:39.553047425Z}" ], "votes_bit_array": "BA{88:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} 117388861/117388861 = 1.00", "peer_maj_23s": {} }, "last_validators": { "validators": [ { "address": "279EAD5DD43F82490C6B3CFB41EEF4E9A1A49D07", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "GFeC1pZ7fslcucbIsx44x9c0MPeJlLRb+WGG/wGflbw=" }, "voting_power": "21656144", "proposer_priority": "43345641" } ], "proposer": { "address": "5AA4440350230D5BB8CDFE6A5726656B4FC7DC6E", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "BM16Wru6ELaZXCyKZAH5WGxg5YiMYw2WlcpBnfdbnQg=" }, "voting_power": "162210", "proposer_priority": "-63939004" } }, "triggered_timeout_precommit": false }, "peers": [ { "node_address": "f8d5e677f1f68f8bd798752595371817f61dc532@178.128.156.131:26656", "peer_state": { "round_state": { "height": "13211550", "round": 0, "step": 1, "start_time": "2024-12-23T13:24:43.982077345Z", "proposal": false, "proposal_block_part_set_header": { "total": 0, "hash": "" }, "proposal_block_parts": null, "proposal_pol_round": -1, "proposal_pol": "________________________________________________________________________________________", "prevotes": "________________________________________________________________________________________", "precommits": "________________________________________________________________________________________", "last_commit_round": 0, "last_commit": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "catchup_commit_round": -1, "catchup_commit": "________________________________________________________________________________________" }, "stats": { "votes": "14173", "block_parts": "45" } } } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/methods-p2/ title: Kava — Methods (2/3) source: docs/rpc-service/chains/chains-api/kava/methods-p2.mdx --- # Kava — Methods (2/3) > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/kava/methods/) · 2 · [3](/rpc-service/chains/chains-api/kava/methods-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0xE0c865f883cbF9A2be65fFa03B7330013faD9BFe","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0xE0c865f883cbF9A2be65fFa03B7330013faD9BFe"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xe81063de7bb3c4703824d5d5f39bfcbe42ca21bbe9552912e83fbfc69b456982", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1312d00", "gasUsed": "0x2df97f", "hash": "0xe81063de7bb3c4703824d5d5f39bfcbe42ca21bbe9552912e83fbfc69b456982", "logsBloom": "0x0000000000000008000000200000008040004210000000000000000300000000000400004000100000000000000000008000020200002000000002000000200000004000000080080000000c0000120000000000000a000010010000000200200500000000000200004400050002100000000800000800002000001000080000000008000000000500000000000400000080100000000000000000000000020101000000108008000400000005111000000a000002000001000022000000000080000002000110030000000000100001000000200000001000010080000200000000010000000000000000000000004848000040008000000000000100000000", "miner": "0x97eaafa954a6a848df656eebb24637921a2fe798", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x847e9a", "parentHash": "0x7623510c31da52597f81b30cf8e3a0749b602c4864a0c97f1c76f01e7ac3e987", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x4fe3", "stateRoot": "0xb6fe6a8fce0b84d2626c8abcb10fb9a63ff854cc4295e413d96028dcb664bfa4", "timestamp": "0x65d61a21", "totalDifficulty": "0x0", "transactions": [ "0x504404e952225959c573209df9313437694b1256073b14d08201a89fe279e8a4", "0x17828d77a6a9326a60ab7faf56b6ecc66f0cc9ce48c7543baab4f7141dfa6764", "0x79c18d30a4e3a408658938dc6a811f2cacaac3d8e2a5149ecb1f65a89c6ddfaa", "0xa50fa76c06a6c2700574d33987f9a6fd6bc06b9a042def2b60eccc9208b1a5bf", "0x0ac7d63724960562ceda4bf5a9ae993a9200c8603dcc13413079ac44a8ed074b", "0x2ebf3882bcefdc95062b6af242c29397f26d4dae412a6ba7d86efaaf308d4612", "0x4ad4332e4df2e152145d67ba5fc4effc0a20d387f4efb1cedfe00aa727734684", "0xfa00db04008f003927619ddfc32f8f6278a9da60fc7f8d163bfae1e15d5e0977" ], "transactionsRoot": "0xdb6581a769bf9079e51815bde8b23f2b9196c22795630c638a9446181951e769", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1312d00", "gasUsed": "0x7f36a", "hash": "0x95d062cb1fcf6e0a45057a7616ea08fa0c9d9f2e517d96139585af7dca1d8e00", "logsBloom": "0x00000000000000000000000000000000000002000000000000000000000000040000000001000000000000000000008000000000000000000000000000080000000000000800000000100000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000002000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000", "miner": "0x4a71c949f46694a7e306ee80d98451954f343d55", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x847ed0", "parentHash": "0x126760ff1767c68c03d593d829fab7c4488659dac7a508f5c9a7c720bbd198ff", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x2fe6", "stateRoot": "0xa40bebeedfdbf3638ad7c9bfe00fe5c7c9b02d15a3da33ee090ffca870319933", "timestamp": "0x65d61b73", "totalDifficulty": "0x0", "transactions": [ "0xbafa2fba29f6ad040ef2516db914d0f86c6d5a383fbad6ffa1b6263590a3dfa3" ], "transactionsRoot": "0x957d70dc0b699470a00a5cc1a7a92c0107bf91132fb92aecda98eda820d82742", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x504404e952225959c573209df9313437694b1256073b14d08201a89fe279e8a4"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe81063de7bb3c4703824d5d5f39bfcbe42ca21bbe9552912e83fbfc69b456982", "blockNumber": "0x847e9a", "from": "0x5819dbc374754c027e83bd6b1e14085ae5ce2bfa", "gas": "0xaae60", "gasPrice": "0x3b9aca00", "hash": "0x504404e952225959c573209df9313437694b1256073b14d08201a89fe279e8a4", "input": "0x06c429e5000000000000000000000000919c1c267bc06a7039e03fcc2ef738525769109c000000000000000000000000a11df70789c4fe546fe347f2a9705f6fccbc05ca0000000000000000000000001a35ee4640b0a3b87705b0a4b45d227ba60ca2ad000000000000000000000000b829b68f57cc546da7e5806a929e53be32a4625d0000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000919c1c267bc06a7039e03fcc2ef738525769109c000000000000000000000000b829b68f57cc546da7e5806a929e53be32a4625d00000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000004c4b40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c8f22018d3c5f5a4101fb1448d5e5ccdda4f123e000000000000000000000000c8f22018d3c5f5a4101fb1448d5e5ccdda4f123e", "nonce": "0x30721", "to": "0x1c253ea05445a44f3d1a273a11ed498825a58228", "transactionIndex": "0x0", "value": "0x0", "type": "0x0", "chainId": "0x8ae", "v": "0x117f", "r": "0x83f5313d2a434f05435a02000f310fa2690f8b936353e233935bfc7ad8a6091c", "s": "0x7b0a065c45e00b5280906c31d75309588d15cca0c9e124052119f2d43b809fbe" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xe81063de7bb3c4703824d5d5f39bfcbe42ca21bbe9552912e83fbfc69b456982", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe81063de7bb3c4703824d5d5f39bfcbe42ca21bbe9552912e83fbfc69b456982", "blockNumber": "0x847e9a", "from": "0x5819dbc374754c027e83bd6b1e14085ae5ce2bfa", "gas": "0xaae60", "gasPrice": "0x3b9aca00", "hash": "0x504404e952225959c573209df9313437694b1256073b14d08201a89fe279e8a4", "input": "0x06c429e5000000000000000000000000919c1c267bc06a7039e03fcc2ef738525769109c000000000000000000000000a11df70789c4fe546fe347f2a9705f6fccbc05ca0000000000000000000000001a35ee4640b0a3b87705b0a4b45d227ba60ca2ad000000000000000000000000b829b68f57cc546da7e5806a929e53be32a4625d0000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000919c1c267bc06a7039e03fcc2ef738525769109c000000000000000000000000b829b68f57cc546da7e5806a929e53be32a4625d00000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000004c4b40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c8f22018d3c5f5a4101fb1448d5e5ccdda4f123e000000000000000000000000c8f22018d3c5f5a4101fb1448d5e5ccdda4f123e", "nonce": "0x30721", "to": "0x1c253ea05445a44f3d1a273a11ed498825a58228", "transactionIndex": "0x0", "value": "0x0", "type": "0x0", "chainId": "0x8ae", "v": "0x117f", "r": "0x83f5313d2a434f05435a02000f310fa2690f8b936353e233935bfc7ad8a6091c", "s": "0x7b0a065c45e00b5280906c31d75309588d15cca0c9e124052119f2d43b809fbe" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/methods-p3/ title: Kava — Methods (3/3) source: docs/rpc-service/chains/chains-api/kava/methods-p3.mdx --- # Kava — Methods (3/3) > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/kava/methods/) · [2](/rpc-service/chains/chains-api/kava/methods-p2/) · 3 ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x847E9A", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe81063de7bb3c4703824d5d5f39bfcbe42ca21bbe9552912e83fbfc69b456982", "blockNumber": "0x847e9a", "from": "0x5819dbc374754c027e83bd6b1e14085ae5ce2bfa", "gas": "0xaae60", "gasPrice": "0x3b9aca00", "hash": "0x504404e952225959c573209df9313437694b1256073b14d08201a89fe279e8a4", "input": "0x06c429e5000000000000000000000000919c1c267bc06a7039e03fcc2ef738525769109c000000000000000000000000a11df70789c4fe546fe347f2a9705f6fccbc05ca0000000000000000000000001a35ee4640b0a3b87705b0a4b45d227ba60ca2ad000000000000000000000000b829b68f57cc546da7e5806a929e53be32a4625d0000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000919c1c267bc06a7039e03fcc2ef738525769109c000000000000000000000000b829b68f57cc546da7e5806a929e53be32a4625d00000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000004c4b40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c8f22018d3c5f5a4101fb1448d5e5ccdda4f123e000000000000000000000000c8f22018d3c5f5a4101fb1448d5e5ccdda4f123e", "nonce": "0x30721", "to": "0x1c253ea05445a44f3d1a273a11ed498825a58228", "transactionIndex": "0x0", "value": "0x0", "type": "0x0", "chainId": "0x8ae", "v": "0x117f", "r": "0x83f5313d2a434f05435a02000f310fa2690f8b936353e233935bfc7ad8a6091c", "s": "0x7b0a065c45e00b5280906c31d75309588d15cca0c9e124052119f2d43b809fbe" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x504404e952225959c573209df9313437694b1256073b14d08201a89fe279e8a4"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe81063de7bb3c4703824d5d5f39bfcbe42ca21bbe9552912e83fbfc69b456982", "blockNumber": "0x847e9a", "contractAddress": null, "cumulativeGasUsed": "0x55730", "from": "0x5819dbc374754c027e83bd6b1e14085ae5ce2bfa", "gasUsed": "0x55730", "logs": [ { "address": "0x1a35ee4640b0a3b87705b0a4b45d227ba60ca2ad", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000a11df70789c4fe546fe347f2a9705f6fccbc05ca", "0x0000000000000000000000001c253ea05445a44f3d1a273a11ed498825a58228" ], "data": "0x0000000000000000000000000000000000000000000000000000000000002609", "blockNumber": "0x847e9a", "transactionHash": "0x504404e952225959c573209df9313437694b1256073b14d08201a89fe279e8a4", "transactionIndex": "0x0", "blockHash": "0xe81063de7bb3c4703824d5d5f39bfcbe42ca21bbe9552912e83fbfc69b456982", "logIndex": "0x0", "removed": false } ], "logsBloom": "0x00000000000000000000000000000080400040100000000000000001000000000004000040001000000000000000000000000200000020000000000000000000000000000000800800000008000000000000000000080000000000000000002001000000000000000000000100021000000008000000000020000010000800000000080000000000000000000004000000001000000000000000000000000001000000000080080000000000041000000000000002000000000002000000000000000002000100020000000000000001000000200000000000000080000200000000010000000000000000000000000800000000000000000000000000000000", "status": "0x1", "to": "0x1c253ea05445a44f3d1a273a11ed498825a58228", "transactionHash": "0x504404e952225959c573209df9313437694b1256073b14d08201a89fe279e8a4", "transactionIndex": "0x0", "type": "0x0" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x7eb6de38b5996d4d3568a84f6fb8e54069d23d36aa00c7dac3798e5deb164a23", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x258C44", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x2BCfE12a949267e3Da5874E44554b29FA4B753E6"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kava/methods/ title: Kava — Methods (1/3) source: docs/rpc-service/chains/chains-api/kava/methods.mdx --- # Kava — Methods (1/3) > API reference for [Kava](/rpc-service/chains/chains-api/kava/). [All methods ->](/rpc-service/chains/chains-api/kava/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/kava/methods-p2/) · [3](/rpc-service/chains/chains-api/kava/methods-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Version dev ()Compiled at using Go go1.21.1 (amd64)" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5b2c76da96136d193336fad3fbc049867b8ca157da22f69ae0e4923648250acc" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "2222" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x41", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3b9aca00" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x847e09" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xCe292495Ac1166215eA02f1616900F90B3C20762", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x594c67b5408f" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xCe292495Ac1166215eA02f1616900F90B3C20762", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xB8FF877ed78Ba520Ece21B1de7843A8a57cA47Cb", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x26db1d" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x004e9007f85b0931df490262b1605837596c8e622e981282123eb949564f4a5e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xe" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x847E17"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xa" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x2e0fde25135f358272f79f9c370b8934b4524e87bd8e04aad8a42d4fc4003c2c"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x847E12"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x2a6b5109F48A5d50D82f618500237a70608fc9b2", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/kava/methods-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/kava_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kinto/ title: Kinto description: Kinto is an L2 focused on providing safe access to on-chain finance. 27 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/kinto/index.mdx --- # Kinto
> Kinto API is available on [Web3 API platform](https://www.ankr.com/rpc/kinto). *Kinto* is an L2 focused on providing safe access to on-chain finance. It's built on top of the Ethereum network using the Arbitrum Nitro Stack, and it's non-custodial, transparent, permissionless, and governed by the community. Kinto has been designed from the ground up to provide a safe environment for users and financial institutions. Kinto has two unique features at the chain level to enhance the security of the chain: * By default, Kinto provides KYC, AML & fraud monitoring at the blockchain level. All participants in the network are KYC'ed, and the network runs AML on all of the participants. Transactions can then only be performed by verified participants achieving Sybil Resistance. PII is only saved in identity providers chosen by governance. Users' information cannot be linked to their on-chain accounts except when they choose to do so with an application that requests it. * Kinto gives every single user a smart contract wallet powered by Account Abstraction. The Kinto wallet aims to be invisible. The user does not need to worry about complicated browser extensions, seed phrases or gas while still receiving the benefits of non-custodial ownership. Kinto wallet offers similar security assurances to a Gnosis safe, the standard in on-chain security. Kinto has a two-layer governance system fully on-chain. The protocol parameters, sequencer, and treasury will be voted on-chain by 9 Nios (Guardians). Token-holders elect these 9 guardians on a rolling 6-month basis. **Blockchain interaction API** In order for your Web3 application to interact with Kinto — either by reading blockchain data or sending transactions to the network — it must connect to a Kinto node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/kinto/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/kinto/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/kinto/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/kinto/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/kinto/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/kinto/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/kinto/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/kinto/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/kinto/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/kinto/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/kinto/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/kinto/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/kinto/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/kinto/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/kinto/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/kinto/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/kinto/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/kinto/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/kinto/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kinto/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/kinto/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/kinto/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/kinto/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/kinto/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/kinto/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/kinto/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/kinto/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/kinto/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/kinto/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/kinto/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/kinto/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/kinto/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/kinto/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/kinto/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/kinto/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/kinto/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/kinto/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/kinto/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kinto/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/kinto/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/kinto/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kinto/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/kinto/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kinto/web3-p2/ title: Kinto — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/kinto/web3-p2.mdx --- # Kinto — web3, net, eth (2/3) > API reference for [Kinto](/rpc-service/chains/chains-api/kinto/). [All methods ->](/rpc-service/chains/chains-api/kinto/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/kinto/web3/) · 2 · [3](/rpc-service/chains/chains-api/kinto/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x8a4720488CA32f1223ccFE5A087e250fE3BC5D75","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53b8" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x6ce4256ec5e7e52fadc8f946cc4af33b96015ce26c2f459c0c541da1a8d66d59", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5f5e100", "difficulty": "0x1", "extraData": "0x94b55ede5165829a224376766b44991f5f70d8986858916ecfec5668fba847df", "gasLimit": "0x4000000000000", "gasUsed": "0x2be219", "hash": "0x6ce4256ec5e7e52fadc8f946cc4af33b96015ce26c2f459c0c541da1a8d66d59", "l1BlockNumber": "0x129b8e9", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xa4b000000000000000000073657175656e636572", "mixHash": "0x0000000000000006000000000129b8e9000000000000000a0000000000000000", "nonce": "0x00000000000005e8", "number": "0x1db4e", "parentHash": "0xe35332eefda19c9145728eb34c618cb10ee135dfedc1223a23e51359b34b6f5f", "receiptsRoot": "0xc62cff4bbb153c5e304d1280f5434d2a789bd8707c5d79d49546a82d5a747140", "sendCount": "0x6", "sendRoot": "0x94b55ede5165829a224376766b44991f5f70d8986858916ecfec5668fba847df", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x390", "stateRoot": "0x31cb839e0af28dc0546e54b7c4ef030b55ce847a6169eb59279b3c64e18f2ab9", "timestamp": "0x66016fa3", "totalDifficulty": "0x1db4f", "transactions": [ "0x1f2bb3e10cc2bf408a23ebf9d1e8f91392c4de1eb80d6896a18d54c398413e9a", "0xfc821c74e1a2d8cad1bc6265c54b2cc28dfb9e8da17c77e7430459aa52b8575d" ], "transactionsRoot": "0x88951ad0118232722960eb7bc88264b16a6b52a0fc1b73c4320833b9d617f891", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1DB4E", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5f5e100", "difficulty": "0x1", "extraData": "0x94b55ede5165829a224376766b44991f5f70d8986858916ecfec5668fba847df", "gasLimit": "0x4000000000000", "gasUsed": "0x2be219", "hash": "0x6ce4256ec5e7e52fadc8f946cc4af33b96015ce26c2f459c0c541da1a8d66d59", "l1BlockNumber": "0x129b8e9", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xa4b000000000000000000073657175656e636572", "mixHash": "0x0000000000000006000000000129b8e9000000000000000a0000000000000000", "nonce": "0x00000000000005e8", "number": "0x1db4e", "parentHash": "0xe35332eefda19c9145728eb34c618cb10ee135dfedc1223a23e51359b34b6f5f", "receiptsRoot": "0xc62cff4bbb153c5e304d1280f5434d2a789bd8707c5d79d49546a82d5a747140", "sendCount": "0x6", "sendRoot": "0x94b55ede5165829a224376766b44991f5f70d8986858916ecfec5668fba847df", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x390", "stateRoot": "0x31cb839e0af28dc0546e54b7c4ef030b55ce847a6169eb59279b3c64e18f2ab9", "timestamp": "0x66016fa3", "totalDifficulty": "0x1db4f", "transactions": [ { "blockHash": "0x6ce4256ec5e7e52fadc8f946cc4af33b96015ce26c2f459c0c541da1a8d66d59", "blockNumber": "0x1db4e", "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasPrice": "0x0", "hash": "0x1f2bb3e10cc2bf408a23ebf9d1e8f91392c4de1eb80d6896a18d54c398413e9a", "input": "0x6bf6a42d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000129b8e9000000000000000000000000000000000000000000000000000000000001db4e0000000000000000000000000000000000000000000000000000000000000019", "nonce": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "transactionIndex": "0x0", "value": "0x0", "type": "0x6a", "chainId": "0x1ecf", "v": "0x0", "r": "0x0", "s": "0x0" }, { "blockHash": "0x6ce4256ec5e7e52fadc8f946cc4af33b96015ce26c2f459c0c541da1a8d66d59", "blockNumber": "0x1db4e", "from": "0xb539019776ef803e89ec062ad54ca24d1fdb008a", "gas": "0x989680", "gasPrice": "0x5f5e101", "maxFeePerGas": "0xe6b2b65", "maxPriorityFeePerGas": "0x1", "hash": "0xfc821c74e1a2d8cad1bc6265c54b2cc28dfb9e8da17c77e7430459aa52b8575d", "input": "0xceb857ce00000000000000000000000099602a5c69f335fd3ffbebd6cb2775d40c3cb86b000000000000000000000000f4d81a46cc3fca44f88d87912a35e7fcc4b398ee0000000000000000000000000000000000000000000000363a007777ac4b9878", "nonce": "0x3d7", "to": "0x8a4720488ca32f1223ccfe5a087e250fe3bc5d75", "transactionIndex": "0x1", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x1ecf", "v": "0x1", "r": "0xb3b4059b1ab4e070b1b832b9f789637b7a2231a0490e9a2523371c6165bd388", "s": "0x4ae1e0cc3857002ac688a28d9a58c68cb4df3a922c1373ff6f6466bb88cbac98" } ], "transactionsRoot": "0x88951ad0118232722960eb7bc88264b16a6b52a0fc1b73c4320833b9d617f891", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbc9576525b76c63da7ddbf8a47c0073d07bdb1dbcca55f26fb88ca54f827e15e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1e78f581b6fcd916b0eaf3dc7bee9083751a046cfb580c38b6ee224e9f505b89", "blockNumber": "0x1db5e", "from": "0xb539019776ef803e89ec062ad54ca24d1fdb008a", "gas": "0x989680", "gasPrice": "0x5f5e101", "maxFeePerGas": "0xe6b2b65", "maxPriorityFeePerGas": "0x1", "hash": "0xbc9576525b76c63da7ddbf8a47c0073d07bdb1dbcca55f26fb88ca54f827e15e", "input": "0xceb857ce000000000000000000000000fb0f0332ddfcc8e5506a1c70a7ae4c01c0bc6689000000000000000000000000f4d81a46cc3fca44f88d87912a35e7fcc4b398ee0000000000000000000000000000000000000000000000120f0dee887d40efe7", "nonce": "0x3dd", "to": "0x8a4720488ca32f1223ccfe5a087e250fe3bc5d75", "transactionIndex": "0x1", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x1ecf", "v": "0x1", "r": "0xffcef313a8984824100b5445f03f1a072ac5ae73297d924f826e087bf74f0a12", "s": "0x31b063e9828ac5b84e4c93df7ac0700babade1fc15d60877b3e57779ae114327" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x1e78f581b6fcd916b0eaf3dc7bee9083751a046cfb580c38b6ee224e9f505b89", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1e78f581b6fcd916b0eaf3dc7bee9083751a046cfb580c38b6ee224e9f505b89", "blockNumber": "0x1db5e", "from": "0xb539019776ef803e89ec062ad54ca24d1fdb008a", "gas": "0x989680", "gasPrice": "0x5f5e101", "maxFeePerGas": "0xe6b2b65", "maxPriorityFeePerGas": "0x1", "hash": "0xbc9576525b76c63da7ddbf8a47c0073d07bdb1dbcca55f26fb88ca54f827e15e", "input": "0xceb857ce000000000000000000000000fb0f0332ddfcc8e5506a1c70a7ae4c01c0bc6689000000000000000000000000f4d81a46cc3fca44f88d87912a35e7fcc4b398ee0000000000000000000000000000000000000000000000120f0dee887d40efe7", "nonce": "0x3dd", "to": "0x8a4720488ca32f1223ccfe5a087e250fe3bc5d75", "transactionIndex": "0x1", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x1ecf", "v": "0x1", "r": "0xffcef313a8984824100b5445f03f1a072ac5ae73297d924f826e087bf74f0a12", "s": "0x31b063e9828ac5b84e4c93df7ac0700babade1fc15d60877b3e57779ae114327" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xb45cd132d44f317193c2d679164c8ca42cded8eb3ad0d002b28c7300c50c4181", "blockNumber": "0x1db61", "from": "0x8b03fb4c5b1aeb3c7f69d8c06487ab5572a77604", "gas": "0x4c2430", "gasPrice": "0x5f5e100", "maxFeePerGas": "0x5f5e100", "maxPriorityFeePerGas": "0x0", "hash": "0xd373642a710bcfda88df3c4857aae7e7ec454afb0c19e0ba6598e6339d168209", "input": "0x4003f6ba0000000000000000000000008b03fb4c5b1aeb3c7f69d8c06487ab5572a77604000000000000000000000000d09df9d99d1789b161ecdde7039b77cc2e6e2a450000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0", "to": "0x8a4720488ca32f1223ccfe5a087e250fe3bc5d75", "transactionIndex": "0x1", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x1ecf", "v": "0x1", "r": "0x98ef2b4f1a371db34e35b2f6c8a1540e06bfc322742325123f136e66e54ef29e", "s": "0x4622bf863f68413f54bc5bbeeeed4781712e77252bbfcf0a41daea1619d18939" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kinto/web3-p3/ title: Kinto — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/kinto/web3-p3.mdx --- # Kinto — web3, net, eth (3/3) > API reference for [Kinto](/rpc-service/chains/chains-api/kinto/). [All methods ->](/rpc-service/chains/chains-api/kinto/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/kinto/web3/) · [2](/rpc-service/chains/chains-api/kinto/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xf9c66f88afe84d9900a5b4b9c135fb56a8ae7a63b6dc2f288768a1a680633d23"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x97a05dcc331827d6351a9f1d016ebea0332c79942c9418408cb0162546a6b756", "blockNumber": "0x1db3d", "contractAddress": null, "cumulativeGasUsed": "0x20c50f", "effectiveGasPrice": "0x5f5e100", "from": "0x4062e762ec9e2e70f40bd9586c18d1894966628f", "gasUsed": "0x20c50f", "gasUsedForL1": "0x1f753e", "l1BlockNumber": "0x129b8cf", "logs": [ { "address": "0x2843c269d2a64ecfa63548e8b3fc0fd23b7f70cb", "topics": [ "0x2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4", "0x0000000000000000000000001842a4eff3efd24c50b63c3cf89cecee245fc2bd" ], "data": "0x000000000000000000000000000000000000000000000000bccd4601ba0e9151", "blockNumber": "0x1db3d", "transactionHash": "0xf9c66f88afe84d9900a5b4b9c135fb56a8ae7a63b6dc2f288768a1a680633d23", "transactionIndex": "0x1", "blockHash": "0x97a05dcc331827d6351a9f1d016ebea0332c79942c9418408cb0162546a6b756", "logIndex": "0x0", "removed": false } ], "logsBloom": "0x40000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200800000000000000000000000000000000002000000000000000000000000200000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x1842a4eff3efd24c50b63c3cf89cecee245fc2bd", "transactionHash": "0xf9c66f88afe84d9900a5b4b9c135fb56a8ae7a63b6dc2f288768a1a680633d23", "transactionIndex": "0x1", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc0da897b3a39174bc475d0149b21e94fba38e7fcbb23f75f60d7ae9a73db5c0b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["finalized", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x8a4720488CA32f1223ccFE5A087e250fE3BC5D75"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0x8a4720488ca32f1223ccfe5a087e250fe3bc5d75", "topics": [ "0xa097b826e61d0ee46c6b3b1596580ed60bd21801826a88e23c919724e6f8f213", "0x000000000000000000000000fa3120774afa7f2925ef69046f16c761f493c311", "0x0000000000000000000000008b03fb4c5b1aeb3c7f69d8c06487ab5572a77604" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000006", "blockNumber": "0x1db61", "transactionHash": "0xd373642a710bcfda88df3c4857aae7e7ec454afb0c19e0ba6598e6339d168209", "transactionIndex": "0x1", "blockHash": "0xb45cd132d44f317193c2d679164c8ca42cded8eb3ad0d002b28c7300c50c4181", "logIndex": "0x3", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kinto/web3/ title: Kinto — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/kinto/web3.mdx --- # Kinto — web3, net, eth (1/3) > API reference for [Kinto](/rpc-service/chains/chains-api/kinto/). [All methods ->](/rpc-service/chains/chains-api/kinto/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/kinto/web3-p2/) · [3](/rpc-service/chains/chains-api/kinto/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "nitro/vdevelopment/linux-amd64/go1.20.14", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "7887" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5f5e100" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1db35" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x6E31039abF8d248aBed57E307C9E1b7530c269E4", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x40aeb80be4ee100" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x6E31039abF8d248aBed57E307C9E1b7530c269E4", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x6E31039abF8d248aBed57E307C9E1b7530c269E4", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1cd" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x149a5fbe91d8e0b21abd6fd71c852c7ea9aaf66f74fbdeea2526047433d24444"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x1DB32"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x149a5fbe91d8e0b21abd6fd71c852c7ea9aaf66f74fbdeea2526047433d24444"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xeb8F29F03473b08df4027350F8e837756305d693", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/kinto/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/kinto/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kite/eth-p2/ title: Kite AI — eth, debug (2/2) source: docs/rpc-service/chains/chains-api/kite/eth-p2.mdx --- # Kite AI — eth, debug (2/2) > API reference for [Kite AI](/rpc-service/chains/chains-api/kite/). [All methods ->](/rpc-service/chains/chains-api/kite/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/kite/eth/) · 2 ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Kite AI blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kite/eth/ title: Kite AI — eth, debug (1/2) source: docs/rpc-service/chains/chains-api/kite/eth.mdx --- # Kite AI — eth, debug (1/2) > API reference for [Kite AI](/rpc-service/chains/chains-api/kite/). [All methods ->](/rpc-service/chains/chains-api/kite/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/kite/eth-p2/) ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc5a82afa5fda0fad21f573220ae47384da3aa122735b75e92cdd1fda6210400e", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x5aB420bd468BcdCa2660469cfd2AA684B6f9a0dc"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0x5ab420bd468bcdca2660469cfd2aa684b6f9a0dc", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000007adb404e4963de23dd303114f0fa56f788bf3324", "0x0000000000000000000000000000000000000000000000000000000000071b6b" ], "data": "0x", "blockNumber": "0xa2b6a", "transactionHash": "0x0f6141789a947465b4633a5eb7f91aded855086bec1944330abf1cb113b1a336", "transactionIndex": "0x1", "blockHash": "0x97861f11315028ce6a2e26767507ee4168ee69ac0599f48baaf8993b4c348665", "logIndex": "0x2", "removed": false } ] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Kite AI blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0x012ddfb7ed5ebb4ff6084204f0741097eb48aa26d643148b27ba9ea44077a39f", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0x0136ec61b1ea8e47757f6705134a6c2fff6872849d3016883733bb1e65eecc3e", "result": { "from": "0x0000777735367b36bc9b61c50022d9d0700db4ec", "gas": "0x3d090", "gasUsed": "0x2afdc", "to": "0x1670000000000000000000000000000000010001", "input": "0xda69d3db9c38bff01bf28fc5a0c36a56a657e7917db61f5228f05c5d5afa4e3e65363ea1197e968a6214a1e82df44b2220c11ef080a381e33c3610193dfcc1e7a4e458a00000000000000000000000000000000000000000000000000000000001391b410000000000000000000000000000000000000000000000000000000000a19827", "calls": [ { "from": "0x1670000000000000000000000000000000010001", "gas": "0x35859", "gasUsed": "0x25008", "to": "0x0167000000000000000000000000000000010001", "input": "0xda69d3db9c38bff01bf28fc5a0c36a56a657e7917db61f5228f05c5d5afa4e3e65363ea1197e968a6214a1e82df44b2220c11ef080a381e33c3610193dfcc1e7a4e458a00000000000000000000000000000000000000000000000000000000001391b410000000000000000000000000000000000000000000000000000000000a19827", "calls": [ { "from": "0x1670000000000000000000000000000000010001", "gas": "0x2467b", "gasUsed": "0x1dc1", "to": "0x1670000000000000000000000000000000010002", "input": "0x28f713cc0000000000000000000000000000000000000000000000000000000000028c587369676e616c5f73657276696365000000000000000000000000000000000000", "output": "0x0000000000000000000000001670000000000000000000000000000000000005", "calls": [ { "from": "0x1670000000000000000000000000000000010002", "gas": "0x22ab5", "gasUsed": "0xaa2", "to": "0x0167000000000000000000000000000000010002", "input": "0x28f713cc0000000000000000000000000000000000000000000000000000000000028c587369676e616c5f73657276696365000000000000000000000000000000000000", "output": "0x0000000000000000000000001670000000000000000000000000000000000005", "value": "0x0", "type": "DELEGATECALL" } ], "type": "STATICCALL" } ], "value": "0x0", "type": "DELEGATECALL" } ], "value": "0x0", "type": "CALL" } } ] } ``` --- ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Kite AI blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0x44CD4", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0x0136ec61b1ea8e47757f6705134a6c2fff6872849d3016883733bb1e65eecc3e", "result": { "from": "0x0000777735367b36bc9b61c50022d9d0700db4ec", "gas": "0x3d090", "gasUsed": "0x2afdc", "to": "0x1670000000000000000000000000000000010001", "input": "0xda69d3db9c38bff01bf28fc5a0c36a56a657e7917db61f5228f05c5d5afa4e3e65363ea1197e968a6214a1e82df44b2220c11ef080a381e33c3610193dfcc1e7a4e458a00000000000000000000000000000000000000000000000000000000001391b410000000000000000000000000000000000000000000000000000000000a19827", "calls": [ { "from": "0x1670000000000000000000000000000000010001", "gas": "0x35859", "gasUsed": "0x25008", "to": "0x0167000000000000000000000000000000010001", "input": "0xda69d3db9c38bff01bf28fc5a0c36a56a657e7917db61f5228f05c5d5afa4e3e65363ea1197e968a6214a1e82df44b2220c11ef080a381e33c3610193dfcc1e7a4e458a00000000000000000000000000000000000000000000000000000000001391b410000000000000000000000000000000000000000000000000000000000a19827", "calls": [ { "from": "0x1670000000000000000000000000000000010001", "gas": "0x2467b", "gasUsed": "0x1dc1", "to": "0x1670000000000000000000000000000000010002", "input": "0x28f713cc0000000000000000000000000000000000000000000000000000000000028c587369676e616c5f73657276696365000000000000000000000000000000000000", "output": "0x0000000000000000000000001670000000000000000000000000000000000005", "calls": [ { "from": "0x1670000000000000000000000000000000010002", "gas": "0x22ab5", "gasUsed": "0xaa2", "to": "0x0167000000000000000000000000000000010002", "input": "0x28f713cc0000000000000000000000000000000000000000000000000000000000028c587369676e616c5f73657276696365000000000000000000000000000000000000", "output": "0x0000000000000000000000001670000000000000000000000000000000000005", "value": "0x0", "type": "DELEGATECALL" } ], "type": "STATICCALL" } ], "value": "0x0", "type": "DELEGATECALL" } ], "value": "0x0", "type": "CALL" } } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kite/ title: Kite AI description: Kite AI is the first AI payment blockchain, providing foundational infrastructure that empowers autonomous… 31 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/kite/index.mdx --- # Kite AI
> Kite AI API is available on [Web3 API platform](https://www.ankr.com/rpc/kite). *Kite AI* is the first AI payment blockchain, providing foundational infrastructure that empowers autonomous agents to operate and transact with identity, payment, and verification. The network enables AI agents to discover and pay for services autonomously through features like funded wallets, scoped spending sessions, and service discovery, all while maintaining user control. In order for your Web3 application to interact with Kite AI — either by reading blockchain data or sending transactions to the network — it must connect to a Kite AI node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/kite/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/kite/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/kite/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/kite/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/kite/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/kite/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/kite/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/kite/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/kite/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/kite/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/kite/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/kite/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/kite/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/kite/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/kite/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/kite/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/kite/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/kite/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/kite/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/kite/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kite/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/kite/eth/#eth_getlogs) — returns logs matching the parameters specified. **Premium-only methods**: * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/kite/eth/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/kite/eth/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/kite/eth-p2/#debug_traceblock) — traces the execution of all transactions within a block. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/kite/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/kite/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/kite/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/kite/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/kite/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/kite/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/kite/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/kite/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/kite/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/kite/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/kite/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/kite/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/kite/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/kite/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/kite/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/kite/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/kite/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/kite/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kite/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/kite/web3-p3/#eth_gettransactionreceipt) ### eth, debug - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/kite/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/kite/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/kite/eth/#eth_getlogs) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/kite/eth/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/kite/eth/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/kite/eth-p2/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kite/web3-p2/ title: Kite AI — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/kite/web3-p2.mdx --- # Kite AI — web3, net, eth (2/3) > API reference for [Kite AI](/rpc-service/chains/chains-api/kite/). [All methods ->](/rpc-service/chains/chains-api/kite/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/kite/web3/) · 2 · [3](/rpc-service/chains/chains-api/kite/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x545e" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x1", "difficulty": "0x0", "extraData": "0x302e31382e302d64657600000000000000000000000000000000000000000000", "gasLimit": "0xe8b250", "gasUsed": "0x4ab5d3", "hash": "0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", "logsBloom": "0x000802200010000000100800000000000401000300000000002082018200000000001000000001000500220010002000000000000001200100200000002020420000400440000008002001091000000000400100800010000000008080028080020040000280011100080002082008006040000000010000000001108008000000041000000004d8000120001002000000001041001000042000000101000000022000000200100000200000000800000501000001000022042000884040000000204002008040000101000001002000000800000000000000000008c0002000201028088080400208002000010000200000280410010c518000000002001200", "miner": "0xe1e210594771824dad216568b91c9cb4ceed361c", "mixHash": "0x76a924a163d521a6f218cd6d7c5c034a8ad4d20c079bd707fdfe6c858526b4e6", "nonce": "0x0000000000000000", "number": "0xa2aca", "parentHash": "0xfc3f6a958d2eb00aa3bf763c85abb609bfb876457edf366b1b1fe4b20b3b5392", "receiptsRoot": "0x23724f5f91a8cef90f20e39415c54bdf1e2ac43cf99c86f78e086ab1c0e5ceca", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x563b", "stateRoot": "0x3fc853c7cb77d07d4f5c8a26e7ef3e903f9089cf9cc56f76a1f7ef2af7e17e07", "timestamp": "0x6602cfc4", "totalDifficulty": "0x0", "transactions": [ "0x7ccf86b2b79f7021cf752124519b3d95bdae519db2d90092551d258617c34bea", "0xb5136d9f0626c0c4667d251c56d0e28b82169f655e73bc929664b21cea8b2b14", "0xc5b91e76c221d360cc99d5a7038cb9ddef2e86172922d35690fa44a0ba27a2a4", "0xd39c20048d4424dd83db4ae2350426ea929360b4cc262137e0f463a1b5f9946f", "0x2d2b76942b7332043a9e4d7b9aa195143097a35fbf9afa7c59d19b624a64022f", "0xfee38b6dc9eb985e7527c1bc2dc087a0c000df6935738351005d43e1cdb72060", "0x1acf9b60fd7bdee66fd22f9e9552829a4f5a4ce0ac582fc25c4e972db4ae2d8a", "0x0a042b9b9d408d0c95e1379bde81acbdbd9df0176ed20998ede947a47b044250", "0xd1b605106868876f892cb887a415b55650a03100682d2b3c5be5ff8ed85129db", "0xd23408ab38cf6f234f7a1d8f2d142246e10ed92d98f436b342f18b9632eef5ee" ], "transactionsRoot": "0x91246983d28d6e5b84199617eb0fa683aaea059e93d366b46429e0e034f50a5c", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x1", "difficulty": "0x0", "extraData": "0x302e31382e302d64657600000000000000000000000000000000000000000000", "gasLimit": "0xe8b250", "gasUsed": "0x2aade", "hash": "0xdd3bda432583d696083e2bac2167c3aa999dd0a18f70fa796c5ca44b576e1adc", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000002040000000000400000000000000000000000000000000000000000000000002000000000000000000000000000000000000200000000000000000000000000000000000100000000000000100000000000000000000000000000000000000000000002000000000000000000000000000020100000000000002000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000001000000", "miner": "0xe1e210594771824dad216568b91c9cb4ceed361c", "mixHash": "0xa17ef61063021597ee89e2ff5e610f895b09b550cebf6c24f0c7231ee9fcf41f", "nonce": "0x0000000000000000", "number": "0xa2b16", "parentHash": "0xfeebb2da16ebbca6ff68ea2147363bba34e857ea787bdd01a5c0717b969bd9f4", "receiptsRoot": "0x690387fda3d3a8d903f4de2eadb546fd799c01af642a66bd681c7ba7998ce8df", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3e8", "stateRoot": "0xc8303658270b0ee6993841b6875f73c10cdab1a988263f071eb1a67561eccdbe", "timestamp": "0x6602d1f8", "totalDifficulty": "0x0", "transactions": [ { "blockHash": "0xdd3bda432583d696083e2bac2167c3aa999dd0a18f70fa796c5ca44b576e1adc", "blockNumber": "0xa2b16", "from": "0x0000777735367b36bc9b61c50022d9d0700db4ec", "gas": "0x3d090", "gasPrice": "0x1", "maxFeePerGas": "0x1", "maxPriorityFeePerGas": "0x0", "hash": "0xb9a04b86082f007b1f51b565835979f9a83063042d89979053555ab3295fa626", "input": "0xda69d3dbb62a06bd6f9a0a10496024008e0fa61adb990694f220ab489789e7431df2f3764624af72612a6dcea1d5ddfa6a0edba86be625adb1fdd55f90f13e23bb5946770000000000000000000000000000000000000000000000000000000000129f7c00000000000000000000000000000000000000000000000000000000003041ec", "nonce": "0xa2b27", "to": "0x1670080000000000000000000000000000010001", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x93e", "v": "0x1", "r": "0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "s": "0x72f3bdd7e94da2c30cd06275a03e4774c1d4e68a9facc87e6754065ccec5ca56", "yParity": "0x1" } ], "transactionsRoot": "0x94b5ef81fca806c7edcdd8d2d1fdc6e63cbb90c547536f9ad770dd3a562d62d8", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xf67b4d2caab1c16b6f292f7b220c09df038b7f38edcbe9e0915159817845ff9a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", "blockNumber": "0xa2aca", "from": "0xf1a66ee4db3bfec6a4233bd10e587dacdae985a6", "gas": "0x186a0", "gasPrice": "0x59682f01", "maxFeePerGas": "0x59682f01", "maxPriorityFeePerGas": "0x59682f01", "hash": "0xf67b4d2caab1c16b6f292f7b220c09df038b7f38edcbe9e0915159817845ff9a", "input": "0x", "nonce": "0x5c62", "to": "0x904d60501d8b8e904673b3e0bcc7e6ae6e57a195", "transactionIndex": "0x2c", "value": "0x38d7ea4c68000", "type": "0x2", "accessList": [], "chainId": "0x93e", "v": "0x0", "r": "0x9fdc95549372694cf157b5c53ffb9698a59f5738f384f1166ee16467a654cd22", "s": "0x5de976d4d2beebff2419459f1fe4c0a034268ec98dbd7181a4f584a86a9e29d1", "yParity": "0x0" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", "blockNumber": "0xa2aca", "from": "0x4e9267cdecf7668ad5bb963f51399d0daacaf948", "gas": "0x1a4d4", "gasPrice": "0xf8db9b8d", "hash": "0xb5136d9f0626c0c4667d251c56d0e28b82169f655e73bc929664b21cea8b2b14", "input": "0xa9059cbb0000000000000000000000004e9267cdecf7668ad5bb963f51399d0daacaf9480000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x8", "to": "0x05f4539e5e34252f91bc479de77ae4c0bd030e66", "transactionIndex": "0x1", "value": "0x0", "type": "0x0", "chainId": "0x93e", "v": "0x518e3", "r": "0x7218b8f27cef7788804ebaee1e7a8d05848fc4ee7285a019e48db9972ae649f6", "s": "0x79345ab4b155a801be7c684b3135674586b2dd652d24b87fd0821ca834c07feb" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x0c891cace708b8e91fa9d1396b4b4134d395b208b90fc1b3f35c0c1bb40f485d", "blockNumber": "0xa2b2b", "from": "0x45406041debc7813f034cdbf081ff33e1f666900", "gas": "0x18af6", "gasPrice": "0x1ff4c9bda", "hash": "0xe6b0030513815872a1486cedc2f7dfc6a27a263244f3c16b4cf099f92e80f21f", "input": "0xa9059cbb00000000000000000000000045406041debc7813f034cdbf081ff33e1f6669000000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x4", "to": "0x0b8d50601a934ab26e7b8865e40d87cb3d49f9ad", "transactionIndex": "0x1", "value": "0x0", "type": "0x0", "chainId": "0x93e", "v": "0x518e4", "r": "0x16fd9a5b68973e5f7fc6187d877c9316557c05c6e4a4dc58e544e38ada270082", "s": "0x631201afd8d37c44983630750917d7ae0d8fc7510cb0a7561573892c07f71fa4" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kite/web3-p3/ title: Kite AI — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/kite/web3-p3.mdx --- # Kite AI — web3, net, eth (3/3) > API reference for [Kite AI](/rpc-service/chains/chains-api/kite/). [All methods ->](/rpc-service/chains/chains-api/kite/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/kite/web3/) · [2](/rpc-service/chains/chains-api/kite/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xf67b4d2caab1c16b6f292f7b220c09df038b7f38edcbe9e0915159817845ff9a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", "blockNumber": "0xa2aca", "contractAddress": null, "cumulativeGasUsed": "0x1dd14b", "effectiveGasPrice": "0x59682f01", "from": "0xf1a66ee4db3bfec6a4233bd10e587dacdae985a6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x904d60501d8b8e904673b3e0bcc7e6ae6e57a195", "transactionHash": "0xf67b4d2caab1c16b6f292f7b220c09df038b7f38edcbe9e0915159817845ff9a", "transactionIndex": "0x2c", "type": "0x2" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kite/web3/ title: Kite AI — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/kite/web3.mdx --- # Kite AI — web3, net, eth (1/3) > API reference for [Kite AI](/rpc-service/chains/chains-api/kite/). [All methods ->](/rpc-service/chains/chains-api/kite/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/kite/web3-p2/) · [3](/rpc-service/chains/chains-api/kite/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v1.13.8-stable/linux-amd64/go1.21.6", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "2366" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xa2acc" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xe3320b81758ef" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195", "safe"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xc5a82afa5fda0fad21f573220ae47384da3aa122735b75e92cdd1fda6210400e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x50" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x9B407"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x50" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xc5a82afa5fda0fad21f573220ae47384da3aa122735b75e92cdd1fda6210400e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0xA2ACA"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/kite/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kusama/ title: Kusama description: Kusama is an early release of Polkadot: a scalable, multichain network for radical innovation. Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/kusama/index.mdx --- # Kusama
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Kusama API is available on [Web3 API platform](https://www.ankr.com/rpc/kusama). *Kusama* is an early release of Polkadot: a scalable, multichain network for radical innovation. Kusama serves as a proving ground that allows teams and developers to build and deploy a parachain, and experiment with Polkadot’s governance and NPoS functionality in a real environment. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods ### Methods supported - [`chain_getBlock`](/rpc-service/chains/chains-api/kusama/methods-supported/#chain_getblock) - [`chain_getBlockHash`](/rpc-service/chains/chains-api/kusama/methods-supported/#chain_getblockhash) - [`chain_getHeader`](/rpc-service/chains/chains-api/kusama/methods-supported/#chain_getheader) - [`chain_getFinalizedHead`](/rpc-service/chains/chains-api/kusama/methods-supported/#chain_getfinalizedhead) - [`state_getStorage`](/rpc-service/chains/chains-api/kusama/methods-supported/#state_getstorage) - [`state_getStorageHash`](/rpc-service/chains/chains-api/kusama/methods-supported/#state_getstoragehash) - [`state_getStorageSize`](/rpc-service/chains/chains-api/kusama/methods-supported/#state_getstoragesize) - [`grandpa_proveFinality`](/rpc-service/chains/chains-api/kusama/methods-supported/#grandpa_provefinality) - [`grandpa_roundState`](/rpc-service/chains/chains-api/kusama/methods-supported/#grandpa_roundstate) - [`system_chain`](/rpc-service/chains/chains-api/kusama/methods-supported/#system_chain) - [`system_chainType`](/rpc-service/chains/chains-api/kusama/methods-supported/#system_chaintype) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/kusama/methods-supported/ title: Kusama — Methods supported source: docs/rpc-service/chains/chains-api/kusama/methods-supported.mdx --- # Kusama — Methods supported > API reference for [Kusama](/rpc-service/chains/chains-api/kusama/). [All methods ->](/rpc-service/chains/chains-api/kusama/#methods) ## Methods supported * [`chain_getBlock`](#chain_getblock) — retrieves the header and body of a relay chain block. * [`chain_getBlockHash`](#chain_getblockhash) — retrieves the block hash for a specific block. * [`chain_getHeader`](#chain_getheader) — retrieves the header for a specific block. * [`chain_getFinalizedHead`](#chain_getfinalizedhead) — retrieves the hash of the last finalized block in the canon chain. * [`state_getStorage`](#state_getstorage) — retrieves the storage for a key. * [`state_getStorageHash`](#state_getstoragehash) — retrieves the storage hash. * [`state_getStorageSize`](#state_getstoragesize) — retrieves the storage size. * [`grandpa_proveFinality`](#grandpa_provefinality) — proves finality for the given block number, returning the Justification for the last block in the set. * [`grandpa_roundState`](#grandpa_roundstate) — returns the state of the current best round state as well as the ongoing background rounds. * [`system_chain`](#system_chain) — retrieves the chain. * [`system_chainType`](#system_chaintype) — retrieves the chain type. --- ### `chain_getBlock` > Retrieves the header and body of a relay chain block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data; 32 byte; optional): a hash of the block to retrieve; if omitted, retrieves the latest finalized block. #### Returns * `SignedBlock`: the header and body data of a relay chain block. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlock", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block": { "header": { "parentHash": "0x805af41d6b9e4a559a188c1824ca8bbfd454761d40791013ca9acbb7022f41b1", "number": "0x1136a68", "stateRoot": "0x512ca942fdd6ac82d445fddc9e6b3c23548bbbcff431dd9136fd73c3377fd1f1", "extrinsicsRoot": "0xd45d7104386fd2bc68ec0b9455c5395b53dd8d72fb73376f13e433e282bfda34", "digest": { "logs": [ "0x0642414245b50103a4030000cef6bc1000000000620f5a0e38b9f5c4695c9271c17aa6d75adbbd4ed06f5d08a0f17280524242133e3eb41876d2ff9609ee2cfa422ac8a4772179ad7310d950c8edb97f0e7543006eb79fd3fbd865c24f8601f8ee50409984c915b59480e01b9382d2abccd55f06", "0x05424142450101e45511be6785f935a0c729a15cab7503b06aeed6b881d9cdf75978e7d393060a356278eff9ac4918c1fba3127c4dfa88206ccd8a737b8796e99171728e0b448c" ] } }, "extrinsics": [ "0x280402000b217cd84c8801" ] }, "justifications": null }, "id": 1 } ``` --- ### `chain_getBlockHash` > Retrieves the block hash for a specific block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): `` (string; hex; optional): the number of a block to retrieve the hash for; if omitted, retrieves the latest finalized block. #### Returns * ``: the block hash of the block specified. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlockHash", "params": ["0xb48f90"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0xb5c3146ceb55f547304c7ad6879d0c017016b6f526c86cd3579314116365072c", "id": 1 } ``` --- ### `chain_getHeader` > Retrieves the header for a specific block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data; 32 byte; optional): a hash of the block to retrieve the header for; if omitted, shows the result for the latest finalized block. #### Returns * `
`: the header of the block specified. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getHeader", "params": ["0x56547256415c6ca5d7e43e32f0664ede1aa78aae59e07cdc64f2037beba31e9e"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "parentHash": "0x88ac4b5bc7ea4e0cb1b8d8e1d2dce838e37d1a4480c4bde37bdfdcc9c8fffb64", "number": "0xb48f75", "stateRoot": "0xa2baf709447aa9055b4ca5046fc76a0ca05ace90758fcf3bc3bc004612173bfa", "extrinsicsRoot": "0xe94f82eae3aba9331e0370f1c3b7d72da3bd9a82dd36711448d6197b6659e308", "digest": { "logs": [ "0x0642414245b50103c0000000076382100000000084c21f756e3473b8717c13d27c85a94466cbd0f64fe8bbd37cbf23dd46c70e5a49626481005b811dfcff67dda4b12ee502cb3589c6b2ff6450c6537f18298c08fd2942aaa2f0ee1591522fe4dc0482949c920a046201cf39f7ba766af4907509", "0x05424142450101340de0372f172ba4d9c12d767ddd42e2f1844691c93f74773e7839ccba29b96f400a6b8bbea109e807033696c182f08c8c02918c3521968612cd20ed82af0b89" ] } }, "id": 1 } ``` --- ### `chain_getFinalizedHead` > Retrieves the hash of the last finalized block in the canon chain. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: the hash of the last finalized block in the canon chain. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getFinalizedHead", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0x6b19ea53df54f69c7b931fa0708e5cc2b5d1397488ecf26364f11c6fe14cb663", "id": 1 } ``` --- ### `state_getStorage` > Retrieves the storage for a key. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex ; required): the key to retrieve the storage for. * `` (data; 32 byte; optional): a hash of the block. #### Returns * ``: the storage data. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorage", "params": ["0xf0c365c3cf59d671eb72da0e7a4113c49f1f0515f462cdcf84e0f1d6045dfcbb"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0xb052db4c88010000", "id": 1 } ``` --- ### `state_getStorageHash` > Retrieves the storage hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): a storage key. * `` (data; 32 byte; optional): a hash of the block. #### Returns * ``: the storage hash. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageHash", "params": ["0xf0c365c3cf59d671eb72da0e7a4113c49f1f0515f462cdcf84e0f1d6045dfcbb"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0xa1d4f18e6e91789e6a9a73f2635b3ef87a61f951c6c85aa27b3c893edd3ae44f", "id": 1 } ``` --- ### `state_getStorageSize` > Retrieves the storage size. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the storage key. * `` (data; 32 byte; optional): a hash of the block. #### Returns * ``: the storage size. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageSize", "params": ["0xf0c365c3cf59d671eb72da0e7a4113c49f1f0515f462cdcf84e0f1d6045dfcbb"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": 8, "id": 1 } ``` --- ### `grandpa_proveFinality` > Proves finality for the given block number, returning the Justification for the last block in the set. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (integer; required): the number of a block to prove finality for. #### Returns * `Option`: the Justification for the last block in the set. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "grandpa_proveFinality", "params": [11833440] }' ``` --- ### `grandpa_roundState` > Returns the state of the current best round state as well as the ongoing background rounds. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: the states of reported rounds. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "grandpa_roundState", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "setId": 6983, "best": { "round": 1667, "totalWeight": 1000, "thresholdWeight": 667, "prevotes": { "currentWeight": 869, "missing": [ "Caf9kG6ieAounXaTYQatykAsHXkU5cGzAtb91huUBZGLS4c", "CbagHSxtekR2Lo4nk9C5jvSSK1cXcTbuu34xDMU4hxxKCak" ] }, "precommits": { "currentWeight": 0, "missing": [ "CaYgCrbi6k8cZCFr6WG16cv6epGECLofz1HvfLtHD2Dj7SU", "Caf9kG6ieAounXaTYQatykAsHXkU5cGzAtb91huUBZGLS4c" ] } }, "background": [] }, "id": 1 } ``` --- ### `system_chain` > Retrieves the chain. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: a chain name. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_chain", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "Kusama", "id": 1 } ``` --- ### `system_chainType` > Retrieves the chain type. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: a chain type. #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_chainType", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "Live", "id": 1 } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/linea/ title: Linea description: Linea is a network that scales the experience of Ethereum. 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/linea/index.mdx --- # Linea
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Linea API is available on [Web3 API platform](https://www.ankr.com/rpc/linea). *Linea* is a network that scales the experience of Ethereum. Its out-of-the-box compatibility with the Ethereum Virtual Machine enables the deployment of already-existing applications, as well as the creation of new ones that would be too costly on Mainnet. It also enables the community to use those dapps, at a fraction of the cost, and at multiples the speed of Mainnet. It does this by leveraging quantum-resistant lattice-based cryptography to create zero-knowledge proofs that include every transaction performed on the network, and rolling them up to Mainnet. This ensures that every transaction is recorded to the Ethereum ledger while dividing the cost of that security by magnitudes. In order for your Web3 application to interact with Linea — either by reading blockchain data or sending transactions to the network — it must connect to a Linea node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/linea/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/linea/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/linea/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/linea/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/linea/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/linea/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/linea/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/linea/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/linea/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/linea/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/linea/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/linea/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/linea/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/linea/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/linea/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/linea/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/linea/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/linea/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/linea/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/linea/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/linea/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/linea/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/linea/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/linea/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/linea/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/linea/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/linea/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/linea/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/linea/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/linea/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/linea/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/linea/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/linea/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/linea/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/linea/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/linea/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/linea/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/linea/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/linea/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/linea/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/linea/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/linea/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/linea/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/linea/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/linea/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/linea/web3-p2/ title: Linea — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/linea/web3-p2.mdx --- # Linea — web3, net, eth (2/3) > API reference for [Linea](/rpc-service/chains/chains-api/linea/). [All methods ->](/rpc-service/chains/chains-api/linea/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/linea/web3/) · 2 · [3](/rpc-service/chains/chains-api/linea/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53b8" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xe0907320b42accf74f4e5d78438c90f04bebf2c0d82d032d82a94f8ba462c86c", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0xD2AE0", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "author": "0xcace5b3c29211740e595850e80478416ee77ca21", "difficulty": "0xfffffffffffffffffffffffffffffffe", "extraData": "0xde830201018f5061726974792d457468657265756d86312e32392e30826c69", "gasLimit": "0x989680", "gasUsed": "0x0", "hash": "0xdd9b627e6f18f92744a6f891f760ee776352fd1100e5929abedd32c181222e0f", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xcace5b3c29211740e595850e80478416ee77ca21", "number": "0x1b4", "parentHash": "0x32d9d5a23b1fcb6ff5357698b73c0f079ddce7cf50785e749df794e30b675472", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "signature": "0x3bb57dd408202a5577c3a6622d713e9b3e305187dc3346c145f0d5770fe96a7c5f023f77942d2c5f608cd9c3ee6e3033394b7681ad017eaa42da476b85402fca01", "size": "0x24b", "stateRoot": "0x79c51798a041161d441b1f857aa7dcff4713ad1b4ab939ae83e410e461bb7666", "step": 307805272, "totalDifficulty": "0x1b3ffffffffffffffffffffffffeda941f4", "timestamp": "0x5bbbadb8", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] }, "id": 1 } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbf5d41d7f70e371bb075b199f89c3d143d5ecf3060a7ceb99331bdf35aea308c"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xc5043f", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x00005a74000000fec7bf1f56c60d8fc0903da29d13b8e151c768c8630b999b4c", "blockNumber": "0xc5043f", "from": "0xc473ba887c10ec39533fa734d95be5712c556bb1", "gas": "0x445c0", "gasPrice": "0x2e90edd000", "hash": "0x37c19dd4771fd81cd2d0f3379e47dc4c11ff31f74b771ef631b162db0e0b5167", "input": "0xb3d16931000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000003e63e6ae34fcb270f19fdbe83d506e803fdc402ef650000000000000000000003e5971d049b7bde4ca9192a461708ebb54c8ebc08430000000b53affd05137f800021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000000000000000000000000000000000000000000400000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c8300000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d000000000000000000000000bfaf328fe059c53d936876141f38089df0d1503d", "nonce": "0xcd", "to": "0xc6e3567cc9cef8cc243343186cb64b4fc9d7cd0c", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "v": "0x218", "r": "0x6bfc4a999f4f3aeea39a872d3b1a44b5f9dae0ffb27c4bb1e1bbb77a473742ff", "s": "0x5ea8bc05b9de3617dd7242ef263defaea92fa239e0f8695d51e5ae335c21de31" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/linea/web3-p3/ title: Linea — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/linea/web3-p3.mdx --- # Linea — web3, net, eth (3/3) > API reference for [Linea](/rpc-service/chains/chains-api/linea/). [All methods ->](/rpc-service/chains/chains-api/linea/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/linea/web3/) · [2](/rpc-service/chains/chains-api/linea/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3c9329b765d88c03d18f87dc1f2b5138c89d9a415d5c73dc7827b87aca176c8e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/linea/web3/ title: Linea — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/linea/web3.mdx --- # Linea — web3, net, eth (1/3) > API reference for [Linea](/rpc-service/chains/chains-api/linea/). [All methods ->](/rpc-service/chains/chains-api/linea/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/linea/web3-p2/) · [3](/rpc-service/chains/chains-api/linea/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v1.13.3-stable-0d45d72d/linux-amd64/go1.21.3", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "59144" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xd023b107" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xd107f" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x8B926f2AA1E2F6a212C0566e32Ae4FD288752450", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x28eabd2c993994" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x8B926f2AA1E2F6a212C0566e32Ae4FD288752450", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xaeb" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd73fad747d2f103fe14fbe15a6ff282f1df706d9d413c8242f0e9c5359398ae9"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x80" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xd73fad747d2f103fe14fbe15a6ff282f1df706d9d413c8242f0e9c5359398ae9"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xaDDD2A0a68942a979127885389f1cb673D6F1169", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/linea/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/linea/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/mantle/eth-p2/ title: Mantle — eth, debug (2/2) source: docs/rpc-service/chains/chains-api/mantle/eth-p2.mdx --- # Mantle — eth, debug (2/2) > API reference for [Mantle](/rpc-service/chains/chains-api/mantle/). [All methods ->](/rpc-service/chains/chains-api/mantle/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/mantle/eth/) · 2 ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Mantle blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0xA7EDEA", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "result": { "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xee8c8", "gasUsed": "0xb729", "to": "0x4200000000000000000000000000000000000015", "input": "0x015d8eb900000000000000000000000000000000000000000000000000000000006311020000000000000000000000000000000000000000000000000000000066bb5e7c0000000000000000000000000000000000000000000000000000001142f7c8b66956e199fb5376f2122739e8df530714d673aca8668753e293f1d435e83a34e500000000000000000000000000000000000000000000000000000000000000040000000000000000000000005fb5139834df283b6a4bd7267952f3ea21a573f400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000002710", "calls": [ { "from": "0x4200000000000000000000000000000000000015", "gas": "0xe9a0d", "gasUsed": "0x4a28", "to": "0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d30015", "input": "0x015d8eb900000000000000000000000000000000000000000000000000000000006311020000000000000000000000000000000000000000000000000000000066bb5e7c0000000000000000000000000000000000000000000000000000001142f7c8b66956e199fb5376f2122739e8df530714d673aca8668753e293f1d435e83a34e500000000000000000000000000000000000000000000000000000000000000040000000000000000000000005fb5139834df283b6a4bd7267952f3ea21a573f400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000002710", "value": "0x0", "type": "DELEGATECALL" } ], "value": "0x0", "type": "CALL" } } ] } ``` --- ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Mantle blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/mantle/eth/ title: Mantle — eth, debug (1/2) source: docs/rpc-service/chains/chains-api/mantle/eth.mdx --- # Mantle — eth, debug (1/2) > API reference for [Mantle](/rpc-service/chains/chains-api/mantle/). [All methods ->](/rpc-service/chains/chains-api/mantle/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/mantle/eth-p2/) ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x87444df6b0ab2925e78871838dac5cb6d7d99a78895370a07c1888004400d794"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x2ab0f417c21b777a7023ffbac9a0996d670e00b2315b7b95f6791e78265cbb46", "blockNumber": "0x3f6b8e", "contractAddress": null, "cumulativeGasUsed": "0x2b5cc", "from": "0x1c528053ed6b6144c6ad1cfa1a8133e07907105a", "gasUsed": "0x2b5cc", "l1Fee": "0xfbf57dd9a9c6380", "l1FeeScalar": "1.5", "l1GasPrice": "0x6698d92dccc1", "l1GasUsed": "0x1a32", "logs": [ { "address": "0x8734110e5e1dcf439c7f549db740e546fea82d66", "topics": [ "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", "0x00000000000000000000000045e6f621c5ed8616ccfb9bbaebacf9638abb0033" ], "data": "0x000000000000000000000000000000000000000000000001158e460913d00000", "blockNumber": "0x3f6b8e", "transactionHash": "0x87444df6b0ab2925e78871838dac5cb6d7d99a78895370a07c1888004400d794", "transactionIndex": "0x0", "blockHash": "0x2ab0f417c21b777a7023ffbac9a0996d670e00b2315b7b95f6791e78265cbb46", "logIndex": "0x0", "removed": false }, { "address": "0x8734110e5e1dcf439c7f549db740e546fea82d66", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000045e6f621c5ed8616ccfb9bbaebacf9638abb0033", "0x000000000000000000000000456870b7d2d00dce4e1bfeaddc78adaae50d6b81" ], "data": "0x000000000000000000000000000000000000000000000001158e460913d00000", "blockNumber": "0x3f6b8e", "transactionHash": "0x87444df6b0ab2925e78871838dac5cb6d7d99a78895370a07c1888004400d794", "transactionIndex": "0x0", "blockHash": "0x2ab0f417c21b777a7023ffbac9a0996d670e00b2315b7b95f6791e78265cbb46", "logIndex": "0x1", "removed": false } ], "logsBloom": "0x00202000000000400000000080010000000000000001001000000000000000040000000002000000000000000200000000010010000000000000000000000800080008000000000020000008000000200000000000000000000001008000000000000000000000608000000000100000000000000000000000000014000000000000000000400000000000000000000000000001000000080000084000000000000000000000000000000000000000000000000010000000000000000000000000000002000000000000000002004000000000000000085000000000000000000000000000000000000000000000000000000000000000400000000000000000", "status": "0x1", "to": "0x45e6f621c5ed8616ccfb9bbaebacf9638abb0033", "transactionHash": "0x87444df6b0ab2925e78871838dac5cb6d7d99a78895370a07c1888004400d794", "transactionIndex": "0x0" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc46f0df64327fd11e73422e7097109b84e66d8d4059748fba5e9f1b70b4d9083", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x3F6B2B", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xE63C2011C8b2D2fc9B765eAD8C674B5e6C090c24"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Mantle blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0x2777c517d544ded003da73ccb383c841ea016c795aa2f2a10316a02050c91e5e", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "result": { "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xee8c8", "gasUsed": "0xb729", "to": "0x4200000000000000000000000000000000000015", "input": "0x015d8eb900000000000000000000000000000000000000000000000000000000006311020000000000000000000000000000000000000000000000000000000066bb5e7c0000000000000000000000000000000000000000000000000000001142f7c8b66956e199fb5376f2122739e8df530714d673aca8668753e293f1d435e83a34e500000000000000000000000000000000000000000000000000000000000000040000000000000000000000005fb5139834df283b6a4bd7267952f3ea21a573f400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000002710", "calls": [ { "from": "0x4200000000000000000000000000000000000015", "gas": "0xe9a0d", "gasUsed": "0x4a28", "to": "0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d30015", "input": "0x015d8eb900000000000000000000000000000000000000000000000000000000006311020000000000000000000000000000000000000000000000000000000066bb5e7c0000000000000000000000000000000000000000000000000000001142f7c8b66956e199fb5376f2122739e8df530714d673aca8668753e293f1d435e83a34e500000000000000000000000000000000000000000000000000000000000000040000000000000000000000005fb5139834df283b6a4bd7267952f3ea21a573f400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000002710", "value": "0x0", "type": "DELEGATECALL" } ], "value": "0x0", "type": "CALL" } } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/mantle/ title: Mantle description: Mantle is a high-performance Ethereum layer-2 network built with modular architecture delivering low fees and… 32 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/mantle/index.mdx --- # Mantle
> Mantle API is available on [Web3 API platform](https://www.ankr.com/rpc/mantle). *Mantle* is a high-performance Ethereum layer-2 network built with modular architecture delivering low fees and high security. Builders can leverage Mantle’s unique design to build dApps with exceptional UX, all while relying on Ethereum’s unrivaled security. In order for your Web3 application to interact with Mantle — either by reading blockchain data or sending transactions to the network — it must connect to a Mantle node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/mantle/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/mantle/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/mantle/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/mantle/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/mantle/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_protocolVersion`](/rpc-service/chains/chains-api/mantle/web3/#eth_protocolversion) — returns the current protocol version. * [`eth_gasPrice`](/rpc-service/chains/chains-api/mantle/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/mantle/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/mantle/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/mantle/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/mantle/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/mantle/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/mantle/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/mantle/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/mantle/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/mantle/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/mantle/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/mantle/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/mantle/web3-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/mantle/eth/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/mantle/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/mantle/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/mantle/eth/#eth_getlogs) — returns logs matching the parameters specified. **Premium-only methods (Mantle Sepolia Testnet)**: * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/mantle/eth/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/mantle/eth-p2/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/mantle/eth-p2/#debug_traceblock) — traces the execution of all transactions within a block. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/mantle/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/mantle/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/mantle/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/mantle/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/mantle/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/mantle/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/mantle/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/mantle/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/mantle/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/mantle/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/mantle/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/mantle/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/mantle/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/mantle/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/mantle/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/mantle/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/mantle/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/mantle/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/mantle/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/mantle/web3-p3/#eth_gettransactionbyblocknumberandindex) ### eth, debug - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/mantle/eth/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/mantle/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/mantle/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/mantle/eth/#eth_getlogs) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/mantle/eth/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/mantle/eth-p2/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/mantle/eth-p2/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/mantle/web3-p2/ title: Mantle — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/mantle/web3-p2.mdx --- # Mantle — web3, net, eth (2/3) > API reference for [Mantle](/rpc-service/chains/chains-api/mantle/). [All methods ->](/rpc-service/chains/chains-api/mantle/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/mantle/web3/) · 2 · [3](/rpc-service/chains/chains-api/mantle/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0x6b175474e89094c44da98b954eedeac495271d0f"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x1fdc046a9ba0d10230308f84071d462105f807da9d1882b2e41ab8465f86bff5", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x3F6777", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x2", "extraData": "0xd98301090a846765746889676f312e31352e3133856c696e7578000000000000325d470c79b0f294a58df6d65a298b9a8d2afbeb512e3dc9a342ed5f6e883def3c4a0e1baa22fe86edfc96013ce42dd43e9588153e0eb2e05dc16f8da15ffe6400", "gasLimit": "0xe4e1c0", "gasUsed": "0x5208", "hash": "0x9b14d73f45c836bfb0e1f59453c39fe8cddab45a0f78670dc6190e5c85b65a8e", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x3f6777", "parentHash": "0xd9505c7d82fbbad090d3ab4b4ecd20bca0f3700ce0c0c5ad2563a4100f86a004", "receiptsRoot": "0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x2d1", "stateRoot": "0x6ac1007f49aecaa29deff133703b287eb166ed12826bb685520f4b7a1aace96a", "timestamp": "0x643fc8a5", "totalDifficulty": "0x7eceef", "transactions": [ "0x6dfef681e0a83a40b05d40877e53a88459e8829240a6d6d5ec6fe816e435f8d8" ], "transactionsRoot": "0x276188119355097e219513a6cbddee24b1b82f20e7bcd6d2019a100e7daa67a3", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x37fe494ba16ffb9339d4c51339ba0677b968f7ec638beafeff61b6127251f527"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x6017f3e9930cb3937e1ea165091d7becbc04e884fd95b1344ce66075663f89b4", "blockNumber": "0x3f68fc", "from": "0x52988d3dd2d1b36e9c48866670b7683c42197139", "gas": "0x5208", "gasPrice": "0x1", "hash": "0x37fe494ba16ffb9339d4c51339ba0677b968f7ec638beafeff61b6127251f527", "input": "0x", "nonce": "0x2da7", "to": "0x79034f498a4cf7329e3253a7a40108a349a4f824", "transactionIndex": "0x0", "value": "0x0", "v": "0x2736", "r": "0xdde908db0d61404b0b8144d3d7195ecbe4bee7d0c10a0b811903102875e4d05", "s": "0x2c584d3987147789608364c8f1eafe7bf46bb27ae65fcbe4deab6cb8a1d6db48", "queueOrigin": "sequencer", "l1TxOrigin": null, "l1BlockNumber": "0x871eb8", "l1Timestamp": "0x643fca95", "index": "0x3f68fb", "queueIndex": null, "rawTransaction": "0xf863822da7018252089479034f498a4cf7329e3253a7a40108a349a4f8248080822736a00dde908db0d61404b0b8144d3d7195ecbe4bee7d0c10a0b811903102875e4d05a02c584d3987147789608364c8f1eafe7bf46bb27ae65fcbe4deab6cb8a1d6db48" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xd923b810ded6a1e1f7cbad9e9aa56b1bb4bc00510029edb814087c28b16a141e", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/mantle/web3-p3/ title: Mantle — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/mantle/web3-p3.mdx --- # Mantle — web3, net, eth (3/3) > API reference for [Mantle](/rpc-service/chains/chains-api/mantle/). [All methods ->](/rpc-service/chains/chains-api/mantle/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/mantle/web3/) · [2](/rpc-service/chains/chains-api/mantle/web3-p2/) · 3 ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x3F6B8E", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x2ab0f417c21b777a7023ffbac9a0996d670e00b2315b7b95f6791e78265cbb46", "blockNumber": "0x3f6b8e", "from": "0x1c528053ed6b6144c6ad1cfa1a8133e07907105a", "gas": "0x37471", "gasPrice": "0x1", "hash": "0x87444df6b0ab2925e78871838dac5cb6d7d99a78895370a07c1888004400d794", "input": "0x7ff36ab500000000000000000000000000000000000000000000000002e33d61635e09b000000000000000000000000000000000000000000000000000000000000000800000000000000000000000001c528053ed6b6144c6ad1cfa1a8133e07907105a00000000000000000000000000000000000000000000000000000000643fd1e100000000000000000000000000000000000000000000000000000000000000030000000000000000000000008734110e5e1dcf439c7f549db740e546fea82d66000000000000000000000000a9b72ccc9968afec98a96239b5aa48d828e8d8270000000000000000000000006dfb16bc471982f19db32dee9b6fb40db4503cbf", "nonce": "0xe", "to": "0x45e6f621c5ed8616ccfb9bbaebacf9638abb0033", "transactionIndex": "0x0", "value": "0x1158e460913d00000", "v": "0x2736", "r": "0x4c45a74f48e991d58e52d20dee5b6913fa787d92f7883be9cda06a76f4b93444", "s": "0x9d723569080e7b6e69914d6d9bb557227337aa68ae45e0dc9d9b9aadd811df3", "queueOrigin": "sequencer", "l1TxOrigin": null, "l1BlockNumber": "0x871ee0", "l1Timestamp": "0x643fcd3c", "index": "0x3f6b8d", "queueIndex": null, "rawTransaction": "0xf901710e01830374719445e6f621c5ed8616ccfb9bbaebacf9638abb00338901158e460913d00000b901047ff36ab500000000000000000000000000000000000000000000000002e33d61635e09b000000000000000000000000000000000000000000000000000000000000000800000000000000000000000001c528053ed6b6144c6ad1cfa1a8133e07907105a00000000000000000000000000000000000000000000000000000000643fd1e100000000000000000000000000000000000000000000000000000000000000030000000000000000000000008734110e5e1dcf439c7f549db740e546fea82d66000000000000000000000000a9b72ccc9968afec98a96239b5aa48d828e8d8270000000000000000000000006dfb16bc471982f19db32dee9b6fb40db4503cbf822736a04c45a74f48e991d58e52d20dee5b6913fa787d92f7883be9cda06a76f4b93444a009d723569080e7b6e69914d6d9bb557227337aa68ae45e0dc9d9b9aadd811df3" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/mantle/web3/ title: Mantle — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/mantle/web3.mdx --- # Mantle — web3, net, eth (1/3) > API reference for [Mantle](/rpc-service/chains/chains-api/mantle/). [All methods ->](/rpc-service/chains/chains-api/mantle/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/mantle/web3-p2/) · [3](/rpc-service/chains/chains-api/mantle/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Geth/v1.9.10-stable/linux-amd64/go1.19" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "5001" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x40", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3f67f8" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xD85498dbEaEB1Df24BE52eED4F52eAc2Fbd56245", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x28db93b28e95a9cbd9" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x79034F498a4cf7329E3253a7a40108A349a4f824", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x52988D3DD2D1b36E9c48866670b7683C42197139", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2d9a" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x42fa99c99145b8cf63774993e5c00ec5c0a4782dd2c6f19cab9913d05b253e13"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x3F68AA"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x42fa99c99145b8cf63774993e5c00ec5c0a4782dd2c6f19cab9913d05b253e13"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x3F6777"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x79034F498a4cf7329E3253a7a40108A349a4f824", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/mantle/eth/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/matchain/ title: Matchain description: Matchain is a decentralized AI blockchain platform dedicated to providing comprehensive digital identity… 27 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/matchain/index.mdx --- # Matchain
> Matchain API is available on [Web3 API platform](https://www.ankr.com/rpc/matchain). *Matchain* is a decentralized AI blockchain platform dedicated to providing comprehensive digital identity solutions for all users. By integrating advanced artificial intelligence, Matchain enhances data categorization and user profiling, seamlessly merging social logins from both Web2 and Web3 into a unified digital identity. This empowers individuals with full control over their data, enabling them to own, manage, and monetize it according to their preferences. In order for your Web3 application to interact with Matchain — either by reading blockchain data or sending transactions to the network — it must connect to a Matchain node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/matchain/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/matchain/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/matchain/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/matchain/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/matchain/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/matchain/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/matchain/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/matchain/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/matchain/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/matchain/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/matchain/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/matchain/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/matchain/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/matchain/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/matchain/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/matchain/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/matchain/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/matchain/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/matchain/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/matchain/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/matchain/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/matchain/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/matchain/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/matchain/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/matchain/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/matchain/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/matchain/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/matchain/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/matchain/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/matchain/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/matchain/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/matchain/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/matchain/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/matchain/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/matchain/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/matchain/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/matchain/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/matchain/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/matchain/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/matchain/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/matchain/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/matchain/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/matchain/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/matchain/web3-p2/ title: Matchain — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/matchain/web3-p2.mdx --- # Matchain — web3, net, eth (2/3) > API reference for [Matchain](/rpc-service/chains/chains-api/matchain/). [All methods ->](/rpc-service/chains/chains-api/matchain/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/matchain/web3/) · 2 · [3](/rpc-service/chains/chains-api/matchain/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0xec0702Fffcfad2f72be20438f1e4758149754DB3", "to": "0x8e587A30F5c1440058b10493332006024ccAC36F", "data": "0xa9059cbb000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf90000000000000000000000000000000000000000000000000000000000000064" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x54ea" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x45a071efdbf0509bc2449d41affa4df744885e747b4046f40bd251413cf8a135", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x8", "blobGasUsed": "0x0", "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0x", "gasLimit": "0x5f5e100", "gasUsed": "0x18f3a7", "hash": "0x45a071efdbf0509bc2449d41affa4df744885e747b4046f40bd251413cf8a135", "logsBloom": "0x200000800800000005802004800002000000c00000000000000000000008000010000100020000000000000004005200000000000002000000212000000300000400098000800000000000088001004000202000000010008020001004000000400140102000000000a1000010000000100000100004010000000012000800400281004100440000010000800000004000400000000110000000010000000000000000100100000000000000020400000081000040000000000000000000408000000002000100001000040011000200800008000000001001000200000000009004040000000000000408010000000008001001400000000020002600000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0xed3314", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "parentHash": "0x9810e0190b42cc6dbdc421202ab161de9a5c94aa3a3f7e8f05178d15640ed83e", "receiptsRoot": "0xd6cee83ce4511350a014b06626cad8c844bdf961e9eb9673dc42c625d3470599", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1dc8", "stateRoot": "0xf70fba40afa0ddfe651c3816e96aaf4c9b12791067cf32abdf5b9b652ed9f08c", "timestamp": "0x67864988", "totalDifficulty": "0x0", "transactions": [ "0x341285a2b6d24aa5c78db324d4d8fbc6f9534994a89e456dbde148dbf1d9cfda", "0x6ed4b5070af741cea919ef2cb1a287de21dfd9acbca3cc39fb4b90142e6ee2fa" ], "transactionsRoot": "0x22bd47d322a07e99b776ae9fca05bf5c6f5f66e44da28b746202f5ebd5ada6d3", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0xED3314", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x8", "blobGasUsed": "0x0", "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0x", "gasLimit": "0x5f5e100", "gasUsed": "0x18f3a7", "hash": "0x45a071efdbf0509bc2449d41affa4df744885e747b4046f40bd251413cf8a135", "logsBloom": "0x200000800800000005802004800002000000c00000000000000000000008000010000100020000000000000004005200000000000002000000212000000300000400098000800000000000088001004000202000000010008020001004000000400140102000000000a1000010000000100000100004010000000012000800400281004100440000010000800000004000400000000110000000010000000000000000100100000000000000020400000081000040000000000000000000408000000002000100001000040011000200800008000000001001000200000000009004040000000000000408010000000008001001400000000020002600000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0xed3314", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "parentHash": "0x9810e0190b42cc6dbdc421202ab161de9a5c94aa3a3f7e8f05178d15640ed83e", "receiptsRoot": "0xd6cee83ce4511350a014b06626cad8c844bdf961e9eb9673dc42c625d3470599", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1dc8", "stateRoot": "0xf70fba40afa0ddfe651c3816e96aaf4c9b12791067cf32abdf5b9b652ed9f08c", "timestamp": "0x67864988", "totalDifficulty": "0x0", "transactions": [ "0x341285a2b6d24aa5c78db324d4d8fbc6f9534994a89e456dbde148dbf1d9cfda", "0x6ed4b5070af741cea919ef2cb1a287de21dfd9acbca3cc39fb4b90142e6ee2fa" ], "transactionsRoot": "0x22bd47d322a07e99b776ae9fca05bf5c6f5f66e44da28b746202f5ebd5ada6d3", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xd0f0801d08fd7c02c149e3dbbf2030aa31bbe7d7d39ae43294723d2f9136392b"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x82aac474bb210dd8c73bba550eebf4abc556b17908e64b948b05381eb85ac569", "blockNumber": "0xed342e", "from": "0xec0702fffcfad2f72be20438f1e4758149754db3", "gas": "0x5208", "gasPrice": "0xf4248", "hash": "0xd0f0801d08fd7c02c149e3dbbf2030aa31bbe7d7d39ae43294723d2f9136392b", "input": "0x", "nonce": "0xce8613", "to": "0x8e587a30f5c1440058b10493332006024ccac36f", "transactionIndex": "0x26", "value": "0xe5922e0400", "type": "0x0", "chainId": "0x2ba", "v": "0x597", "r": "0x7b7495858ed10a689c03b00f645e1985cffceb6320cb23298c323e2928a24b51", "s": "0x6ec1c739de97e6b09436824d78d3f8f976c302be075cb75202b627ed8fd2ea3d" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0x82aac474bb210dd8c73bba550eebf4abc556b17908e64b948b05381eb85ac569", "0x0" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x82aac474bb210dd8c73bba550eebf4abc556b17908e64b948b05381eb85ac569", "blockNumber": "0xed342e", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x38f58362547ec32d934661237643f5f791503ca7d2098632477b43f53031da0f", "input": "0x440a5e20000109a00009fe9800000000000000020000000067864a8b0000000002ba34b700000000000000000000000000000000000000000000000000000000b2d05e0000000000000000000000000000000000000000000000000000000000000000019f8a2a86fbb5e4e99fe694ec8dd69eb14a694b1db4252b40095fbb1a1ac2ad0a000000000000000000000000cc6cea971847fb4f3703461a629cc2888ca1ac2f", "nonce": "0xed342e", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x6475ec72a5f2bc6c731879d69d232e1605c04250a04735c1a8f087b104e248f0", "mint": "0x0", "depositReceiptVersion": "0x1" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xED3314", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x45a071efdbf0509bc2449d41affa4df744885e747b4046f40bd251413cf8a135", "blockNumber": "0xed3314", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x341285a2b6d24aa5c78db324d4d8fbc6f9534994a89e456dbde148dbf1d9cfda", "input": "0x440a5e20000109a00009fe98000000000000000000000000678649710000000002ba345900000000000000000000000000000000000000000000000000000000b2d05e0000000000000000000000000000000000000000000000000000000000000000010317b6671fe5dc7e3f38dbc3cec833bc908b2f0b291c7ee0641a4b86307b1ff0000000000000000000000000cc6cea971847fb4f3703461a629cc2888ca1ac2f", "nonce": "0xed3314", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x7959e061fd64f8cf640d426cb244826a29bcf15568f6b70afa954ca475aefc32", "mint": "0x0", "depositReceiptVersion": "0x1" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/matchain/web3-p3/ title: Matchain — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/matchain/web3-p3.mdx --- # Matchain — web3, net, eth (3/3) > API reference for [Matchain](/rpc-service/chains/chains-api/matchain/). [All methods ->](/rpc-service/chains/chains-api/matchain/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/matchain/web3/) · [2](/rpc-service/chains/chains-api/matchain/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xd0f0801d08fd7c02c149e3dbbf2030aa31bbe7d7d39ae43294723d2f9136392b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x82aac474bb210dd8c73bba550eebf4abc556b17908e64b948b05381eb85ac569", "blockNumber": "0xed342e", "contractAddress": null, "cumulativeGasUsed": "0x1920ce", "effectiveGasPrice": "0xf4248", "from": "0xec0702fffcfad2f72be20438f1e4758149754db3", "gasUsed": "0x5208", "l1Fee": "0x5274a09847", "l1GasPrice": "0xb2d05e00", "l1GasUsed": "0x6c8", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x8e587a30f5c1440058b10493332006024ccac36f", "transactionHash": "0xd0f0801d08fd7c02c149e3dbbf2030aa31bbe7d7d39ae43294723d2f9136392b", "transactionIndex": "0x26", "type": "0x0" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x45a071efdbf0509bc2449d41affa4df744885e747b4046f40bd251413cf8a135", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0xED3314", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0xED342E", "toBlock": "0xED342F" }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xb2174052dd2f3fcab9ba622f2e04fbea13fc0dfc", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000d5b3bc210352d71f9c7fe7d94cb86fc49b42209a", "0x0000000000000000000000000edd7a06320ff7fea4eb39753ec27521b185d070" ], "data": "0x00000000000000000000000000000000000000000000152d02c7e14af6800000", "blockNumber": "0xed342e", "transactionHash": "0xa7fe0ae5bf67fb245863999442a1bca9c92e51dd1845230140d7c7c57f167403", "transactionIndex": "0x2", "blockHash": "0x82aac474bb210dd8c73bba550eebf4abc556b17908e64b948b05381eb85ac569", "logIndex": "0x0", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/matchain/web3/ title: Matchain — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/matchain/web3.mdx --- # Matchain — web3, net, eth (1/3) > API reference for [Matchain](/rpc-service/chains/chains-api/matchain/). [All methods ->](/rpc-service/chains/chains-api/matchain/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/matchain/web3-p2/) · [3](/rpc-service/chains/chains-api/matchain/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "Geth/v1.101315.0-stable-ef178f25/linux-amd64/go1.21.10" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "698" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xf4248" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xed3307" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xB18fE3cD24D31c7515A00E2D0034F21e2f907cDA", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x12394d855ed" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xB18fE3cD24D31c7515A00E2D0034F21e2f907cDA", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xB18fE3cD24D31c7515A00E2D0034F21e2f907cDA", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x45a071efdbf0509bc2449d41affa4df744885e747b4046f40bd251413cf8a135"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x26" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xED3314"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x26" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x45a071efdbf0509bc2449d41affa4df744885e747b4046f40bd251413cf8a135"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x8e587A30F5c1440058b10493332006024ccAC36F", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/matchain/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_tx_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x8e587A30F5c1440058b10493332006024ccAC36F", "data": "0x70a08231000000000000000000000000abcdefabcdefabcdefabcdefabcdef" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/metis/ title: Metis description: Metis is an Ethereum Layer 2 Rollup platform that offers simple and fast smart contract deployment within the… 29 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/metis/index.mdx --- # Metis
> Metis API is available on [Web3 API platform](https://www.ankr.com/rpc/metis). *Metis* is an Ethereum Layer 2 Rollup platform that offers simple and fast smart contract deployment within the network. Metis provides several solutions to solve the big challenges we face in the Ethereum mainnet, including transaction speed, cost, and scalability. In order for your Web3 application to interact with Metis — either by reading blockchain data or sending transactions to the network — it must connect to a Metis node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/metis/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/metis/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/metis/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/metis/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/metis/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/metis/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/metis/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/metis/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/metis/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/metis/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/metis/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/metis/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/metis/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/metis/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/metis/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/metis/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/metis/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/metis/web3-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/metis/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/metis/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/metis/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/metis/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/metis/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/metis/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/metis/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/metis/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/metis/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/metis/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/metis/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/metis/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/metis/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/metis/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/metis/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/metis/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/metis/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/metis/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/metis/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/metis/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/metis/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/metis/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/metis/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/metis/web3-p3/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/metis/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/metis/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/metis/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/metis/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/metis/web3-p2/ title: Metis — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/metis/web3-p2.mdx --- # Metis — web3, net, eth (2/3) > API reference for [Metis](/rpc-service/chains/chains-api/metis/). [All methods ->](/rpc-service/chains/chains-api/metis/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/metis/web3/) · 2 · [3](/rpc-service/chains/chains-api/metis/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":"0x07f327929A3A3131EB4BE83f784DBD3E5C2698f8"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xcf08" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x2", "extraData": "0xd98301090a846765746889676f312e31352e3133856c696e7578000000000000cd3659d2a7c1febcd74da24b3d174958c4513df03b3c98e0f078f05c8ab3ce03401c34d41dbd6a5bb5ac6e6f01ff77c7a15bac31ca9ba0a58a3887d39d24e57200", "gasLimit": "0x4190ab00", "gasUsed": "0x3b583", "hash": "0x818e66df719ac90ebe9d27b2385a96ea49dcdcf7c4fd4144fa9e90dcdb8355c7", "logsBloom": "0x00000000000000000000000000000002000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000008000001000000000000000000000020000000000000000000000000000010000000000000000000000000000000000000000000000000000000040000000000000020020000000000000000000000000000000000000002000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x48e302", "parentHash": "0x1c757a731055437ce12d809b883d9f5ef97742e9e371fa8743beddb6d37379ad", "receiptsRoot": "0x0b1315714349162d1cea1131d0561cdb8f35334d7421a2bd8274f0352fc62fe0", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3f2", "stateRoot": "0x875b793f2f7e9279bcadf6275fba2bacf3b29c6fbb406d51cb679a83ae6abc6c", "timestamp": "0x63eb7988", "totalDifficulty": "0x91c605", "transactions": [ "0x7798444af1b2deb8d7a28d95fd1f534fd8101e7f70df7c6d1884fb334f5b4f68" ], "transactionsRoot": "0xf037df20dfd0f08eedfb44e989fb680ae9b3157bbe2ed05b18413be26b8288df", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "difficulty": "0x2", "extraData": "0xd98301090a846765746889676f312e31352e3133856c696e75780000000000006216d0de730fc686b4e50703c9d88cd26b09d1923bc9729d14582de3b3759f7c7b9bdce78bf0e99abb14bd61360a07698a4b4012d4320130ad4d2bde5ed8389800", "gasLimit": "0x4190ab00", "gasUsed": "0x28ec9", "hash": "0xf97692e5de0db4b9c70ce8f4f7b782fca1b4896166ef1afb928625fd7fe86e81", "logsBloom": "0x00000000000000000000000000000000000000000000000000002000001000000000000000000080000000000000000000000800000000000000000000000240000000000024000001000008000000000000000000000000000000000000000100000000020002400000000000020800000000000000400000000018000000000000000000000000000000000000000001800000000000000020000010000000000080000000000000000000000000000000200000000200000000000000000000000002000000000000000000000000000002100000000000000000000020001000000000000000000000400000000000000000000000000000000008000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x1b4", "parentHash": "0xd2a492bb17e48ed3958c3e5c50ed9a6f5c30ac4d426202eefebe49e1a773a95f", "receiptsRoot": "0x3a6308c002d4519ec0dcf539e23215f44a3236e13525ea3f4c92cebb2be8cd11", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x5ff", "stateRoot": "0xa50ad5efc0c253c516655b619e0b9f31a91c907a541808a68dde9973f659a9dc", "timestamp": "0x61996f89", "totalDifficulty": "0x369", "transactions": [ "0xbc236329cb3614b9cddd64d55e6ea440a252ee7de48c929f4b988af1b69ac605" ], "transactionsRoot": "0xfb0c8583ce9111e8e439862b0d15f9ee0465965f9b98aa31163aeb28f200133d", "uncles": [] }, "id": 1 } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", "blockNumber": "0x5daf3b", "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", "gas": "0xc350", "gasPrice": "0x4a817c800", "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", "input": "0x68656c6c6f21", "nonce": "0x15", "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", "transactionIndex": "0x41", "value": "0xf3dbb76162000", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/metis/web3-p3/ title: Metis — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/metis/web3-p3.mdx --- # Metis — web3, net, eth (3/3) > API reference for [Metis](/rpc-service/chains/chains-api/metis/). [All methods ->](/rpc-service/chains/chains-api/metis/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/metis/web3/) · [2](/rpc-service/chains/chains-api/metis/web3-p2/) · 3 ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x69b7b2d418c241d6be4578ef9934388752ce4645dd2f95b9e3358b58fa60fd8a", "blockNumber": "0x48e833", "from": "0x44aac8a5450461b39eabfa1ca0758ff73498d7f9", "gas": "0x14f778", "gasPrice": "0x342770c00", "hash": "0xf9a677680abfd84badb7dbb0e537e5bb9f32a869c8f3aa997391f1f740594798", "input": "0xe2bbb1580000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000338dcf48f4", "nonce": "0x95b", "to": "0x9cadd693cdb2b118f00252bb3be4c6df6a74d42c", "transactionIndex": "0x0", "value": "0x0", "v": "0x8a4", "r": "0xa7c216eae661a5b528fa77d84f0160f4b4222cb1cabff273e4ae394318576563", "s": "0x7df784e8f2dd806a99b15281070d949b38f121f5e35b0896dbd6117df216b26a", "queueOrigin": "sequencer", "l1TxOrigin": "0x0000000000000000000000000000000000000000", "l1BlockNumber": "0xfdb6a0", "l1Timestamp": "0x63eb909e", "index": "0x48e832", "queueIndex": "0x0", "rawTransaction": "0xf8ae82095b850342770c008314f778949cadd693cdb2b118f00252bb3be4c6df6a74d42c80b844e2bbb1580000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000338dcf48f48208a4a0a7c216eae661a5b528fa77d84f0160f4b4222cb1cabff273e4ae394318576563a07df784e8f2dd806a99b15281070d949b38f121f5e35b0896dbd6117df216b26a" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3c9329b765d88c03d18f87dc1f2b5138c89d9a415d5c73dc7827b87aca176c8e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "blockNumber": "0xeff35f", "contractAddress": null, "cumulativeGasUsed": "0xa12515", "effectiveGasPrice": "0x5a9c688d4", "from": "0x6221a9c005f6e47eb398fd867784cacfdcfff4e7", "gasUsed": "0xb4c8", "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000006221a9c005f6e47eb398fd867784cacfdcfff4e7", "0x0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71" ], "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0xeff35f", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "blockHash": "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3", "logIndex": "0xfa", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000080000000000000000200000000000000000000020000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000010200000000000000000000000000000000000000000000000000000020000", "status": "0x1", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "transactionHash": "0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5", "transactionIndex": "0x66", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/metis/web3/ title: Metis — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/metis/web3.mdx --- # Metis — web3, net, eth (1/3) > API reference for [Metis](/rpc-service/chains/chains-api/metis/). [All methods ->](/rpc-service/chains/chains-api/metis/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/metis/web3-p2/) · [3](/rpc-service/chains/chains-api/metis/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v1.9.10-stable/linux-amd64/go1.17.7", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1088" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x40", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x342770c00" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x48e566" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xcEcef77c4E078E5BD43d9BE301F8663329c23676", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x299c0aa0e0889400" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xEA1Ea22b5b1252FF05bC3DfA630381e72B87f002", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x55" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xef749c1698c65640348dba86c2a3b17b4a514c527a5c78c203911e68bb350a2d"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x48E351"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb1fa0b55d289be998eba272f19453148129f4bec451054470415433560191196"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x48E351"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/metis/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/metis/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/midnight/childstate-p2/ title: Midnight — childstate, rpc, chain, state (2/2) source: docs/rpc-service/chains/chains-api/midnight/childstate-p2.mdx --- # Midnight — childstate, rpc, chain, state (2/2) > API reference for [Midnight](/rpc-service/chains/chains-api/midnight/). [All methods ->](/rpc-service/chains/chains-api/midnight/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/midnight/childstate/) · 2 ## `state_getKeysPaged` > Returns paged storage keys. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Key prefix (hex-encoded) to filter returned keys. Use `0x` to retrieve all keys. 2. ``: Count — maximum number of keys to return. 3. ``: Start key (hex-encoded) to start returning keys from. Use `0x` or omit to start from the beginning. 4. `` (hex-encoded, 32-byte; optional): Block hash at which to query the keys. If omitted, defaults to the latest block. ### Returns * `>`: A list of hex-encoded keys in the state that match the specified prefix, limited by the given count and starting from start key. * `[]`: Returned if no keys match the given criteria. * `null`: Returned if the provided block hash is invalid or unavailable. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getKeysPaged", "params": [ "0x", 10, "0x" ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x0b20199ace3564d0964e2c4d4a9ba4694e7b9012096b41c4eb3aaf947f6ea429", "0x0cfd083eaa944b95833ee029c0bdffe34e7b9012096b41c4eb3aaf947f6ea429", "0x0cfd083eaa944b95833ee029c0bdffe388dcde934c658227ee1dfafcd6e16903", "0x0cfd083eaa944b95833ee029c0bdffe3e0cdd062e6eaf24295ad4ccfc41d4609", "0x26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac", "0x26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850", "0x26aa394eea5630e07c48ae0c9558cef734abf5cb34d6244378cddbf18e849d96", "0x26aa394eea5630e07c48ae0c9558cef74e7b9012096b41c4eb3aaf947f6ea429", "0x26aa394eea5630e07c48ae0c9558cef75684a022a34dd8bfa2baaf44f172b710", "0x26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7" ] } ``` --- ## `state_getKeysPagedAt` > Returns paged keys at a specific block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Key prefix (hex-encoded) to filter returned keys. Use `0x` to retrieve all keys. 2. ``: Count — maximum number of keys to return. 3. ``: Start key (hex-encoded) to start returning keys from. Use `0x` or omit to start from the beginning. 4. `` (hex-encoded, 32-byte): Block hash at which to query the keys. ### Returns * `>`: A list of hex-encoded keys in the state that match the specified prefix, limited by the given count, starting from start key, at the specified block hash. * `[]`: Returned if no keys match the given criteria. * `null`: Returned if the provided block hash is invalid or unavailable. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getKeysPagedAt", "params": [ "0x1a2b3c", // key prefix 10, // maximum number of keys "0x", // start key (empty = start from first key) "0x498b4b3aa63dc3abaebf559be8e903357c07589532eb931f9097d533c99800a2" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ "0x1a2b3c4d5e6f0011", "0x1a2b3c4d5e6f0022", "0x1a2b3c4d5e6f0033" ] } ``` --- ## `state_getMetadata` > Returns the current runtime metadata. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (hex-encoded, 32-byte; optional; default = latest block): Block hash at which to query the metadata. ### Returns * ``: * Hex-encoded SCALE-encoded metadata for the runtime at the given block hash (or latest block if no hash is provided). * This metadata describes the runtime's modules, storage items, extrinsics, and constants. * `null`: Returned if the metadata is unavailable or the block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getMetadata", "params": [] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6d6574610e8103000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c08306672616d655f73797374656d2c4163636f756e74496e666f08144e6f6e636501102c4163636f756e74446174610114001401146e6f6e63651001144e6f6e6365000124636f6e73756d657273100120526566436f756e7400012470726f766964657273100120526566436f756e7400012c73756666696369656e7473100120526566436f756e740001106461746114012c4163636f756e74446174610000100000050500140c3c70616c6c65745f62616c616e6365731474797065732c4163636f7..." } ``` --- ## `state_getReadProof` > Returns a proof of inclusion for storage entries. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `>`: Keys — an array of hex-encoded state keys to create a read proof for. 2. `` (hex-encoded, 32-byte): Block hash at which to generate the proof. ### Returns * ``: The read proof object for the requested state keys. * `at` (string): Block hash at which the proof was generated. * `proof` (array``): An array of hex-encoded proof nodes required to prove the existence of the keys at the specified block. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getReadProof", "params": [ [ "0x1a2b3c4d5e6f0011", "0x1a2b3c4d5e6f0022" ], "0x94f03b64f26069f6995de0e68442a3470801fd6cdb3a0cf7491ed7ca217f23ec" ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "at": "0x94f03b64f26069f6995de0e68442a3470801fd6cdb3a0cf7491ed7ca217f23ec", "proof": [ "0x802db9803d16513e9985407f820a80efdce62468bf83d4bd901439f1bd90301ed67b140c802558978862c74093fbfbda43640e35d7835a94faef9cc901d7a587db0ddd785180db91f4799a4b8ee3625aa624fdd488505a164f72c123ebb190b131c8259abd36809b8be6ee23eadd747a7fd1201db80a1b3639abf057a79e74ea893c40a4aeefbf80482fbb43c1300417b5e77c5f80ee53cbd3e403c638e893a077bab16a423771818077baa6c5755310b557a6c78028494f837157f8f782f12094d1ff4763d98f05238000e4849ead44a8fe73e1a5536de4173f3c980af6598cb2c9d182eb5be81538ad80f9301ba37a1430856c624d3e305a0a09b900845ddf916cb024988b10b077b55780c5834099227798c65ed9f0771bcb2599e1c4b66e7817e058eb1d6b6f1337ba67" ] } } ``` --- ## `state_getRuntimeVersion` > Returns the runtime version at the current best block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (hex-encoded, 32-byte; optional; default = latest block): Block hash at which to query the runtime version. ### Returns * ``: The runtime version information for the given block (or the latest block if none is provided). * `specName` (string): Name of the runtime specification. * `implName` (string): Name of the runtime implementation. * `authoringVersion` (number): Authoring version of the runtime. * `specVersion` (number): Runtime specification version. * `implVersion` (number): Runtime implementation version. * `apis` (array`<[string, number]>`): List of supported runtime API names and their versions. * `transactionVersion` (number): Transaction format version. * `stateVersion` (number, optional): State format version (if present). ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getRuntimeVersion", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "specName": "midnight", "implName": "midnight", "authoringVersion": 1, "specVersion": 12000, "implVersion": 0, "apis": [ [ "0xfbc577b9d747efd6", 1 ], [ "0xdf6acb689907609b", 5 ], [ "0x7d699da8a672e867", 4 ] ], "transactionVersion": 2, "stateVersion": 1 } } ``` --- ## `state_getStorage` > Returns storage value for a given key. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Storage key (hex-encoded) identifying the desired value in the state. 2. `` (hex-encoded, 32-byte; optional; default = latest block): Block hash at which to query storage. ### Returns * ``: * The hex-encoded SCALE-encoded value stored under the specified storage key at the given block hash (or at the latest block if no hash is provided). * null if the key does not exist or the block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorage", "params": [ "0x1a2b3c4d5e6f" ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `state_getStorageAt` > Returns storage value at a given block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Storage key (hex-encoded) identifying the desired value in the state. 2. `` (hex-encoded, 32-byte): Block hash at which to query storage. ### Returns * ``: * The hex-encoded SCALE-encoded value stored under the specified storage key at the given block hash. * `null` if the key does not exist or the block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageAt", "params": [ "0x1a2b3c4d5e6f", "0x94f03b64f26069f6995de0e68442a3470801fd6cdb3a0cf7491ed7ca217f23ec" ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `state_getStorageHash` > Returns hash of the storage entry. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Storage key (hex-encoded) identifying the desired value in the state. 2. `` (hex-encoded, 32-byte; optional; default = latest block): Block hash at which to query the storage hash. ### Returns * ``: * The hash (hex-encoded) of the value stored under the specified storage key at the given block hash (or latest block if omitted). * `null` if the key does not exist or the block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageHash", "params": [ "0x1a2b3c4d5e6f" ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `state_getStorageHashAt` > Returns hash of storage at a specific block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Storage key (hex-encoded) identifying the desired value in the state. 2. `` (hex-encoded, 32-byte): Block hash at which to query the storage hash. ### Returns * ``: * The hash (hex-encoded) of the value stored under the specified storage key at the given block hash. * `null` if the key does not exist or the block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageHashAt", "params": [ "0x1a2b3c4d5e6f", "0x94f03b64f26069f6995de0e68442a3470801fd6cdb3a0cf7491ed7ca217f23ec" ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `state_getStorageSize` > Returns byte size of storage for a key. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Storage key (hex-encoded) identifying the desired value in the state. 2. `` (hex-encoded, 32-byte; optional; default = latest block): Block hash at which to query the storage size. ### Returns * ``: * The size of the value stored under the specified storage key, in bytes, at the given block hash (or at the latest block if no hash is provided). * `null` if the key does not exist or the block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageSize", "params": [ "0x1a2b3c4d5e6f" ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `state_getStorageSizeAt` > Returns size of storage at a given block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Storage key (hex-encoded) identifying the desired value in the state. 2. `` (hex-encoded, 32-byte): Block hash at which to query the storage size. ### Returns * ``: * The size of the value stored under the specified storage key, in bytes, at the given block hash. * `null` if the key does not exist or the block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageSizeAt", "params": [ "0x01020304abcdef", "0x111122223333444455556666777788889999aaaabbbbccccddddeeeeffff0000" ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": 32 } ``` --- ## `state_queryStorageAt` > Queries storage at a specific block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `>`: Keys — an array of hex-encoded storage keys to query. 2. `` (hex-encoded, 32-byte; optional; default = latest block): Block hash at which to query. ### Returns * `>`: An array containing one or more change sets for the specified keys at the given block (or latest block if none is specified). * `block` (string): The block hash at which the values were queried. * `changes` (array`<[string, string|null]>`): Key-value pairs for each requested storage key: * `key` (string): Hex-encoded storage key. * `value` (string|null): Hex-encoded value stored at that key, or null if no value is set. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_queryStorageAt", "params": [ [ "0x26aa394eea5630e07c48ae0c9558cef7", "0x1a2b3c4d" ], "0x84e03f95bf0241e0e6768d510bd5d53fd86353cec4e5903524161e04da3905fc" ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ { "block": "0x84e03f95bf0241e0e6768d510bd5d53fd86353cec4e5903524161e04da3905fc", "changes": [ [ "0x26aa394eea5630e07c48ae0c9558cef7", null ], [ "0x1a2b3c4d", null ] ] } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/midnight/childstate/ title: Midnight — childstate, rpc, chain, state (1/2) source: docs/rpc-service/chains/chains-api/midnight/childstate.mdx --- # Midnight — childstate, rpc, chain, state (1/2) > API reference for [Midnight](/rpc-service/chains/chains-api/midnight/). [All methods ->](/rpc-service/chains/chains-api/midnight/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/midnight/childstate-p2/) ## `childstate_getStorageSize` > Gets the byte size of a child storage value. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Child storage key (hex-encoded) identifying the child storage. 2. ``: Storage key (hex-encoded) whose value size should be retrieved. 3. `` (optional; if omitted, uses the latest block): Block hash at which to query storage. ### Returns * ``: * The size of the value stored under the specified key in the given child storage at the provided block hash, expressed in bytes. * `null` if the key does not exist or if the storage key/block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "childstate_getStorageSize", "params": [ "0x1a2b3c4d5e6f", // child storage key "0x7f8e9d0c1b2a", // storage key to measure "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": 16 } ``` --- **RPC Meta**: ## `rpc_methods` > Returns a list of all available RPC methods. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: Lists all RPC methods supported by the node along with their version numbers. * `methods` (array``): An array of available method names. * `version` (number): The RPC API version of the node. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "rpc_methods", "params": [] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "methods": [ "account_nextIndex", "archive_unstable_body", "archive_unstable_call", "archive_unstable_finalizedHeight", "archive_unstable_genesisHash", "archive_unstable_hashByHeight", "archive_unstable_header", "archive_unstable_storage", "author_hasKey", "author_hasSessionKeys", "author_insertKey", "author_pendingExtrinsics", "author_removeExtrinsic", "author_rotateKeys", "author_submitAndWatchExtrinsic", "author_submitExtrinsic", "author_unwatchExtrinsic", "chainHead_v1_body", "chainHead_v1_call", "chainHead_v1_continue", "chainHead_v1_follow", "chainHead_v1_header", "chainHead_v1_stopOperation", "chainHead_v1_storage", "chainHead_v1_unfollow", "chainHead_v1_unpin", "chainSpec_v1_chainName", "chainSpec_v1_genesisHash", "chainSpec_v1_properties", "chain_getBlock", "chain_getBlockHash", "chain_getFinalisedHead", "chain_getFinalizedHead", "chain_getHead", "chain_getHeader", "chain_getRuntimeVersion", "chain_subscribeAllHeads", "chain_subscribeFinalisedHeads", "chain_subscribeFinalizedHeads", "chain_subscribeNewHead", "chain_subscribeNewHeads", "chain_subscribeRuntimeVersion", "chain_unsubscribeAllHeads", "chain_unsubscribeFinalisedHeads", "chain_unsubscribeFinalizedHeads", "chain_unsubscribeNewHead", "chain_unsubscribeNewHeads", "chain_unsubscribeRuntimeVersion", "childstate_getKeys", "childstate_getKeysPaged", "childstate_getKeysPagedAt", "childstate_getStorage", "childstate_getStorageEntries", "childstate_getStorageHash", "childstate_getStorageSize", "grandpa_proveFinality", "grandpa_roundState", "grandpa_subscribeJustifications", "grandpa_unsubscribeJustifications", "midnight_apiVersions", "midnight_contractState", "midnight_decodeEvents", "midnight_jsonBlock", "midnight_jsonContractState", "midnight_ledgerVersion", "midnight_unclaimedAmount", "midnight_zswapChainState", "midnight_zswapStateRoot", "offchain_localStorageGet", "offchain_localStorageSet", "rpc_methods", "sidechain_getAriadneParameters", "sidechain_getEpochCommittee", "sidechain_getParams", "sidechain_getRegistrations", "sidechain_getStatus", "state_call", "state_callAt", "state_getChildReadProof", "state_getKeys", "state_getKeysPaged", "state_getKeysPagedAt", "state_getMetadata", "state_getPairs", "state_getReadProof", "state_getRuntimeVersion", "state_getStorage", "state_getStorageAt", "state_getStorageHash", "state_getStorageHashAt", "state_getStorageSize", "state_getStorageSizeAt", "state_queryStorage", "state_queryStorageAt", "state_subscribeRuntimeVersion", "state_subscribeStorage", "state_traceBlock", "state_unsubscribeRuntimeVersion", "state_unsubscribeStorage", "subscribe_newHead", "system_accountNextIndex", "system_addLogFilter", "system_addReservedPeer", "system_chain", "system_chainType", "system_dryRun", "system_dryRunAt", "system_health", "system_localListenAddresses", "system_localPeerId", "system_name", "system_nodeRoles", "system_peers", "system_properties", "system_removeReservedPeer", "system_reservedPeers", "system_resetLogFilter", "system_syncState", "system_unstable_networkState", "system_version", "transactionWatch_v1_submitAndWatch", "transactionWatch_v1_unwatch", "transaction_v1_broadcast", "transaction_v1_stop", "unsubscribe_newHead" ] } } ``` --- **Chain & Block Data**: ## `chain_getBlock` > Returns full block data for the specified hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional; default = latest block): Block hash (hex-encoded). ### Returns * ``: The full block data for the specified (or latest) block. * `block` (object): * `header` (object): Standard block header fields: * `parentHash` (string): Hash of the parent block. * `number` (string): Block number (in hex). * `stateRoot` (string): State trie root hash. * `extrinsicsRoot` (string): Extrinsics trie root hash. * `digest` (object): Consensus-specific digest logs. * `extrinsics` (array``): Array of hex-encoded extrinsics included in the block. * `justifications` (array, optional): Consensus justifications if available. * `null`: Returned if the block hash is unknown or unavailable. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlock", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block": { "header": { "parentHash": "0x26b043f145df5bc8a79ef3d4b28c4268f00d8dffb3240a5f2e0a9cb9fdf65463", "number": "0xfd930", "stateRoot": "0x99e9486ce0903d2e6edd3cb956a8d1e494bd62837a3e49522ae4ce132744c1af", "extrinsicsRoot": "0xd76623660daae937c6946187f8fd42f73565d8871f558c38691fc66669d41b95", "digest": { "logs": [ "0x066175726120b6ef6b1100000000", "0x066d637368806ee7f2ab25cdde91cf901ff3fcf2574b03aab5ff415dad4709d0eaaed37ba253", "0x044d4e535610e02e0000", "0x05617572610101d61d4bb831d89528e61ed672666d5365812e9060e4a9abe832bea327fb48d541eba53fe823022f7d2baee8baa61a981a648c87ded75656a2f01e5fd66fb7b782" ] } }, "extrinsics": [ "0x280401000ba039c2519801", "0x9c040a00e12e00007f913da0a8f430c261bda1748a29a452785213eeb5c70f27efd0afa74f7a5e2a" ] }, "justifications": null } } ``` --- ## `chain_getBlockHash` > Returns the block hash for a given block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (unsigned integer; optional; default = latest block): Block number. ### Returns * ``: * The block hash (hex-encoded) for the specified block number. * If no block number is provided, returns the hash of the latest block. * `null` if the given block number is unknown or unavailable. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlockHash", "params": [ 981031 ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x87f5c08ba8334e4ee1642ff9646e94dd46080b71fff03714be8b36f22e481b95" } ``` --- ## `chain_getFinalisedHead` > Returns the latest finalized block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: * The hash of the latest finalized block (hex-encoded). * `null` if no finalized block is available (rare or only in misconfigured nodes). ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getFinalisedHead", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xddeff7d6554d5b2e7d28dd2797ec241b7ff45f48d154b34a0b4e8f0cb19065ff" } ``` --- ## `chain_getFinalizedHead` > Returns the latest finalized block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: * The hash of the latest finalized block (hex-encoded). * `null` if no finalized block is available (rare or only in misconfigured nodes). ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getFinalizedHead", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x2da74d4471a940299d8e7635aa131224fb5df9bddf1250b9c6d5b7c93a0f4faa" } ``` --- ## `chain_getHead` > Returns the current best block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: * The hash of the current best (head) block in the chain (hex-encoded). * `null` if the head is not available or the node is not fully synced. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getHead", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xdfe4193fb5f00ba7a0c27b74c1350135a1ab4d317352cd653b2dd1955a47bda4" } ``` --- ## `chain_getHeader` > Fetches the header of a given block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional; default = latest block): Block hash (hex-encoded) of the block header to fetch. ### Returns * ``: The block header for the specified block hash or the latest block if no hash is provided. * `parentHash` (string): Hash of the parent block. * `number` (string): Block number (hex-encoded). * `stateRoot` (string): State trie root hash. * `extrinsicsRoot` (string): Extrinsics trie root hash. * `digest` (object): Consensus-specific digest logs. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getHeader", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "parentHash": "0x40053cbf0cd5a892d83dd1e571eca18aa26f23b662d73543e4923fd1a423b72d", "number": "0xfda2c", "stateRoot": "0x60433a64c395298ed61505bc99640a122ccac6cf001c55a437ee7843d9fdd255", "extrinsicsRoot": "0xe5e242d6ee488f323663b2361fc35562a753d4144f4f94ee6530d4109685d646", "digest": { "logs": [ "0x066175726120bcf06b1100000000", "0x066d637368805157cac8b69df7748c7d9705a707a2a6a1f2d0ed9d7f669d1e568b91a02e26fa", "0x044d4e535610e02e0000", "0x05617572610101bebbfeb2aa9614db5d1b9cb0835c76b7916cd4012e9aa1ea20cdb0817fcb78037ef3eccbc41d3ed1c445a7869410cb5ac5d2c87a9b49d17b58009ae78e82b482" ] } } } ``` --- ## `chain_getRuntimeVersion` > Returns the current runtime version of the chain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional; default = latest block): Block hash (hex-encoded) at which to retrieve the runtime version. ### Returns * ``: Runtime version details for the given block (or the latest if no hash is provided). * `specName` (string): Name of the runtime specification. * `implName` (string): Name of the runtime implementation. * `authoringVersion` (number): Authoring version of the runtime. * `specVersion` (number): Version of the runtime specification. * `implVersion` (number): Implementation version. * `apis` (array`<[string, number]>`): List of supported API names and their version numbers. * `transactionVersion` (number): Transaction format version supported by the runtime. * `stateVersion` (number, optional): State format version (if present). ### Request example ```shell { "id": 1, "jsonrpc": "2.0", "result": { "specName": "midnight", "implName": "midnight", "authoringVersion": 1, "specVersion": 12000, "implVersion": 0, "apis": [ [ "0xfbc577b9d747efd6", 1 ], [ "0xdf6acb689907609b", 5 ], [ "0x7d699da8a672e867", 4 ] ], "transactionVersion": 2, "stateVersion": 1 } } ``` --- **State & Storage**: ## `state_call` > Executes a runtime call without submitting an extrinsic. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Runtime function name (e.g., `Metadata_metadata`). 2. ``: Data (hex-encoded SCALE-encoded arguments for the function). 3. `` (32-byte, hex; optional; default = latest block): Block hash. ### Returns * ``: A hex-encoded SCALE-encoded result returned by the runtime function call. * `null`: Returned if the function call fails or the given parameters are invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_call", "params": [ "Metadata_metadata", "0x" ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xde0904006d6574610e8103000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c08306672616d655f73797374656d2c4163636f756e74496e666f08144e6f6e636501102c4163636f756e74446174610114001401146e6f6e63651001144e6f6e6365000124636f6e73756d657273100120526566436f756e7400012470726f7669646572731001205265664..." } ``` --- ## `state_callAt` > Executes a runtime call at a specific block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Runtime function name (for example, `Metadata_metadata`). 2. ``: Data — SCALE-encoded arguments for the function, hex-encoded (use `0x` if there are no arguments). 3. `` (32-byte, hex): Block hash at which to execute the runtime function call. ### Returns * ``: A hex-encoded SCALE-encoded result returned by the runtime function call at the specified block. * `null`: Returned if the call fails or the provided parameters are invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_callAt", "params": [ "Metadata_metadata", "0x", "0x94f03b64f26069f6995de0e68442a3470801fd6cdb3a0cf7491ed7ca217f23ec" ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xde0904006d6574610e8103000c1c73705f636f72651863727970746f2c4163636f756e7449643332000004000401205b75383b2033325d0000040000032000000008000800000503000c08306672616d655f73797374656d2c4163636f756e74496e666f08144e6f6e636501102c4163636f756e74446174610114001401146e6f6e63651001144e6f6e6365000124636f6e73756d657273100120526566436f756e7400012470726f766964657273100120526566436f756e7400012c73756666696369656e7473100120526566436f756e740001106461746114012c4163636f756e74446174610000100000050500140c3c70616c6c65745f62616c616e6365731474797065732c416..." } ``` --- ## `state_getChildReadProof` > Returns proof of inclusion for child storage. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Child storage key (hex-encoded) identifying the child storage. 2. `>`: Keys — an array of hex-encoded storage keys inside the child storage to generate a read proof for. 3. `` (hex-encoded, 32-byte): Block hash at which to generate the read proof. ### Returns * ``: The read proof object for the requested child storage keys. * `at` (string): Block hash at which the proof was generated. * `proof` (array``): An array of hex-encoded proof nodes required to prove the existence of the keys. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getChildReadProof", "params": [ "0x1a2b3c4d5e6f", // child storage key [ "0x7f8e9d0c1b2a", // key 1 "0x1234567890ab" // key 2 ], "0x498b4b3aa63dc3abaebf559be8e903357c07589532eb931f9097d533c99800a2" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "at": "0x498b4b3aa63dc3abaebf559be8e903357c07589532eb931f9097d533c99800a2", "proof": [ "0x1234abcd5678ef90", "0x9abcdeffedcba9876543210011223344" ] } } ``` --- ## `state_getKeys` > Returns a list of all keys in the storage. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Key prefix (hex-encoded) to filter returned keys. Use `0x` to retrieve all keys. 2. `` (hex-encoded, 32-byte; optional): Block hash. ### Returns * `>`: A list of hex-encoded keys in the state that match the specified prefix. * `[]`: Returned if no keys match the given prefix. * `null`: Returned if the provided block hash is invalid or unavailable. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getKeys", "params": [ "0x" ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ "0x0b20199ace3564d0964e2c4d4a9ba4694e7b9012096b41c4eb3aaf947f6ea429", "0x0cfd083eaa944b95833ee029c0bdffe34e7b9012096b41c4eb3aaf947f6ea429", "0x0cfd083eaa944b95833ee029c0bdffe388dcde934c658227ee1dfafcd6e16903", "0x0cfd083eaa944b95833ee029c0bdffe3e0cdd062e6eaf24295ad4ccfc41d4609", "0x26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac", "0x26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850", "0x26aa394eea5630e07c48ae0c9558cef734abf5cb34d6244378cddbf18e849d96" ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/midnight/ title: Midnight description: Midnight is a data protection-focused sidechain of Cardano, designed to support confidential smart contracts and… 60 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/midnight/index.mdx --- # Midnight
> Midnight API is available on [Web3 API platform](https://www.ankr.com/rpc/midnight). *Midnight* is a data protection-focused sidechain of Cardano, designed to support confidential smart contracts and zero-knowledge (ZK) technology. Developed by IOG (Input Output Global)—the same team behind Cardano—Midnight aims to bring privacy-preserving decentralized applications (dApps) to Web3. **Key Features**: * **Confidential Smart Contracts**: Written in TypeScript, supporting zero-knowledge (ZK) privacy by default. * **Zero-Knowledge Proofs (ZKPs)**: Enable validation without revealing sensitive data. * **Privacy-First Architecture**: Built for data protection and regulatory compliance (example: GDPR). * **Selective Disclosure**: Users can choose what information to share and with whom. * **Cardano's Sidechain**: Interoperable with Cardano, using ADA and its wrapped token DUST. * **Custom PoS Consensus**: A privacy-aware Proof-of-Stake mechanism tailored for Midnight. Midnight is at a Testnet stage, providing a stable sandbox environment to develop commercially successful on-chain applications that benefit from the transparency of a blockchain while addressing granular data protection needs. In order for your Web3 application to interact with Midnight — either by reading blockchain data or sending transactions to the network — it must connect to a Midnight node. Developers interact with the blockchain using the methods provided by the API. Midnight supports JSON-RPC methods for API interaction. Responses come in [JSON format](https://www.json.org/json-en.html). ## JSON-RPC methods **System Info & Networking**: * [`system_chain`](/rpc-service/chains/chains-api/midnight/system/#system_chain) — Returns the name of the chain. * [`system_chainType`](/rpc-service/chains/chains-api/midnight/system/#system_chaintype) — Returns chain type (dev, local, live). * [`system_health`](/rpc-service/chains/chains-api/midnight/system/#system_health) — Returns node health and sync status. * [`system_properties`](/rpc-service/chains/chains-api/midnight/system/#system_properties) — Returns chain properties (token decimals, etc). * [`system_syncState`](/rpc-service/chains/chains-api/midnight/system/#system_syncstate) — Returns sync status and highest known block. * [`system_version`](/rpc-service/chains/chains-api/midnight/system/#system_version) — Returns node implementation version. **Accounts & Keys**: * [`account_nextIndex`](/rpc-service/chains/chains-api/midnight/system/#account_nextindex) — Returns the next nonce for an account. * [`system_accountNextIndex`](/rpc-service/chains/chains-api/midnight/system/#system_accountnextindex) — Alias to `account_nextIndex`. **Grandpa Finality**: * [`grandpa_proveFinality`](/rpc-service/chains/chains-api/midnight/system/#grandpa_provefinality) — Provides a justification proof for finalized blocks via Grandpa. * [`grandpa_roundState`](/rpc-service/chains/chains-api/midnight/system/#grandpa_roundstate) — Returns the current round state of the Grandpa finality mechanism. **Offchain Storage**: * [`offchain_localStorageGet`](/rpc-service/chains/chains-api/midnight/system/#offchain_localstorageget) — Gets data from local offchain storage. * [`offchain_localStorageSet`](/rpc-service/chains/chains-api/midnight/system/#offchain_localstorageset) — Stores data in local offchain storage. **Archive & Unstable Chain Access**: * [`archive_unstable_body`](/rpc-service/chains/chains-api/midnight/system/#archive_unstable_body) — Fetches block body for historical blocks. * [`archive_unstable_call`](/rpc-service/chains/chains-api/midnight/system/#archive_unstable_call) — Executes a runtime call at a specific block height. * [`archive_unstable_finalizedHeight`](/rpc-service/chains/chains-api/midnight/system/#archive_unstable_finalizedheight) — Returns the finalized block height. * [`archive_unstable_genesisHash`](/rpc-service/chains/chains-api/midnight/system/#archive_unstable_genesishash) — Returns the genesis hash. * [`archive_unstable_hashByHeight`](/rpc-service/chains/chains-api/midnight/system/#archive_unstable_hashbyheight) — Returns the block hash at a specific height. * [`archive_unstable_header`](/rpc-service/chains/chains-api/midnight/system-p2/#archive_unstable_header) — Fetches block header from archive. * [`archive_unstable_storage`](/rpc-service/chains/chains-api/midnight/system-p2/#archive_unstable_storage) — Returns historical storage values. **Sidechain & Midnight-specific**: * [`midnight_apiVersions`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_apiversions) — Lists supported API versions for the Midnight node. * [`midnight_contractState`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_contractstate) — Fetches the on-chain state of a specific Midnight contract. * [`midnight_decodeEvents`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_decodeevents) — Decodes event data emitted by Midnight smart contracts. * [`midnight_jsonBlock`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_jsonblock) — Returns a full block in a JSON format. * [`midnight_jsonContractState`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_jsoncontractstate) — Returns human-readable JSON format of contract state. * [`midnight_zswapChainState`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_zswapchainstate) — Returns ZSwap contract state information. * [`sidechain_getAriadneParameters`](/rpc-service/chains/chains-api/midnight/system-p2/#sidechain_getariadneparameters) — Gets Ariadne protocol parameters used for privacy. * [`sidechain_getEpochCommittee`](/rpc-service/chains/chains-api/midnight/system-p2/#sidechain_getepochcommittee) — Returns the validator committee for the current or given epoch. * [`sidechain_getParams`](/rpc-service/chains/chains-api/midnight/system-p2/#sidechain_getparams) — Fetches current configuration parameters for the sidechain. * [`sidechain_getRegistrations`](/rpc-service/chains/chains-api/midnight/system-p2/#sidechain_getstatus) — Retrieves the list of registered sidechain participants. * [`sidechain_getStatus`](/rpc-service/chains/chains-api/midnight/system-p2/#childstate_getkeys) — Returns current sidechain status including sync state and parameters. **Child State Access**: * [`childstate_getKeys`](/rpc-service/chains/chains-api/midnight/system-p2/#childstate_getkeys) — Returns keys from child storage. * [`childstate_getKeysPaged`](/rpc-service/chains/chains-api/midnight/system-p2/#childstate_getkeyspaged) — Returns paged keys from child storage. * [`childstate_getKeysPagedAt`](/rpc-service/chains/chains-api/midnight/system-p3/#childstate_getkeyspagedat) — Returns paged keys from a past block. * [`childstate_getStorage`](/rpc-service/chains/chains-api/midnight/system-p3/#childstate_getstorage) — Gets a storage entry from child storage. * [`childstate_getStorageEntries`](/rpc-service/chains/chains-api/midnight/system-p3/#childstate_getstorageentries) — Gets multiple entries from child storage. * [`childstate_getStorageHash`](/rpc-service/chains/chains-api/midnight/system-p3/#childstate_getstoragehash) — Gets hash of a child storage value. * [`childstate_getStorageSize`](/rpc-service/chains/chains-api/midnight/childstate/#childstate_getstoragesize) — Gets the byte size of a child storage value. **RPC Meta**: * [`rpc_methods`](/rpc-service/chains/chains-api/midnight/childstate/#rpc_methods) — Returns a list of all available RPC methods. **Chain & Block Data**: * [`chain_getBlock`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getblock) — Returns full block data for the specified hash. * [`chain_getBlockHash`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getblockhash) — Returns the block hash for a given block number. * [`chain_getFinalisedHead`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getfinalisedhead) — Returns the latest finalized block hash. * [`chain_getFinalizedHead`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getfinalizedhead) — Same as above (spelling variant). * [`chain_getHead`](/rpc-service/chains/chains-api/midnight/childstate/#chain_gethead) — Returns the current best block hash. * [`chain_getHeader`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getheader) — Fetches the header of a given block. * [`chain_getRuntimeVersion`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getruntimeversion) — Returns the current runtime version of the chain. **State & Storage**: * [`state_call`](/rpc-service/chains/chains-api/midnight/childstate/#state_call) — Executes a runtime call without submitting an extrinsic. * [`state_callAt`](/rpc-service/chains/chains-api/midnight/childstate/#state_callat) — Executes a runtime call at a specific block. * [`state_getChildReadProof`](/rpc-service/chains/chains-api/midnight/childstate/#state_getchildreadproof) — Returns proof of inclusion for child storage. * [`state_getKeys`](/rpc-service/chains/chains-api/midnight/childstate/#state_getkeys) — Returns a list of all keys in the storage. * [`state_getKeysPaged`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getkeyspaged) — Returns paged storage keys. * [`state_getKeysPagedAt`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getkeyspagedat) — Returns paged keys at a specific block. * [`state_getMetadata`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getmetadata) — Returns the current runtime metadata. * [`state_getReadProof`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getreadproof) — Returns a proof of inclusion for storage entries. * [`state_getRuntimeVersion`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getruntimeversion) — Returns the runtime version at the current best block. * [`state_getStorage`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstorage) — Returns storage value for a given key. * [`state_getStorageAt`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstorageat) — Returns storage value at a given block. * [`state_getStorageHash`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstoragehash) — Returns hash of the storage entry. * [`state_getStorageHashAt`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstoragehashat) — Returns hash of storage at a specific block. * [`state_getStorageSize`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstoragesize) — Returns byte size of storage for a key. * [`state_getStorageSizeAt`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstoragesizeat) — Returns size of storage at a given block. * [`state_queryStorageAt`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_querystorageat) — Queries storage at a specific block. --- **System Info & Networking**: ## Methods ### system, account, grandpa, offchain, archive, midnight, sidechain, childstate - [`system_chain`](/rpc-service/chains/chains-api/midnight/system/#system_chain) - [`system_chainType`](/rpc-service/chains/chains-api/midnight/system/#system_chaintype) - [`system_health`](/rpc-service/chains/chains-api/midnight/system/#system_health) - [`system_properties`](/rpc-service/chains/chains-api/midnight/system/#system_properties) - [`system_syncState`](/rpc-service/chains/chains-api/midnight/system/#system_syncstate) - [`system_version`](/rpc-service/chains/chains-api/midnight/system/#system_version) - [`account_nextIndex`](/rpc-service/chains/chains-api/midnight/system/#account_nextindex) - [`system_accountNextIndex`](/rpc-service/chains/chains-api/midnight/system/#system_accountnextindex) - [`grandpa_proveFinality`](/rpc-service/chains/chains-api/midnight/system/#grandpa_provefinality) - [`grandpa_roundState`](/rpc-service/chains/chains-api/midnight/system/#grandpa_roundstate) - [`offchain_localStorageGet`](/rpc-service/chains/chains-api/midnight/system/#offchain_localstorageget) - [`offchain_localStorageSet`](/rpc-service/chains/chains-api/midnight/system/#offchain_localstorageset) - [`archive_unstable_body`](/rpc-service/chains/chains-api/midnight/system/#archive_unstable_body) - [`archive_unstable_call`](/rpc-service/chains/chains-api/midnight/system/#archive_unstable_call) - [`archive_unstable_finalizedHeight`](/rpc-service/chains/chains-api/midnight/system/#archive_unstable_finalizedheight) - [`archive_unstable_genesisHash`](/rpc-service/chains/chains-api/midnight/system/#archive_unstable_genesishash) - [`archive_unstable_hashByHeight`](/rpc-service/chains/chains-api/midnight/system/#archive_unstable_hashbyheight) - [`archive_unstable_header`](/rpc-service/chains/chains-api/midnight/system-p2/#archive_unstable_header) - [`archive_unstable_storage`](/rpc-service/chains/chains-api/midnight/system-p2/#archive_unstable_storage) - [`midnight_apiVersions`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_apiversions) - [`midnight_contractState`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_contractstate) - [`midnight_decodeEvents`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_decodeevents) - [`midnight_jsonBlock`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_jsonblock) - [`midnight_jsonContractState`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_jsoncontractstate) - [`midnight_zswapChainState`](/rpc-service/chains/chains-api/midnight/system-p2/#midnight_zswapchainstate) - [`sidechain_getAriadneParameters`](/rpc-service/chains/chains-api/midnight/system-p2/#sidechain_getariadneparameters) - [`sidechain_getEpochCommittee`](/rpc-service/chains/chains-api/midnight/system-p2/#sidechain_getepochcommittee) - [`sidechain_getParams`](/rpc-service/chains/chains-api/midnight/system-p2/#sidechain_getparams) - [`sidechain_getStatus`](/rpc-service/chains/chains-api/midnight/system-p2/#sidechain_getstatus) - [`childstate_getKeys`](/rpc-service/chains/chains-api/midnight/system-p2/#childstate_getkeys) - [`childstate_getKeysPaged`](/rpc-service/chains/chains-api/midnight/system-p2/#childstate_getkeyspaged) - [`childstate_getKeysPagedAt`](/rpc-service/chains/chains-api/midnight/system-p3/#childstate_getkeyspagedat) - [`childstate_getStorage`](/rpc-service/chains/chains-api/midnight/system-p3/#childstate_getstorage) - [`childstate_getStorageEntries`](/rpc-service/chains/chains-api/midnight/system-p3/#childstate_getstorageentries) - [`childstate_getStorageHash`](/rpc-service/chains/chains-api/midnight/system-p3/#childstate_getstoragehash) ### childstate, rpc, chain, state - [`childstate_getStorageSize`](/rpc-service/chains/chains-api/midnight/childstate/#childstate_getstoragesize) - [`rpc_methods`](/rpc-service/chains/chains-api/midnight/childstate/#rpc_methods) - [`chain_getBlock`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getblock) - [`chain_getBlockHash`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getblockhash) - [`chain_getFinalisedHead`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getfinalisedhead) - [`chain_getFinalizedHead`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getfinalizedhead) - [`chain_getHead`](/rpc-service/chains/chains-api/midnight/childstate/#chain_gethead) - [`chain_getHeader`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getheader) - [`chain_getRuntimeVersion`](/rpc-service/chains/chains-api/midnight/childstate/#chain_getruntimeversion) - [`state_call`](/rpc-service/chains/chains-api/midnight/childstate/#state_call) - [`state_callAt`](/rpc-service/chains/chains-api/midnight/childstate/#state_callat) - [`state_getChildReadProof`](/rpc-service/chains/chains-api/midnight/childstate/#state_getchildreadproof) - [`state_getKeys`](/rpc-service/chains/chains-api/midnight/childstate/#state_getkeys) - [`state_getKeysPaged`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getkeyspaged) - [`state_getKeysPagedAt`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getkeyspagedat) - [`state_getMetadata`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getmetadata) - [`state_getReadProof`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getreadproof) - [`state_getRuntimeVersion`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getruntimeversion) - [`state_getStorage`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstorage) - [`state_getStorageAt`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstorageat) - [`state_getStorageHash`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstoragehash) - [`state_getStorageHashAt`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstoragehashat) - [`state_getStorageSize`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstoragesize) - [`state_getStorageSizeAt`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_getstoragesizeat) - [`state_queryStorageAt`](/rpc-service/chains/chains-api/midnight/childstate-p2/#state_querystorageat) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/midnight/system-p2/ title: Midnight — system, account, grandpa, offchain, archive, midnight, sidechain, childstate (2/3) source: docs/rpc-service/chains/chains-api/midnight/system-p2.mdx --- # Midnight — system, account, grandpa, offchain, archive, midnight, sidechain, childstate (2/3) > API reference for [Midnight](/rpc-service/chains/chains-api/midnight/). [All methods ->](/rpc-service/chains/chains-api/midnight/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/midnight/system/) · 2 · [3](/rpc-service/chains/chains-api/midnight/system-p3/) ## `archive_unstable_header` > Fetches block header from archive. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (block hash): The hash of the block for which the header should be retrieved. ### Returns * ``: The block header object or null if the block hash does not exist. Typical block header fields include: * `parentHash` (string): The hash of the parent block. * `number` (string): The block number (in hex). * `stateRoot` (string): The root of the state trie after executing this block. * `extrinsicsRoot` (string): The root hash of the block’s extrinsics. * `digest` (object): Consensus-specific digest items, such as logs from BABE or GRANDPA. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "archive_unstable_header", "params": [ "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "parentHash": "0xdef456def456def456def456def456def456def456def456def456def456def4", "number": "0x0f0f0f", "stateRoot": "0xaaaabbbbccccddddeeeeffff1111222233334444555566667777888899990000", "extrinsicsRoot": "0xbbbbccccddddeeeeffff0000111122223333444455556666777788889999aaaa", "digest": { "logs": [ "0x0642414245fc" ] } } } ``` --- ## `archive_unstable_storage` > Returns historical storage values. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: The storage key to query (hex-encoded). 2. ``: The block hash at which to read the storage value. ### Returns * ``: * The hex-encoded SCALE-encoded value stored under the given key at the specified block. * null if the key does not exist or the block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "archive_unstable_storage", "params": [ "0x1a2b3c4d5e6f", // storage key "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x01020304" } ``` --- **Sidechain & Midnight-specific**: ## `midnight_apiVersions` > Lists supported API versions for the Midnight node. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `>`: A list of available API versions supported by the Midnight node. Each object typically contains: * `api` (string): The name of the RPC API (e.g., "chain", "state", "system"). * `version` (number): The supported version number for that API. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "midnight_apiVersions", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ 2 ] } ``` --- ## `midnight_contractState` > Fetches the on-chain state of a specific Midnight contract. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: The contract address whose state is being queried. 2. ``: The block hash at which to retrieve the contract state (optional depending on implementation; may use `latest` or be omitted for the latest state). ### Returns * ``: The current state of the specified contract, which may include: * `storage` (object): Key-value pairs of the contract’s storage slots (hex-encoded keys and values). * `metadata` (object, optional): Information about the contract (e.g., ABI hash, deployment block). * `null`: Returned if the contract does not exist or no state is available at the given block hash. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "midnight_contractState", "params": [ "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", // contract address "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "storage": { "0x0000": "0x01020304", "0x0001": "0x0a0b0c0d" }, "metadata": { "deployedAt": "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" } } } ``` --- ## `midnight_decodeEvents` > Decodes event data emitted by Midnight smart contracts. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: The block hash for which to decode events. 2. ``: The raw events data (hex-encoded SCALE-encoded bytes) typically obtained from chain storage (`system.events`). ### Returns * `>`: A list of decoded events from the specified block. Each event object typically includes: * `section` (string): The pallet/module name that emitted the event (e.g., `balances`). * `method` (string): The specific event name (e.g., `Transfer`). * `data` (array``): Event parameters, decoded according to the runtime metadata. * `topics` (array``, optional): Event topics, if applicable. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "midnight_decodeEvents", "params": [ "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1", // block hash "0x01020304aabbccdd" // raw events data ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "section": "balances", "method": "Transfer", "data": [ "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", "5FHneW46xGXgs5mUiveU4sbTyGBzmstT8dQ8x6b8S1uZxZ8M", 1000000000000 ] }, { "section": "system", "method": "ExtrinsicSuccess", "data": [] } ] } ``` --- ## `midnight_jsonBlock` > Returns a full block in a JSON format. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: The block hash of the block to retrieve in JSON format. ### Returns * ``: A JSON representation of the specified block, or null if the block does not exist. Typical fields include: * `block`: * `header`: Standard block header fields: * `parentHash` (string): The parent block hash. * `number` (string): Block number (in hex). * `stateRoot` (string): State trie root. * `extrinsicsRoot` (string): Extrinsics trie root. * `digest` (object): Consensus-specific digest logs. * `extrinsics`: (array``): List of extrinsics included in the block. * `justifications` (array, optional): GRANDPA justifications if present. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "midnight_jsonBlock", "params": [ "0x3cc34cd9d6a758999d66e977779b0d2f3bbeeb83fcd8dc8a361e7fe76905f0c6" ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "{\"header\":{\"parentHash\":\"0x62975104b79de4cb21a747c6edbd590fb4226eb51bcaa16e008b8528252731a7\",\"number\":\"0xf315b\",\"stateRoot\":\"0xd4962bed8eac446b29a3a5128bac1f0dc873355f1341e87120f2f4ee1ae67077\",\"extrinsicsRoot\":\"0x7e3b01b1f843be8994081418391ced306dd5e5cb03977bb292739b943942ef4c\",\"digest\":{\"logs\":[\"0x06617572612055426b1100000000\",\"0x066d63736880593d93a5de83054c0383f8e2e9e13209afb622807b8675b7d39b8a471d282bc6\",\"0x044d4e535610e02e0000\",\"0x056175726101012ca4b4d8924f801071b84d836cf248ee979b2c26021ff3f02123768fe20dd539701edf4a75062884f555b0894d23fd9a4b0333e6489cf23d496adb4d2a8e3480\"]}},\"body\":[{\"Timestamp\":1753452030000},\"UnknownTransaction\"],\"transactions_index\":[]}" } ``` --- ## `midnight_jsonContractState` > Returns human-readable JSON format of contract state. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: The contract address whose state should be retrieved. 2. ``: The block hash at which to query the state (optional in some implementations; if omitted, the latest state may be returned). ### Returns * ``: A JSON object encoded as a string representing the contract state or null if no state is available. The JSON string (when parsed) typically contains: * `storage`: Key-value pairs for the contract’s storage slots (hex-encoded). * `metadata`: Optional information about the contract such as ABI or deployment details. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "midnight_jsonContractState", "params": [ "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", // contract address "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "{\"storage\":{\"0x0000\":\"0x01020304\",\"0x0001\":\"0x0a0b0c0d\"},\"metadata\":{\"deployedAt\":\"0xabc123...\"}}" } ``` --- ## `midnight_zswapChainState` > Returns ZSwap contract state information. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: ZSwap contract address (hex-encoded). This must be a valid deployed ZSwap contract address. 2. `` (optional): Block hash at which to query the chain state. If omitted, defaults to the latest block. ### Returns * ``: A JSON object encoded as a string representing the ZSwap chain state, or null if no data is available. The decoded JSON string typically contains information such as: * `pools`: Active liquidity pools and their parameters. * `tokens`: Supported tokens and balances. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "midnight_zswapChainState", "params": [ "0x" ] }' ``` "]} /> ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "{\"pools\":[{\"id\":1,\"tokenA\":\"ZUSD\",\"tokenB\":\"ZBTC\",\"liquidity\":\"1000000000\"}],\"parameters\":{\"fee\":\"0.003\"}}" } ``` --- ## `sidechain_getAriadneParameters` > Gets Ariadne protocol parameters used for privacy. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (u32; required): Epoch ID (must be greater than or equal to the minimum supported epoch, which is usually 2 on testnet). ### Returns * ``: A set of Ariadne protocol parameters used by the Midnight sidechain. Typical fields may include (structure depends on the node implementation): * `epochLength` (number): Number of blocks per epoch. * `committeeSize` (number): Number of validators in the Ariadne committee. * `finalityThreshold` (number): Threshold required for finality (e.g., percentage or quorum count). * `otherParams` (object): Any additional Ariadne-specific configuration values. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sidechain_getAriadneParameters", "params": [] }' ``` ]\n }"} /> ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "epochLength": 100, "committeeSize": 21, "finalityThreshold": 15, "otherParams": { "rewardRate": "0.05", "slashRatio": "0.02" } } } ``` --- ## `sidechain_getEpochCommittee` > Returns the validator committee for the current or given epoch. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: The epoch number (u32) for which to retrieve the committee information. ### Returns * ``: Committee information for the specified epoch. Fields: * `sidechainEpoch` (number): The sidechain epoch number queried. * `committee` (array``): A list of committee members, where each object contains: ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sidechain_getEpochCommittee", "params": [ 243000 ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "sidechainEpoch": 243000, "committee": [ { "sidechainPubKey": "0x0203ae55458c8b9123b37a61ddd7f2a334ff35a80385825a2265eb490688cdebc5" }, { "sidechainPubKey": "0x0250159344a81b11aa21d9b4d2b5f24000682a95eb6564caccfe67b96ade9e202a" } ] } } ``` --- ## `sidechain_getParams` > Fetches current configuration parameters for the sidechain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: Sidechain parameters object. * `genesis_utxo` (string): Identifier of the genesis UTXO (Unspent Transaction Output) in the sidechain, including the transaction hash and output index (e.g., "46876a22...b11#0"). ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sidechain_getParams", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "genesis_utxo": "46876a2250ec0e523eccc30b0fc6d6fa55c61dd200b83140acaab291edeb0b11#0" } } ``` --- ## `sidechain_getStatus` > Returns current sidechain status including sync state and parameters. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: Contains the status of both the sidechain and the mainchain. Fields: * `sidechain` (object): Status information for the Midnight sidechain. * `epoch` (number): Current sidechain epoch number. * `slot` (number): Current sidechain slot number. * `nextEpochTimestamp` (number): UNIX timestamp (ms) for the start of the next sidechain epoch. * `mainchain` (object): Status information for the connected mainchain. * `epoch` (number): Current mainchain epoch number. * `slot` (number): Current mainchain slot number. * `nextEpochTimestamp` (number): UNIX timestamp (ms) for the start of the next mainchain epoch. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sidechain_getStatus", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "sidechain": { "epoch": 243570, "slot": 292285076, "nextEpochTimestamp": 1753711200000 }, "mainchain": { "epoch": 1007, "slot": 87054433, "nextEpochTimestamp": 1753747200000 } } } ``` --- **Child State Access**: ## `childstate_getKeys` > Returns the keys from child storage. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Child storage key (hex-encoded) identifying the child storage. 2. ``: Key prefix (hex-encoded) to filter keys. Use `0x` for all keys. 3. ``: Block hash at which to query state. If omitted, defaults to the latest block. ### Returns * `>`: An array of keys (hex-encoded) stored under the specified child storage, filtered by the provided key prefix. * `[]`: Returned if there are no keys matching the given prefix. * `null`: Returned if the child storage or block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "childstate_getKeys", "params": [ "0x1a2b3c4d5e6f", // child storage key "0x", // key prefix (empty to get all keys) "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Request example ```json { "jsonrpc": "2.0", "id": 1, "result": [ "0x1a2b3c4d5e6f0011", "0x1a2b3c4d5e6f0022", "0x1a2b3c4d5e6f0033" ] } ``` --- ## `childstate_getKeysPaged` > Returns paged keys from child storage. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Child storage key (hex-encoded) identifying the child storage. 2. ``: Key prefix (hex-encoded) to filter keys. Use "0x" for all keys. 3. ``: Count — the maximum number of keys to return. 4. ``: Start key (hex-encoded) for pagination. Use "0x" or omit to start from the beginning. 5. ``: Block hash at which to query state. If omitted, defaults to the latest block. ### Returns * `>`: A list of child storage keys (hex-encoded) matching the given prefix and pagination parameters. * `[]`: Returned if no keys match the given prefix or pagination window. * `null`: Returned if the child storage key or block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "childstate_getKeysPaged", "params": [ "0x1a2b3c4d5e6f", // child storage key "0x", // key prefix (empty = all keys) 10, // number of keys to return "0x", // start key for pagination (empty = start from first key) "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ "0x1a2b3c4d5e6f0011", "0x1a2b3c4d5e6f0022", "0x1a2b3c4d5e6f0033", "0x1a2b3c4d5e6f0044" ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/midnight/system-p3/ title: Midnight — system, account, grandpa, offchain, archive, midnight, sidechain, childstate (3/3) source: docs/rpc-service/chains/chains-api/midnight/system-p3.mdx --- # Midnight — system, account, grandpa, offchain, archive, midnight, sidechain, childstate (3/3) > API reference for [Midnight](/rpc-service/chains/chains-api/midnight/). [All methods ->](/rpc-service/chains/chains-api/midnight/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/midnight/system/) · [2](/rpc-service/chains/chains-api/midnight/system-p2/) · 3 ## `childstate_getKeysPagedAt` > Returns paged keys from a past block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Child storage key (hex-encoded) identifying the child storage. 2. ``: Key prefix (hex-encoded) to filter keys. Use "0x" to match all keys. 3. ``: Count — the maximum number of keys to return. 4. ``: Start key (hex-encoded) for pagination. Use "0x" or omit to start from the beginning. 5. `` (required): Block hash at which to query state. ### Returns * `>`: A list of child storage keys (hex-encoded) that match the given prefix, limited by pagination parameters, at the specified block. * `[]`: Returned if no keys match the prefix at the given block. * `null`: Returned if the child storage key or block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "childstate_getKeysPagedAt", "params": [ "0x1a2b3c4d5e6f", // child storage key "0x", // key prefix (empty = all keys) 10, // maximum number of keys to return "0x", // start key for pagination (empty = start from first key) "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ "0x1a2b3c4d5e6f0011", "0x1a2b3c4d5e6f0022", "0x1a2b3c4d5e6f0033" ] } ``` --- ## `childstate_getStorage` > Gets a storage entry from child storage. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Child storage key (hex-encoded) identifying the child storage. 2. ``: Storage key (hex-encoded) to fetch the value for. 3. ``: Block hash at which to query storage (optional; if omitted, uses the latest block). ### Returns * ``: * The hex-encoded SCALE-encoded value stored under the given key in the specified child storage at the given block hash. * `null` if no value exists for the key or if the storage key/block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "childstate_getStorage", "params": [ "0x1a2b3c4d5e6f", // child storage key "0x7f8e9d0c1b2a", // storage key to fetch "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x01020304" } ``` --- ## `childstate_getStorageEntries` > Gets multiple entries from child storage. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Child storage key (hex-encoded) identifying the child storage. 2. `>`: Storage keys (hex-encoded) for which values should be fetched. 3. `` (optional; if omitted, uses the latest block): Block hash at which to query storage. ### Returns * `>`: An array of hex-encoded SCALE-encoded values corresponding to the requested storage keys, in the same order as provided in the request. Each element is either: * A hex-encoded value (if the key exists). * `null` (if no value exists for that key). ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "childstate_getStorageEntries", "params": [ "0x1a2b3c4d5e6f", // child storage key [ "0x7f8e9d0c1b2a", // storage key 1 "0x1234567890ab" // storage key 2 ], "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ "0x01020304", null ] } ``` --- ## `childstate_getStorageHash` > Gets hash of a child storage value. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: Child storage key (hex-encoded) identifying the child storage. 2. ``: Storage key (hex-encoded) for which to retrieve the hash. 3. `` (optional; if omitted, uses the latest block): Block hash at which to query storage. ### Returns * ``: * A hex-encoded hash of the value stored under the specified key in the given child storage at the provided block hash. * `null` if no value exists for the key or if the storage key/block hash is invalid. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "childstate_getStorageHash", "params": [ "0x1a2b3c4d5e6f", // child storage key "0x7f8e9d0c1b2a", // storage key to hash "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7f8e9d0c1b2a4f00112233445566778899aabbccddeeff001122334455667788" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/midnight/system/ title: Midnight — system, account, grandpa, offchain, archive, midnight, sidechain, childstate (1/3) source: docs/rpc-service/chains/chains-api/midnight/system.mdx --- # Midnight — system, account, grandpa, offchain, archive, midnight, sidechain, childstate (1/3) > API reference for [Midnight](/rpc-service/chains/chains-api/midnight/). [All methods ->](/rpc-service/chains/chains-api/midnight/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/midnight/system-p2/) · [3](/rpc-service/chains/chains-api/midnight/system-p3/) ## `system_chain` > Returns the name of the chain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the name of the blockchain network the node is connected to. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "system_chain", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "testnet-02-1" } ``` --- ## `system_chainType` > Returns chain type (dev, local, live). ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: The type of chain the node is connected to. Common values include: * `Live`: A production network. * `Development`: A local development chain. * `Local`: A locally run chain or test instance. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_chainType", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "Live" } ``` --- ## `system_health` > Returns node health and sync status. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: A health status object describing the current state of the node. It contains the following fields: * `isSyncing` (boolean): Indicates whether the node is currently syncing with the network. * `peers` (integer): The number of peers the node is connected to. * `shouldHavePeers` (boolean): Indicates whether the node is expected to have peers (based on its configuration). * `networkState` (object, optional): Additional network diagnostics (included on some node types). ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_health", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "peers": 19, "isSyncing": false, "shouldHavePeers": true } } ``` --- ## `system_properties` > Returns chain properties (token decimals, etc). ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: A key-value object containing chain-specific properties. Common fields include: * `ss58Format` (integer): The default SS58 address format used by the chain. * `tokenDecimals` (array``): Number of decimal places used by each token on the chain. * `tokenSymbol` (array``): The symbols of the tokens used by the chain (e.g., ["DUST"] or ["ADA"]). * Additional implementation-specific properties may also be returned depending on the chain configuration. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_properties", "params": [] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "genesis_tx": "fe6a2c00040500e26a2c00303230343030303030303030303030343030303030303030303033383030303030303031356666353561343934666466653636626535353639393864396262663937313232623537313931386239623230636638313430626565393..." } } ``` --- ## `system_syncState` > Returns sync status and highest known block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: Synchronization status of the node, containing: * `startingBlock` (string): The block number at which the node started syncing. * `currentBlock` (string): The current block number the node has synced up to. * `highestBlock` (string): The highest known block number that the node is aware of. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_syncState", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": 657521, "currentBlock": 967344, "highestBlock": 967344 } } ``` --- ## `system_version` > Returns node implementation version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: The version of the node implementation, typically including: * The client name, * Semantic version number, and * Build metadata (if applicable). ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_version", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0.12.0-29935d2f" } ``` --- **Accounts & Keys**: ## `account_nextIndex` > Returns the next nonce for an account. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: The account address (SS58-encoded) for which to retrieve the next usable nonce. ### Returns * ``: The next valid transaction nonce for the given account, returned as a string representing an unsigned integer. This value is used when constructing a new extrinsic to ensure it has the correct transaction order. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "account_nextIndex", "params": [ "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" // example Base58 address ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "5" } ``` --- ## `system_accountNextIndex` > Alias to `account_nextIndex`. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: The account address (SS58-encoded) for which to retrieve the next usable nonce. ### Returns * ``: The next valid transaction nonce for the given account, returned as a string representing an unsigned integer. This value is used when constructing a new extrinsic to ensure it has the correct transaction order. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_accountNextIndex", "params": [ "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" // example Base58 address ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "5" } ``` --- **Grandpa Finality**: ## `grandpa_proveFinality` > Provides a justification proof for finalized blocks via Grandpa. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (block number or hash): The block identifier for which to generate a GRANDPA finality proof. Can be specified as a block number (hex or decimal) or a block hash (hex). ### Returns * ``: A GRANDPA finality proof object, which typically contains: * `block`: (string) The block hash that was proven finalized. * `justification`: (string) A hex-encoded GRANDPA justification, proving the finality of the block. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "grandpa_proveFinality", "params": [981031] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x315fed908a6b3ecdba9098b49b3d4e1df77a7c4ba1ed34669cdea91dfa98ad4aa91feb09000000000000315fed908a6b3ecdba9098b49b3d4e1df77a7c4ba1ed34669cdea91dfa98ad4a62f80e003c315fed908a6b3ecdba9098b49b3d4e1df77a7c4ba1ed34669cdea91df..." } ``` --- ## `grandpa_roundState` > Returns the current round state of the Grandpa finality mechanism. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: Information about the current GRANDPA finality round state. Common fields include: * `setId` (string): Identifier of the current GRANDPA authority set. * `best` (object): The best round known to the node, including round number and state. * `background` (array``): Other rounds running in the background with their states and details. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "grandpa_roundState", "params": [] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "setId": 852, "best": { "round": 1457, "totalWeight": 1200, "thresholdWeight": 801, "prevotes": { "currentWeight": 1149, "missing": [ "5C9FrTp4JJZZsAVScQVNhFaQTcxLNhmFW9r9mPDFLCbjK9BL", "5CAJk7RPtFHmRefs7dpuid9VHi5nG2so2pS4MsfDYQQ6Z3L5", "5CjZ1FWmxwkrLPysomPbXmKdMiwNqqofQgbxZER2TVMaLX7K", "5DCdVZpFv6uMvXZDgPjvq47crKS5abVFCUfmfgXYZs2Seu8W", "5DDKJxdjrMWL8AJF9xZmpjkseLVJCjTBqxFM15Kjndv2Bojr", "5Dc3F4sUqWn7ntf9tnrNgk6R528o59TsHrstgjohJDXtYN63", "5DrNYsps2JJH4wfrpfnSvmLV2ZoaCY4cCGKRNV36PdTBiFyK", "5DwjEBxvtJCjYVRjcNWiRE93a8Yr6g725iHHmBfUDjwqNef5", "5E2vguriAEWW2VZ8itKPw4LTcbHKA5LYm8TP65Ty7LncYp4K" ] } }, "background": [] } } ``` --- **Offchain Storage**: ## `offchain_localStorageGet` > Gets data from local offchain storage. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: The storage kind, which defines the namespace. Common kinds include: * `PERSISTENT`: Data that persists across restarts. * `LOCAL`: Data stored only in memory. 2. ``: The storage key to retrieve, typically hex-encoded or UTF-8 string depending on use case. ### Returns * ``: * A hex-encoded value stored under the provided key and storage kind, if it exists. * null if no value is associated with the given key. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "offchain_localStorageGet", "params": [ "PERSISTENT", // storage kind "0x1234567890abcdef" // key to retrieve ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x68656c6c6f" // hex-encoded value } ``` --- ## `offchain_localStorageSet` > Stores data in local offchain storage. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: The storage kind, which defines the namespace. Common kinds include: * `PERSISTENT`: Data that persists across restarts. * `LOCAL`: Data stored only in memory. 2. ``: The storage key to set, typically hex-encoded or UTF-8 string depending on use case. 3. ``: The storage value to store, hex-encoded. ### Returns * ``: * Returns null if the operation is successful. * Errors are returned if the node cannot write to offchain storage or if the method is restricted (common on public RPC endpoints). ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "offchain_localStorageSet", "params": [ "PERSISTENT", // storage kind "0x1234567890abcdef", // key to set "0x68656c6c6f" // value to store ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- **Archive & Unstable Chain Access**: ## `archive_unstable_body` > Fetches block body for historical blocks. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (block hash): The hash of the block whose body (list of extrinsics) should be retrieved. ### Returns * `>`: An array of hex-encoded extrinsics contained in the block body. * Each string is a SCALE-encoded extrinsic represented in hexadecimal. * If the block has no extrinsics, an empty array is returned. * `null`: Returned if the specified block hash does not exist or cannot be accessed. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "archive_unstable_body", "params": [ "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ "0x280403000b009cbe..." , "0x1c0200000500d2a4..." ] } ``` --- ## `archive_unstable_call` > Executes a runtime call at a specific block height. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: The name of the runtime function to call (e.g., `Balances_freeBalance`). 2. ``: A hex-encoded SCALE-encoded parameter payload for the runtime function (can be `0x` if no parameters). 3. ``: The block hash at which to execute the call. ### Returns * `` (hex): The hex-encoded SCALE-encoded result of the runtime function call executed at the specified block. * `null`: Returned if the block does not exist, the runtime function is unknown, or execution fails. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "archive_unstable_call", "params": [ "Balances_freeBalance", // runtime function to call "0x1cbd2d1b6d8a54b6208b1e5d5ba3f9a3", // SCALE-encoded params (mock data) "0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1" // block hash ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x00000000000000000000000000000064" } ``` --- ## `archive_unstable_finalizedHeight` > Returns the finalized block height. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: The height (block number) of the latest finalized block in the archive, returned as a string representing an unsigned integer. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "archive_unstable_finalizedHeight", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": 995341 } ``` --- ## `archive_unstable_genesisHash` > Returns the genesis hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: The hash of the genesis block of the chain, returned as a hex-encoded string. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "archive_unstable_genesisHash", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x2757396f0837b1c8f52d6c16887f0d4b39c9bca5462b774a86570fb82701040b" } ``` --- ## `archive_unstable_hashByHeight` > Returns the block hash at a specific height. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: The block height (number) for which to retrieve the block hash. ### Returns * ``: * A hex-encoded block hash corresponding to the specified block height if it exists. * `null` if no block is found at the given height or the archive does not have that block stored. ### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/YOUR_ANKR_API_KEY/ \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "archive_unstable_hashByHeight", "params": [ 981031 ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x87f5c08ba8334e4ee1642ff9646e94dd46080b71fff03714be8b36f22e481b95" ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/monad/ title: Monad description: Monad is an Ethereum-compatible Layer-1 blockchain with 10,000 tps of throughput, 500ms block frequency, and 1s… 22 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/monad/index.mdx --- # Monad
> Monad API is available on [Web3 API platform](https://www.ankr.com/rpc/monad). *Monad* is an Ethereum-compatible Layer-1 blockchain with 10,000 tps of throughput, 500ms block frequency, and 1s finality. Monad's implementation of the Ethereum Virtual Machine complies with the Cancun fork; simulation of historical Ethereum transactions with the Monad execution environment produces identical outcomes. Monad also offers full Ethereum RPC compatibility so that users can interact with Monad using familiar tools like Etherscan, Phantom, or MetaMask. Monad accomplishes these performance improvements, while preserving backward compatibility, through the introduction of several major innovations: * [MonadBFT](https://docs.monad.xyz/monad-arch/consensus/monad-bft) for performant, tail-fork-resistant BFT consensus. * [RaptorCast](https://docs.monad.xyz/monad-arch/consensus/raptorcast) for efficient block transmission. * [Asynchronous Execution](https://docs.monad.xyz/monad-arch/consensus/asynchronous-execution) for pipelining consensus and execution to raise the time budget for execution. * [Parallel Execution](https://docs.monad.xyz/monad-arch/execution/parallel-execution) for efficient transaction execution. * [MonadDb](https://docs.monad.xyz/monad-arch/execution/monaddb) for efficient state access. Although Monad features parallel execution and pipelining, it's important to note that blocks in Monad are linear, and transactions are linearly ordered within each block. In order for your Web3 application to interact with Monad — either by reading blockchain data or sending transactions to the network — it must connect to a Monad node. Developers interact with the blockchain using the methods provided by the API. Responses come in [JSON format](https://www.json.org/json-en.html). ## EVM JSON-RPC methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/monad/web3/#web3_clientversion) — returns the current client version. * [`net_version`](/rpc-service/chains/chains-api/monad/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/monad/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/monad/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_blockNumber`](/rpc-service/chains/chains-api/monad/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/monad/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/monad/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/monad/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/monad/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/monad/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getCode`](/rpc-service/chains/chains-api/monad/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/monad/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_sendRawTransactionSync`](/rpc-service/chains/chains-api/monad/web3/#eth_sendrawtransactionsync) — submits a transaction and retrieves the transaction receipt. * [`eth_call`](/rpc-service/chains/chains-api/monad/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/monad/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getLogs`](/rpc-service/chains/chains-api/monad/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/monad/web3/#web3_clientversion) - [`net_version`](/rpc-service/chains/chains-api/monad/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/monad/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/monad/web3/#eth_gasprice) - [`eth_blockNumber`](/rpc-service/chains/chains-api/monad/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/monad/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/monad/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/monad/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/monad/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/monad/web3/#eth_getblocktransactioncountbynumber) - [`eth_getCode`](/rpc-service/chains/chains-api/monad/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/monad/web3/#eth_sendrawtransaction) - [`eth_sendRawTransactionSync`](/rpc-service/chains/chains-api/monad/web3/#eth_sendrawtransactionsync) - [`eth_call`](/rpc-service/chains/chains-api/monad/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/monad/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/monad/web3-p3/#eth_gettransactionreceipt) - [`eth_getLogs`](/rpc-service/chains/chains-api/monad/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/monad/web3-p2/ title: Monad — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/monad/web3-p2.mdx --- # Monad — web3, net, eth (2/3) > API reference for [Monad](/rpc-service/chains/chains-api/monad/). [All methods ->](/rpc-service/chains/chains-api/monad/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/monad/web3/) · 2 · [3](/rpc-service/chains/chains-api/monad/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0x81e8eCac16f76fE98756259e302F142494A22C5d", "to": "0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701", "data": "0xa9059cbb000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf90000000000000000000000000000000000000000000000000000000000000064" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xcb8a" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "hash": "0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", "parentHash": "0x432918600eaecac6563fc82562459f44128cbc90676c816e8f4bada71955cc46", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x0000000000000000000000000000000000000000", "stateRoot": "0x50feda7fa205c63a74416eeb5fda2b7c36a558d3317106f98aa0cdac8d1fd663", "transactionsRoot": "0x300139c519ca999e89eeba9f048c7dd35036b548503b4b0a8ca2b93681946ba9", "receiptsRoot": "0x46202b74ec9a3f9f7774b8433999e5db121cac4604befa1136f1fcd0c3ed0a47", "logsBloom": "0x28e00280020a322826301020e1a3cc044133000001022400440801141604210ad52950300010e2400104cc2c440bc808479219802080021011098cd45922b000a400d8cee448248021022b4820820422201020a020e002891088a500b4002089200bc129820e040d0310005080040a2951c0540100248e80800720d579c012e08005442000230010da0d2020051443e8409150030303050a421055e9000000800200a00109887f17210ea224f0903a000f86000aee009c0010319098005408100a580302c0200211452588043c404008000d0110452ca0340310011654726a80e9508002a85c000e5850801ad2020020060e181e814902d03c068b028c652324", "difficulty": "0x0", "number": "0x190080d", "gasLimit": "0x8f0d180", "gasUsed": "0xec8f4d", "timestamp": "0x68751573", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "mixHash": "0xfa67ec9973406a1b394e9ea1415243d050147c3afa5040a07165d346c405137c", "nonce": "0x0000000000000000", "baseFeePerGas": "0xba43b7400", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0", "excessBlobGas": "0x0", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "totalDifficulty": "0x0", "size": "0x30f", "uncles": [], "transactions": [ "0x9dfaabd5db9878a38485f04b60f40afd806ae0d48b909dc68ba15afa246d2c31", "0xe73a70c55d0141a29f6fa7fb4a149dd745911328007a8c44ec13b64b9047eb85", "0xde7f797247cb175f21c1ad7b1a99777375be43f3f8c9a3f27ffc64ed94dd3bc0", "0x7fb3e67ee5a8d06a3d5e4534f601bbe060359af23ac57f1665aa16fb67a6caed", "0x478ce995ad60c3e7ab78fa551a84041b93f0ac7376e72cec8edec8b425ada228" ] }, "id": 1 } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x190080D", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "hash": "0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", "parentHash": "0x432918600eaecac6563fc82562459f44128cbc90676c816e8f4bada71955cc46", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x0000000000000000000000000000000000000000", "stateRoot": "0x50feda7fa205c63a74416eeb5fda2b7c36a558d3317106f98aa0cdac8d1fd663", "transactionsRoot": "0x300139c519ca999e89eeba9f048c7dd35036b548503b4b0a8ca2b93681946ba9", "receiptsRoot": "0x46202b74ec9a3f9f7774b8433999e5db121cac4604befa1136f1fcd0c3ed0a47", "logsBloom": "0x28e00280020a322826301020e1a3cc044133000001022400440801141604210ad52950300010e2400104cc2c440bc808479219802080021011098cd45922b000a400d8cee448248021022b4820820422201020a020e002891088a500b4002089200bc129820e040d0310005080040a2951c0540100248e80800720d579c012e08005442000230010da0d2020051443e8409150030303050a421055e9000000800200a00109887f17210ea224f0903a000f86000aee009c0010319098005408100a580302c0200211452588043c404008000d0110452ca0340310011654726a80e9508002a85c000e5850801ad2020020060e181e814902d03c068b028c652324", "difficulty": "0x0", "number": "0x190080d", "gasLimit": "0x8f0d180", "gasUsed": "0xec8f4d", "timestamp": "0x68751573", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", "mixHash": "0xfa67ec9973406a1b394e9ea1415243d050147c3afa5040a07165d346c405137c", "nonce": "0x0000000000000000", "baseFeePerGas": "0xba43b7400", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0", "excessBlobGas": "0x0", "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "totalDifficulty": "0x0", "size": "0x30f", "uncles": [], "transactions": [ "0x9dfaabd5db9878a38485f04b60f40afd806ae0d48b909dc68ba15afa246d2c31", "0xe73a70c55d0141a29f6fa7fb4a149dd745911328007a8c44ec13b64b9047eb85", "0xde7f797247cb175f21c1ad7b1a99777375be43f3f8c9a3f27ffc64ed94dd3bc0", "0x7fb3e67ee5a8d06a3d5e4534f601bbe060359af23ac57f1665aa16fb67a6caed", "0x478ce995ad60c3e7ab78fa551a84041b93f0ac7376e72cec8edec8b425ada228", "0x754e056a9b2db84395ee91a1e4424692dd81b12a970f6a79d294c3001b10f104" ] }, "id": 1 } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xcc01a75e90d618d3d0a812ec1ed09eaa5856e3055e4f07b41a3aa8dea5abb81d"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "type": "0x2", "chainId": "0x279f", "nonce": "0x34c1", "gas": "0x6dbd", "maxFeePerGas": "0xba43b7400", "maxPriorityFeePerGas": "0x77359400", "to": "0x760afe86e5de5fa0ee542fc7b7b713e1c5425701", "value": "0x3782dace9d90000", "accessList": [], "input": "0xd0e30db0", "r": "0xf11c526722460e917031d3595e718c3b0da0fac6f6efea56caaca28e13473994", "s": "0x2595fde3a0f076cedc7e64db4a35a6c1c2b530e8e356387ab12ab8b57bff0528", "yParity": "0x0", "v": "0x0", "hash": "0xcc01a75e90d618d3d0a812ec1ed09eaa5856e3055e4f07b41a3aa8dea5abb81d", "blockHash": "0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", "blockNumber": "0x190080d", "transactionIndex": "0x6e", "from": "0x81e8ecac16f76fe98756259e302f142494a22c5d", "gasPrice": "0xba43b7400" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", "0x0" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "type": "0x0", "nonce": "0x1c", "gasPrice": "0x174876e800", "gas": "0x5208", "to": "0x3ee9fca375a943f2057dfe1a4d94b0117cc179c9", "value": "0x2238ba914c0f3c3", "input": "0x", "r": "0x9b6329f293e46437b0b51daa88d02b85e39b2271a90a7ea919ec5627cd94c7f2", "s": "0x3ab12d66b7bcc17b59cc3b4e4d783a2ba9b0802d891e042a36d442b74954193e", "v": "0x1c", "hash": "0x9dfaabd5db9878a38485f04b60f40afd806ae0d48b909dc68ba15afa246d2c31", "blockHash": "0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", "blockNumber": "0x190080d", "transactionIndex": "0x0", "from": "0x4bebb8ff160a9cb2d966aa13949065b983dd96ed" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "type": "0x0", "chainId": "0x279f", "nonce": "0xa923", "gasPrice": "0x104c533c00", "gas": "0x61a80", "to": "0xaaf33b4c343003a5d48c126446799b7f2ba6410c", "value": "0x0", "input": "0x37946af700000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000365746800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000077365706f6c696100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a30786632326239373665613839393636323031376563393864336531623132393961646664383964663200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "r": "0x710f07d018c638e517ab44afe544de994838ad94f57f2b6d139e4b0880cf8136", "s": "0x62484a88d640f0740781cce827fbfa42b9d38569137e75d44dd15c04118ca116", "v": "0x4f61", "hash": "0xb02c8c0ec3a569fb2124ec3ac06c7cad61b8cf5eee5ba00e56fcf16535bc090b", "blockHash": "0x7d39925529599db9188762412639e7d11ae5c68b6a97130828e1543448a07a48", "blockNumber": "0x1901629", "transactionIndex": "0x0", "from": "0xf22b976ea899662017ec98d3e1b1299adfd89df2" }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/monad/web3-p3/ title: Monad — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/monad/web3-p3.mdx --- # Monad — web3, net, eth (3/3) > API reference for [Monad](/rpc-service/chains/chains-api/monad/). [All methods ->](/rpc-service/chains/chains-api/monad/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/monad/web3/) · [2](/rpc-service/chains/chains-api/monad/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3046af51d494bd8f0c1158440e3cf75980897aede6267aa82e9af67474725fe7"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "type": "0x2", "status": "0x1", "cumulativeGasUsed": "0xdf2eaf", "logs": [ { "address": "0x3a98250f98dd388c211206983453837c8365bdc1", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000088b96af200c8a9c35442c8ac6cd3d22695aae4f0", "0x000000000000000000000000882dd2862a4b22651be47ea63f233594173b12d8" ], "data": "0x00000000000000000000000000000000000000000000000029049483e6b9d6bd", "blockHash": "0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", "blockNumber": "0x190080d", "blockTimestamp": "0x68751573", "transactionHash": "0x3046af51d494bd8f0c1158440e3cf75980897aede6267aa82e9af67474725fe7", "transactionIndex": "0x64", "logIndex": "0x104", "removed": false }, { "address": "0x88b96af200c8a9c35442c8ac6cd3d22695aae4f0", "topics": [ "0x5d7a6c346454f5c536b7f52655e780f6db27b15b489f80f2dbb288c9e4f366bd", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000003a98250f98dd388c211206983453837c8365bdc1" ], "data": "0x0000000000000000000000000000000000000000000000000000000000008ca00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000029a2241af62c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffff5433e2b3d8211706e6102aa9471000000000000000000000000000000000000000000000000283f5b136909bd68000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000029a2241af62c0000ffffffffffffffffffffffffffffffffffffffffffffffffd6fb6b7c19462943", "blockHash": "0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", "blockNumber": "0x190080d", "blockTimestamp": "0x68751573", "transactionHash": "0x3046af51d494bd8f0c1158440e3cf75980897aede6267aa82e9af67474725fe7", "transactionIndex": "0x64", "logIndex": "0x105", "removed": false } ], "logsBloom": "0x00000000000000000000000000000004000000000000200000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000008000000020000000000000000100000000000000000000000020000000000000000000800000000000000000000040010000000000000000000000000000800000000000800000000000004000000000000000000000000000100000000000000000002000100000000001000000000000000000000000002000000000100000000000000000000000000000000000000000028000000000080000000000000000000000000000000000000000000000000000020", "transactionHash": "0x3046af51d494bd8f0c1158440e3cf75980897aede6267aa82e9af67474725fe7", "transactionIndex": "0x64", "blockHash": "0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", "blockNumber": "0x190080d", "gasUsed": "0x1986b", "effectiveGasPrice": "0xba43b7400", "from": "0x882dd2862a4b22651be47ea63f233594173b12d8", "to": "0x88b96af200c8a9c35442c8ac6cd3d22695aae4f0", "contractAddress": null }, "id": 1 } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "fromBlock": "0x190080D", "toBlock": "0x190080E" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": [ { "address": "0x760afe86e5de5fa0ee542fc7b7b713e1c5425701", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000008a02e49db7df0ef30adbd0d72341c2d1cba7a030", "0x0000000000000000000000008e9a1cad0685f1d9dcc869673169097eab45907e" ], "data": "0x000000000000000000000000000000000000000000000000016345785d8a0000", "blockHash": "0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", "blockNumber": "0x190080d", "blockTimestamp": "0x68751573", "transactionHash": "0xe73a70c55d0141a29f6fa7fb4a149dd745911328007a8c44ec13b64b9047eb85", "transactionIndex": "0x1", "logIndex": "0x0", "removed": false }, { "address": "0x88b8e2161dedc77ef4ab7585569d2415a1c1055d", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000008a02e49db7df0ef30adbd0d72341c2d1cba7a030", "0x0000000000000000000000008e9a1cad0685f1d9dcc869673169097eab45907e" ], "data": "0x00000000000000000000000000000000000000000000000000000000000336a3", "blockHash": "0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148", "blockNumber": "0x190080d", "blockTimestamp": "0x68751573", "transactionHash": "0xe73a70c55d0141a29f6fa7fb4a149dd745911328007a8c44ec13b64b9047eb85", "transactionIndex": "0x1", "logIndex": "0x1", "removed": false } ], "id": 1 } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/monad/web3/ title: Monad — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/monad/web3.mdx --- # Monad — web3, net, eth (1/3) > API reference for [Monad](/rpc-service/chains/chains-api/monad/). [All methods ->](/rpc-service/chains/chains-api/monad/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/monad/web3-p2/) · [3](/rpc-service/chains/chains-api/monad/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "Monad/v0.9.3" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "10143" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "Ok": false } } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xc1b710800" } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1900717" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x81e8eCac16f76fE98756259e302F142494A22C5d", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xeb116c84a722bf78" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x81e8eCac16f76fE98756259e302F142494A22C5d", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x81e8eCac16f76fE98756259e302F142494A22C5d", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x34c3" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xc1f2a7e6e0f976dd2afc85e8c7ea08d0a3d75eed4ebd8b3b99992424e1400148"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6f" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x190080D"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6f" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x532558Aa3514295CAd82edc3532532b7DD9818c2", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/monad/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_tx_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_sendRawTransactionSync` > Submits a transaction and retrieves the transaction receipt. Synchronous transaction submission; waits for transaction to be included in a block before returning. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data; required): the valid hex-encoded, RLP-encoded signed transaction. 2. `` (quantity; optional): maximum wait time in milliseconds. MUST be a positive integer not greater than the node-configured maximum timeout. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example (no timeout) ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransactionSync", "params": [ "0xf86c808504a817c80082520894ab... (signed tx hex)" ], "id": 1 }' ``` ### Request example (with timeout) ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransactionSync", "params": [ "0xf86c808504a817c80082520894ab... (signed tx hex)", 5000 ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "transactionHash": "0x1234abcd...", "blockHash": "0xabcd1234...", "blockNumber": "0x10d4f", "cumulativeGasUsed": "0x5208", "gasUsed": "0x5208", "contractAddress": null, "logs": [], "status": "0x1" } } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701", "data": "0x70a08231000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf9" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/moonbeam/eth/ title: Moonbeam — eth source: docs/rpc-service/chains/chains-api/moonbeam/eth.mdx --- # Moonbeam — eth > API reference for [Moonbeam](/rpc-service/chains/chains-api/moonbeam/). [All methods ->](/rpc-service/chains/chains-api/moonbeam/#methods) ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x65f5998c2b4dfe750e3ada38452d0764130c7d124b0eb3bb4b162d2d0dc32988"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "transactionHash": "0x65f5998c2b4dfe750e3ada38452d0764130c7d124b0eb3bb4b162d2d0dc32988", "transactionIndex": "0x0", "blockHash": "0x0a7cee7ed6c2e4b61bfd9d2d203a1d5a2cf2e9d6aac69e70846e60bd571f7682", "from": "0xb5ab290e152290b6bd5bdb04e23236d3f9d4aaec", "to": "0x091608f4e4a15335145be0a279483c0f8e4c7955", "blockNumber": "0x2c50cd", "cumulativeGasUsed": "0x24e86", "gasUsed": "0x24e86", "contractAddress": null, "logs": [ { "address": "0x091608f4e4a15335145be0a279483c0f8e4c7955", "topics": [ "0x4dec04e750ca11537cabcd8a9eab06494de08da3735bc8871cd41250e190bc04" ], "data": "0x00000000000000000000000000000000000000000008164a9abb652c7b8404cc00000000000000000000000000000000000000000000000008818747fc7b83880000000000000000000000000000000000000000000000000f181129ad8862f7000000000000000000000000000000000000000000090e5d18882d09241583ee", "blockHash": "0x0a7cee7ed6c2e4b61bfd9d2d203a1d5a2cf2e9d6aac69e70846e60bd571f7682", "blockNumber": "0x2c50cd", "transactionHash": "0x65f5998c2b4dfe750e3ada38452d0764130c7d124b0eb3bb4b162d2d0dc32988", "transactionIndex": "0x0", "logIndex": "0x0", "transactionLogIndex": "0x0", "removed": false }, { "address": "0x8e00d5e02e65a19337cdba98bba9f84d4186a180", "topics": [ "0xaccd035d02c456be35306aecd5a5fe62320713dde09ccd68b0a5e8ed93039999", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000091608f4e4a15335145be0a279483c0f8e4c7955", "0x000000000000000000000000b5ab290e152290b6bd5bdb04e23236d3f9d4aaec" ], "data": "0x0000000000000000000000000000000000000000000000066e8413a318711a50000000000000000000000000000777c6428a81cd960dfeb794ba38a446c3e87c", "blockHash": "0x0a7cee7ed6c2e4b61bfd9d2d203a1d5a2cf2e9d6aac69e70846e60bd571f7682", "blockNumber": "0x2c50cd", "transactionHash": "0x65f5998c2b4dfe750e3ada38452d0764130c7d124b0eb3bb4b162d2d0dc32988", "transactionIndex": "0x0", "logIndex": "0x1", "transactionLogIndex": "0x1", "removed": false }, { "address": "0x8e00d5e02e65a19337cdba98bba9f84d4186a180", "topics": [ "0xaccd035d02c456be35306aecd5a5fe62320713dde09ccd68b0a5e8ed93039999", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x000000000000000000000000091608f4e4a15335145be0a279483c0f8e4c7955", "0x000000000000000000000000b5ab290e152290b6bd5bdb04e23236d3f9d4aaec" ], "data": "0x0000000000000000000000000000000000000000000000000005570c57fa1d040000000000000000000000000000906310e9d79d7e34911d228df38dd1fef8a7", "blockHash": "0x0a7cee7ed6c2e4b61bfd9d2d203a1d5a2cf2e9d6aac69e70846e60bd571f7682", "blockNumber": "0x2c50cd", "transactionHash": "0x65f5998c2b4dfe750e3ada38452d0764130c7d124b0eb3bb4b162d2d0dc32988", "transactionIndex": "0x0", "logIndex": "0x2", "transactionLogIndex": "0x2", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000400000000000000001000000040000000000000000000000000000000000000000000000000000040000000000000000000000000008000000000000000000040000000000000000000000000008020000000000000000800800000000000008000000100018000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000080000000000000000000000000200100000000000000002000000000000000000020000000000000000000000000000000060000900000000000000000000040004000000200800000000000400000000000100", "status": "0x1", "effectiveGasPrice": "0x17a1df1700", "type": "0x2" }, "id": 1 } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x2B901D", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either a hex of the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/moonbeam/ title: Moonbeam description: Moonbeam is the most Ethereum compatible smart-contract parachain in the Polkadot ecosystem. 29 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/moonbeam/index.mdx --- # Moonbeam
> Moonbeam API is available on [Web3 API platform](https://www.ankr.com/rpc/moonbeam). *Moonbeam* is the most Ethereum compatible smart-contract parachain in the Polkadot ecosystem. It combines the best of both worlds: the familiar and easy-to-use tooling of Ethereum and the scalable, interoperable architecture of Polkadot. In order for your Web3 application to interact with Moonbeam — either by reading blockchain data or sending transactions to the network — it must connect to a Moonbeam node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/moonbeam/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/moonbeam/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/moonbeam/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/moonbeam/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_protocolversion`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_protocolversion) — returns the current Ethereum protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/moonbeam/web3-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/moonbeam/eth/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/moonbeam/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/moonbeam/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/moonbeam/eth/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/moonbeam/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/moonbeam/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/moonbeam/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/moonbeam/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/moonbeam/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/moonbeam/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/moonbeam/web3-p3/#eth_gettransactionbyblocknumberandindex) ### eth - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/moonbeam/eth/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/moonbeam/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/moonbeam/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/moonbeam/eth/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/moonbeam/web3-p2/ title: Moonbeam — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/moonbeam/web3-p2.mdx --- # Moonbeam — web3, net, eth (2/3) > API reference for [Moonbeam](/rpc-service/chains/chains-api/moonbeam/). [All methods ->](/rpc-service/chains/chains-api/moonbeam/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/moonbeam/web3/) · 2 · [3](/rpc-service/chains/chains-api/moonbeam/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":"0x07f327929A3A3131EB4BE83f784DBD3E5C2698f8"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xd05f" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x2", "extraData": "0xd98301090a846765746889676f312e31352e3133856c696e7578000000000000cd3659d2a7c1febcd74da24b3d174958c4513df03b3c98e0f078f05c8ab3ce03401c34d41dbd6a5bb5ac6e6f01ff77c7a15bac31ca9ba0a58a3887d39d24e57200", "gasLimit": "0x4190ab00", "gasUsed": "0x3b583", "hash": "0x818e66df719ac90ebe9d27b2385a96ea49dcdcf7c4fd4144fa9e90dcdb8355c7", "logsBloom": "0x00000000000000000000000000000002000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000008000001000000000000000000000020000000000000000000000000000010000000000000000000000000000000000000000000000000000000040000000000000020020000000000000000000000000000000000000002000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x48e302", "parentHash": "0x1c757a731055437ce12d809b883d9f5ef97742e9e371fa8743beddb6d37379ad", "receiptsRoot": "0x0b1315714349162d1cea1131d0561cdb8f35334d7421a2bd8274f0352fc62fe0", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3f2", "stateRoot": "0x875b793f2f7e9279bcadf6275fba2bacf3b29c6fbb406d51cb679a83ae6abc6c", "timestamp": "0x63eb7988", "totalDifficulty": "0x91c605", "transactions": [ "0x7798444af1b2deb8d7a28d95fd1f534fd8101e7f70df7c6d1884fb334f5b4f68" ], "transactionsRoot": "0xf037df20dfd0f08eedfb44e989fb680ae9b3157bbe2ed05b18413be26b8288df", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x2ACE9F", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "author": "0xabbed75d32f138e6b3366613dcd01a96e8b61b58", "baseFeePerGas": "0x174876e800", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0xe4e1c0", "gasUsed": "0xf68a5", "hash": "0x8ded0db069ae953824a0f4d44aab95dfb50f22185f4f20f821a12da466ea6db6", "logsBloom": "0x00000000000000400000000080000000000000100000000000000000010000000000040000000400000000000000000000000000040000000000000000040000000000000000000000000000000000000000000000040000000000048000002000000008000100000000000000800000000000000000000000100408000000100020000000000001000000000000000000002000000000000000100000000000100000000000000000000000000000000000000000002002000202004000000000010000000000000000800000000000000000000000000400000000101040000900040000000000000000000004000000000c00000000000400000000000100", "miner": "0xabbed75d32f138e6b3366613dcd01a96e8b61b58", "nonce": "0x0000000000000000", "number": "0x2ace9f", "parentHash": "0xb375a1790fadcff4af5da540a95210df5e0be72d2d06748d7ebd80c5d5fc14ca", "receiptsRoot": "0xab3686340e847e2dce85f4e62cc29d591734f516c3a49477792aade09afadace", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x2bf", "stateRoot": "0xd48e447e300b061a13cd3705ecc7e4d228b2d65f351a44a3bde4b87b72332516", "timestamp": "0x63d10d84", "totalDifficulty": "0x0", "transactions": [ "0x7e03d44231617caf7a2c58df865129250dd1b6ed7215a28514a4bc4e496eeb00" ], "transactionsRoot": "0xe29256a605f5bc23815073a9c6fe24a2b0859b1083dc359286cf9f8275b07d1e", "uncles": [] }, "id": 1 } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x0d2fbde2c076f2661e2fd042f0aee61761b8de1f388a251f766107ca6605261c"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "hash": "0x0d2fbde2c076f2661e2fd042f0aee61761b8de1f388a251f766107ca6605261c", "nonce": "0x125", "blockHash": "0xc746790f2ae290d8b78bd897dfe287328d12e80bd7d47bf9faf886e562140c83", "blockNumber": "0x299cbb", "transactionIndex": "0xc", "from": "0xb5ab290e152290b6bd5bdb04e23236d3f9d4aaec", "to": "0xd22da948c0ab3a27f5570b604f3adef5f68211c3", "value": "0x0", "gasPrice": "0x174876e800", "maxFeePerGas": "0x174876e800", "maxPriorityFeePerGas": "0x174876e800", "gas": "0x52ab8", "input": "0x0e75270200000000000000000000000000000000000000000000000000000af0f466497b", "creates": null, "raw": "0x02f89582050482012585174876e80085174876e80083052ab894d22da948c0ab3a27f5570b604f3adef5f68211c380a40e75270200000000000000000000000000000000000000000000000000000af0f466497bc080a0bd1f4c3507c8788e26b778843584c1f31d6c30387eaa936503dd1bd635cc0fa9a05fbd3f2ea34611d29f8b0ab0eb10c70db875a14a760685282964d7451fc0965e", "publicKey": "0x3c36cda066dd905dcbc7ebae005086f11781133a9e5190399e3746d2a374fc1281675280299b80ca72510172bce424025acb0cd6c3cd670c5e8717bc4e510a9c", "chainId": "0x504", "standardV": "0x0", "v": "0x0", "r": "0xbd1f4c3507c8788e26b778843584c1f31d6c30387eaa936503dd1bd635cc0fa9", "s": "0x5fbd3f2ea34611d29f8b0ab0eb10c70db875a14a760685282964d7451fc0965e", "accessList": [], "type": "0x2" }, "id": 1 } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b", "blockNumber": "0xc4fa88", "from": "0x4e0c43c30964b80c37df90d229e668823b6f36b6", "gas": "0x34ed8", "gasPrice": "0x6c088e200", "hash": "0xd0f7b79f2b38a5e8303ff523da621d6cb04a18e722d6cc0bcce75309cd804b2e", "input": "0x38ed1739000000000000000000000000000000000000000000000012f211da6a00e70ccd0000000000000000000000000000000000000000000000059ddf43d23461577600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e0c43c30964b80c37df90d229e668823b6f36b600000000000000000000000000000000000000000000000000000000610039cb00000000000000000000000000000000000000000000000000000000000000030000000000000000000000007d1afa7b718fb893db30a3abc0cfc608aacfebb0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9", "nonce": "0x26", "to": "0x03f7724180aa6b939894b5ca4314783b0b36b329", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x1", "v": "0x25", "r": "0x43284f337fce4ab4225dd123935934ebd12067440d8a2a05ac297c2d0f62d8ab", "s": "0x3827daa345b9b30ecef4df256a72059ca04106dee07a6a97ba5b4b719550cde3" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/moonbeam/web3-p3/ title: Moonbeam — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/moonbeam/web3-p3.mdx --- # Moonbeam — web3, net, eth (3/3) > API reference for [Moonbeam](/rpc-service/chains/chains-api/moonbeam/). [All methods ->](/rpc-service/chains/chains-api/moonbeam/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/moonbeam/web3/) · [2](/rpc-service/chains/chains-api/moonbeam/web3-p2/) · 3 ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "hash": "0x9fd03a114da6284f49be54dbc34469c28df49207b7e6bdda7515eba38de4ca6c", "nonce": "0xb", "blockHash": "0x24539d0939cd6cefb81558bd01c94ddc3727abc17230c4af679727bd772ded2c", "blockNumber": "0x2d1244", "transactionIndex": "0x0", "from": "0x7d101a07717730043e10a29253c1d5033328f5d8", "to": "0xff6dd348e6eecea2d81d4194b60c5157cd9e64f4", "value": "0x0", "gasPrice": "0x17dd79e100", "maxFeePerGas": "0x2f25f0c900", "maxPriorityFeePerGas": "0x9502f900", "gas": "0x31131", "input": "0x0b4c7e4d00000000000000000000000000000000000000000000010f0cf064dd59200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010f4e239e62856d28df", "creates": null, "raw": "0x02f8d38205040b849502f900852f25f0c9008303113194ff6dd348e6eecea2d81d4194b60c5157cd9e64f480b8640b4c7e4d00000000000000000000000000000000000000000000010f0cf064dd59200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010f4e239e62856d28dfc080a0604476c14d2be646425e347b2ceff9d44c766a65d7cf6287baaafd8b2af06448a019d715d3d403bfd3124edab226a238a3b84ab0b38be883da68c47d37d6861145", "publicKey": "0xcf6c5030a3513bbcc7ac29d9050ab282e9ee32856738878d62d64f7fa55a120c66d605c7500af29378749c2d30464270308cdc2a3b7343f04460800d67776d08", "chainId": "0x504", "standardV": "0x0", "v": "0x0", "r": "0x604476c14d2be646425e347b2ceff9d44c766a65d7cf6287baaafd8b2af06448", "s": "0x19d715d3d403bfd3124edab226a238a3b84ab0b38be883da68c47d37d6861145", "accessList": [], "type": "0x2" }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/moonbeam/web3/ title: Moonbeam — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/moonbeam/web3.mdx --- # Moonbeam — web3, net, eth (1/3) > API reference for [Moonbeam](/rpc-service/chains/chains-api/moonbeam/). [All methods ->](/rpc-service/chains/chains-api/moonbeam/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/moonbeam/web3-p2/) · [3](/rpc-service/chains/chains-api/moonbeam/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "moonbeam/v2000.0/fc-rpc-2.0.0-dev", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1284" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "1", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x174876e800" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2d1189" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x323B69eaAa302B940f4cAFA9FB8684016959600f", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x158ab28842d51ca0a" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x89Cf1fd98A6EE78bf76B6C0415c185Ec2c5a88f1", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xdae6" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x602b2568b709f2cee3772e1e0f3ede0db80aae312e6c9ed8677d83a4c08a5d50"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x2D11E1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xbea96809efba35a04aaa912dbe9f5f79ce45a557ddff56806f20acc17a1f5c4b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x2D11DF"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xb1398c4D958B97c181Df60148678f04eCEc62c69", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/moonbeam/eth/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/movement/accounts-p2/ title: Movement — Accounts, Blocks, Events, General, Table, Transactions (2/2) source: docs/rpc-service/chains/chains-api/movement/accounts-p2.mdx --- # Movement — Accounts, Blocks, Events, General, Table, Transactions (2/2) > API reference for [Movement](/rpc-service/chains/chains-api/movement/). [All methods ->](/rpc-service/chains/chains-api/movement/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/movement/accounts/) · 2 ## Transactions ### Get transactions > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/transactions`** Retrieves on-chain committed transactions. The page size and start ledger version can be provided to get a specific sequence of transactions. If the version has been pruned, then a 410 will be returned. To retrieve a pending transaction, use [Get transactions by hash](#get-transaction-by-hash). #### Parameters * `limit` (integer; query): max number of events to retrieve. If unspecified, defaults to default page size. * `start` (string; uint64; query): a ledger version to start th list of transactions. If not provided, defaults to showing the latest transactions
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/transactions \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ] ``` --- ### Submit transaction > **POST `https://rpc.ankr.com/http/movement_mainnet/v1/transactions`** This endpoint accepts transaction submissions in two formats. To submit a transaction as JSON, you must create a SubmitTransactionRequest. To build this request, do the following: 1. Encode the transaction as BCS. If you are using a language that has 2. Sign the encoded transaction and use it to create a TransactionSignature. 3. Submit the request. Make sure to use the "application/json" Content-Type. To submit a transaction as BCS, you must submit a SignedTransaction encoded as BCS. Make sure to use the `application/x.aptos.signed_transaction+bcs` Content-Type. #### Parameters Request is an `application/json` body with the following parameters: * `sender` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `sequence_number` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `max_gas_amount` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `gas_unit_price` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `expiration_timestamp_secs` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `payload` (object; required): a payload is one of the following objects: 1. A payload which runs a single entry function: * `type` (string; required): a payload type. Example: `entry_function_payload`. * `function` (string; required): an entry function ID is a string representation of an entry function defined on-chain.
Format: `{address}::{module name}::{function name}`
Both `module name` and `function name` are case-sensitive.
Example: `0x1::aptos_coin::transfer` * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 2. A payload which runs a script that can run multiple functions: * `type` (string; required): a payload type. Example: `script_payload`. * `code` (object; required): a Move script bytecode: * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move function: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]: required): a return type of the function. * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 3. An enum of possible transaction payloads: * `type` (string; required): a payload type. Example: `module_bundle_payload`. * `modules` (array[object]; required): * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move module: * `address` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `name` (string; required): a name of the module. * `friends` (array[string]: required): friends of the module. * `exposed_functions` (array[object]; required): public functions of the module: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]; required): a return type of the function. * `structs` (array[object]; required): structs of the module: * `name` (string; required): a name of the struct. * `is_native` (boolean; required): whether the struct is a native struct of Move. * `abilities` (array[string]; required): abilities associated with the struct. * `generic_type_params` (array[object]; required): generic types associated with the struct: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the type that uses it. * `fields` (array[object]; required): fields associated with the struct: * `name` (string; required): a name of the field. * `type` (string; required): a string representation of an on-chain Move type tag that is exposed in transaction payload.
Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` ``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match pattern: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `signature` (object; required): a signature is one of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a signature type. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 3. A multi-agent signature for multi-agent transactions (allows you to have transactions across multiple accounts): * `type` (string; required): a type of signature. Example: `multi_agent_signature`. * `sender` (object; required): a sender is on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of sender signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of sender signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `secondary_signer_addresses` (array[string]; hex; required): the other involved parties' addresses. * `secondary_signers` (array of objects): an array of on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of secondary signers' signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of secondary signers' signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/movement_mainnet/v1/transactions \ -H 'Content-Type: application/json' -d '{ "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } }' ``` #### Response example ```json { "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ``` --- ### Get transaction by hash > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/transactions/by_hash/{txn_hash}`** Retrieves a transaction by its hash. This is the same hash that is returned by the API when submitting a transaction (see PendingTransaction). When given a transaction hash, the server first looks for the transaction in storage (on-chain, committed). If no on-chain transaction is found, it looks the transaction up by hash in the mempool (pending, not yet committed). To create a transaction hash by yourself, do the following: 1. Hash message bytes: "RawTransaction" bytes + BCS bytes of Transaction. 2. Apply hash algorithm `SHA3-256` to the hash message bytes. 3. Hex-encode the hash bytes with `0x` prefix. #### Parameters * `txn_hash` (string; path; required): a hash of the transaction to retrieve. #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/transactions/by_hash/{txn_hash} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ``` --- ### Get transaction by version > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/transactions/by_version/{txn_version}`** Retrieves a transaction by a given version. If the version has been pruned, a 410 will be returned. #### Parameters * `txn_version` (string; uint64; path; required): a version of the transaction to retrieve.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/transactions/by_version/{txn_version} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ``` --- ### Get account transactions > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/transactions`** Retrieves on-chain committed transactions from an account. If the start version is too far in the past, a 410 will be returned. If no start version is given, it will start at version 0. To retrieve a pending transaction, use [Get transaction by hash](#get-transaction-by-hash). #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `limit` (integer; query): a max number of transactions to retrieve. If not provided, retrieves a default page size. * `start` (string; uint64; query): a ledger version to start the list of transactions. If not provided, defaults to showing the latest transactions.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/transactions \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ] ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/movement/accounts/ title: Movement — Accounts, Blocks, Events, General, Table, Transactions (1/2) source: docs/rpc-service/chains/chains-api/movement/accounts.mdx --- # Movement — Accounts, Blocks, Events, General, Table, Transactions (1/2) > API reference for [Movement](/rpc-service/chains/chains-api/movement/). [All methods ->](/rpc-service/chains/chains-api/movement/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/movement/accounts-p2/) ## Accounts ### Get account > **GET `https://rpc.ankr.com/http/movement/v1/accounts/{address}`** Returns the authentication key and the sequence number for an account address. Optionally, a ledger version can be specified. If the ledger version is not specified in the request, the latest ledger version is used. #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x3f7399a0d3d646ce94ee0badf16c4c3f3c656fe3a5e142e83b5ebc011aa8b3d` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "sequence_number": "32425224034", "authentication_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } ``` --- ### Get account resources > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/resources`** Retrieves all account resources for a given account and a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` * `limit` (integer; query): max number of account resources to retrieve. If not provided, retrieves a default page size. * `start` (string; query): cursor specifying where to start for pagination. This cursor cannot be derived manually client-side. Instead, you must call this endpoint once without this query parameter specified, and then use the cursor returned in the X-Aptos-Cursor header in the response.
Example: `0000000000000000000000000000000000000000000000000000000000000000012f0000000000000000000000000000000000000000000000000000000000000000010d7374616b696e675f70726f7879 ` #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/resources \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "type": "0x3f7399a0d3d646ce94ee0badf16c4c3f3c656fe3a5e142e83b5ebc011aa8b3d::config::Config", "data": { "admin": "0x87ab5cab89cefa79e603c8ff4ff9f3faa77e3bc27f2a70286daa4d38d266eb61", "resource_account_signer_cap": { "account": "0xc99a3bac50201a8fabafb40fbedc79da2c4318019213bde6a2650358421a4125" } } }, { "type": "0x1::account::Account", "data": { "authentication_key": "0x03f7399a0d3d646ce94ee0badf16c4c3f3c656fe3a5e142e83b5ebc011aa8b3d", "coin_register_events": { "counter": "1", "guid": { "id": { "addr": "0x3f7399a0d3d646ce94ee0badf16c4c3f3c656fe3a5e142e83b5ebc011aa8b3d", "creation_num": "0" } } }, "guid_creation_num": "4", "key_rotation_events": { "counter": "0", "guid": { "id": { "addr": "0x3f7399a0d3d646ce94ee0badf16c4c3f3c656fe3a5e142e83b5ebc011aa8b3d", "creation_num": "1" } } }, "rotation_capability_offer": { "for": { "vec": [] } }, "sequence_number": "0", "signer_capability_offer": { "for": { "vec": [] } } } } ] ``` --- ### Get account modules > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/modules`** Retrieves all account modules' bytecode for a given account at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` * `limit` (integer; query): max number of account resources to retrieve. If not provided, retrieves a default page size. * `start` (string; query): cursor specifying where to start for pagination. This cursor cannot be derived manually client-side. Instead, you must call this endpoint once without this query parameter specified, and then use the cursor returned in the X-Aptos-Cursor header in the response.
Example: `0000000000000000000000000000000000000000000000000000000000000000012f0000000000000000000000000000000000000000000000000000000000000000010d7374616b696e675f70726f7879 ` #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/accounts/0x3f7399a0d3d646ce94ee0badf16c4c3f3c656fe3a5e142e83b5ebc011aa8b3d/modules \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "bytecode": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "abi": { "address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "name": "string", "friends": [ "0x1::aptos_coin" ], "exposed_functions": [ { "name": "string", "visibility": "private", "is_entry": true, "generic_type_params": [ { "constraints": [ "string" ] } ], "params": [ "string" ], "return": [ "string" ] } ], "structs": [ { "name": "string", "is_native": true, "abilities": [ "string" ], "generic_type_params": [ { "constraints": [ "string" ] } ], "fields": [ { "name": "string", "type": "string" } ] } ] } } ] ``` --- ### Get account resource > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/resource/{resource_type}`** Retrieves an individual resource from a given account and at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `resource_type` (string; path; required) a name of struct to retrieve.
Example: `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>`
Match pattern: `^0x[0-9a-zA-Z:_<>]+$` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/resource/{resource_type} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>", "data": { "authentication_key": "0x0000000000000000000000000000000000000000000000000000000000000001", "coin_register_events": { "counter": "0", "guid": { "id": { "addr": "0x1", "creation_num": "0" } } }, "self_address": "0x1", "sequence_number": "0" } } ``` --- ### Get account module > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/module/{module_name}`** Retrieves an individual module from a given account and at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `address` (string; hex; path; required): an address of account with or without a `0x` prefix.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `module_name` (string; path; required): a name of module to retrieve (example: `coin`). * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/module/{module_name} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "bytecode": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "abi": { "address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "name": "string", "friends": [ "0x1::aptos_coin" ], "exposed_functions": [ { "name": "string", "visibility": "private", "is_entry": true, "generic_type_params": [ { "constraints": [ "string" ] } ], "params": [ "string" ], "return": [ "string" ] } ], "structs": [ { "name": "string", "is_native": true, "abilities": [ "string" ], "generic_type_params": [ { "constraints": [ "string" ] } ], "fields": [ { "name": "string", "type": "string" } ] } ] } } ``` --- ## Blocks ### Get blocks by height > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/blocks/by_height/{block_height}`** This endpoint allows you to get the transactions in a block and the corresponding block information. Transactions are limited by max default transactions size. If not all transactions are present, the user will need to query for the rest of the transactions via the get transactions API. If the block is pruned, it will return a 410 #### Parameters * `block_height` (integer; path; required): a block height to look up. Starts at 0. * `with_transactions` (boolean; query): if set to true, includes all transactions in the block. If not provided, no transactions will be retrieved. #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/blocks/by_height/{block_height} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "block_height": "32425224034", "block_hash": "string", "block_timestamp": "32425224034", "first_version": "32425224034", "last_version": "32425224034", "transactions": [ { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ] } ``` --- ### Get blocks by version > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/blocks/by_version/{version}`** This endpoint allows you to get the transactions in a block and the corresponding block information given a version in the block. Transactions are limited by max default transactions size. If not all transactions are present, the user will need to query for the rest of the transactions via the get transactions API. If the block has been pruned, it will return a 410 #### Parameters * `version` (integer; path; required): a ledger version to look up block information for. * `with_transactions` (boolean; query): if set to true, includes all transactions in the block. If not provided, no transactions will be retrieved. #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/blocks/by_version/{version} \ -H 'Content-Type: application/json' ``` #### Response example ```json { "block_height": "32425224034", "block_hash": "string", "block_timestamp": "32425224034", "first_version": "32425224034", "last_version": "32425224034", "transactions": [ { "type": "pending_transaction", "hash": "string", "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ] } ``` --- ## Events ### Get events by creation number > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/events/{creation_number}`** Event types are globally identifiable by an account `address` and monotonically increasing `creation_number`, one per event type emitted to the given account. This API returns events corresponding to that that event type. #### Parameters * `address` (string; hex; path; required): a hex-encoded 32 byte Aptos account, with or without a `0x` prefix, for which events are queried. This refers to the account that events were emitted to, not the account hosting the move module that emits that event type.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `creation_number` (string; uint64; path; required): a creation number corresponding to the event stream originating from the given account. * `limit` (integer; query): max number of events to retrieve. If unspecified, defaults to default page size. * `start` (string; uint64; query): the starting sequence number of events. If unspecified, by default will retrieve the most recent events.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/events/{creation_number} \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "version": "32425224034", "guid": { "creation_number": "32425224034", "account_address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " }, "sequence_number": "32425224034", "type": "string", "data": null } ] ``` --- ### Get events by event handle > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/events/{event_handle}/{field_name}`** This API uses the given account `address`, `eventHandle`, and `fieldName` to build a key that can globally identify an event types. It then uses this key to return events emitted to the given account matching that event type. #### Parameters * `address` (string; hex; path; required): a hex-encoded 32 byte Aptos account, with or without a `0x` prefix, for which events are queried. This refers to the account that events were emitted to, not the account hosting the move module that emits that event type.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `event_handle` (string; path; required): a name of struct to look up event handle.
Example: `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>`
Match pattern: `^0x[0-9a-zA-Z:_<>]+$` * `field_name` (string; path; required): a name of field to look up event handle (example: `withdraw_events`). * `limit` (integer; query): max number of events to retrieve. If unspecified, defaults to default page size. * `start` (string; uint64; query): the starting sequence number of events. If unspecified, by default will retrieve the most recent events.
Example: `32425224034` #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/accounts/{address}/events/{event_handle}/{field_name} \ -H 'Content-Type: application/json' ``` #### Response example ```json [ { "version": "32425224034", "guid": { "creation_number": "32425224034", "account_address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " }, "sequence_number": "32425224034", "type": "string", "data": null } ] ``` --- ## General ### Get ledger info > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/`** Retrieves the latest ledger information, including data such as chain ID, role type, ledger versions, epoch, etc. #### Parameters None. #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/ \ -H 'Content-Type: application/json' ``` #### Response example ```json { "chain_id": 0, "epoch": "32425224034", "ledger_version": "32425224034", "oldest_ledger_version": "32425224034", "ledger_timestamp": "32425224034", "node_role": "validator", "oldest_block_height": "32425224034", "block_height": "32425224034", "git_hash": "string" } ``` --- ## Table ### Get table item > **POST `https://rpc.ankr.com/http/movement_mainnet/v1/tables/{table_handle}/item`** Get a table item at a specific ledger version from the table identified by `{table_handle}` in the path and the "key" (TableItemRequest) provided in the request body. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `table_handle` (string; hex; path; required): a table handle hex encoded 32-byte string.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` * `key_type` (string; body; required): a string representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>`
``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match patterns: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `value_type` (string; body; required): a string representation of an on-chain Move type tag that is exposed in transaction payload. Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>`
``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match pattern: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `key` (body; required): the value of the table item's key. #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/movement_mainnet/v1/tables/{table_handle}/item \ -H 'Content-Type: application/json' \ -d '{ "key_type": "string", "value_type": "string", "key": null }' ``` #### Response example ```json 0 ``` --- ### Get raw table item > **POST `https://rpc.ankr.com/http/movement_mainnet/v1/tables/{table_handle}/raw_item`** Get a table item at a specific ledger version from the table identified by `{table_handle}` in the path and the "key" (RawTableItemRequest) provided in the request body. The `get_raw_table_item` requires only a serialized key comparing to the full move type information comparing to the `get_table_item` api, and can only return the query in the bcs format. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `table_handle` (string; hex; path; required): a table handle hex encoded 32-byte string.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` * `key` (string; hex; body; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/movement_mainnet/v1/tables/{table_handle}/item \ -H 'Content-Type: application/json' \ -d '{ "key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " }' ``` #### Response example ```json 0 ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/movement/ title: Movement description: Movement Mainnet is a general-purpose Layer 2 built by Movement Labs to scale Ethereum applications and… Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/movement/index.mdx --- # Movement
> Movement API is available on [Web3 API platform](https://www.ankr.com/rpc/movement). Movement Mainnet is a general-purpose Layer 2 built by Movement Labs to scale Ethereum applications and introduce the Move Virtual Machine (MoveVM) to a broader ecosystem. It features dual execution, fast settlement, and decentralized sequencing for high performance and interoperability. In order for your Web3 application to interact with the Movement blockchain — either by reading blockchain data or sending transactions to the network — it must connect to a Movement node. Developers interact with the blockchain using the methods provided by the API. Movement API uses the REST interface for querying, responses come in [JSON format](https://www.json.org/json-en.html). ## Methods supported **Accounts**: * [Get account](/rpc-service/chains/chains-api/movement/accounts/#get-account) — retrieves the authentication key and the sequence number for an account address. * [Get account resources](/rpc-service/chains/chains-api/movement/accounts/#get-account-resources) — retrieves all account resources for a given account and a specific ledger version. * [Get account modules](/rpc-service/chains/chains-api/movement/accounts/#get-account-modules) — retrieves all account modules' bytecode for a given account at a specific ledger version. * [Get account resource](/rpc-service/chains/chains-api/movement/accounts/#get-account-resource) — retrieves an individual resource from a given account and at a specific ledger version. * [Get account module](/rpc-service/chains/chains-api/movement/accounts/#get-account-module) — retrieves an individual module from a given account and at a specific ledger version. **Blocks**: * [Get blocks by height](/rpc-service/chains/chains-api/movement/accounts/#get-blocks-by-height) — retrieves the transactions in a block and the corresponding block information. * [Get blocks by version](/rpc-service/chains/chains-api/movement/accounts/#get-blocks-by-version) — retrieves the transactions in a block and the corresponding block information by version in the block. **Events**: * [Get events by creation number](/rpc-service/chains/chains-api/movement/accounts/#get-events-by-creation-number) — retrieves events by creation number. * [Get events by event handle](/rpc-service/chains/chains-api/movement/accounts/#get-events-by-event-handle) — retrieves events by event handle. **General**: * [Get ledger info](/rpc-service/chains/chains-api/movement/accounts/#get-ledger-info) — retrieves the latest ledger information. **Table**: * [Get table item](/rpc-service/chains/chains-api/movement/accounts/#get-table-item) — retrieves a table item. * [Get raw table item](/rpc-service/chains/chains-api/movement/accounts/#get-raw-table-item) — retrieves a raw table item. **Transactions**: * [Get transactions](/rpc-service/chains/chains-api/movement/accounts-p2/#get-transactions) — retrieves on-chain committed transactions. * [Submit transaction](/rpc-service/chains/chains-api/movement/accounts-p2/#submit-transaction) — submits a transaction in JSON or BCS. * [Get transaction by hash](/rpc-service/chains/chains-api/movement/accounts-p2/#get-transaction-by-hash) — retrieves a transaction by its hash. * [Get transaction by version](/rpc-service/chains/chains-api/movement/accounts-p2/#get-transaction-by-version) — retrieves a transaction by a given version. * [Get account transactions](/rpc-service/chains/chains-api/movement/accounts-p2/#get-account-transactions) — retrieves on-chain committed transactions from an account. * [Submit batch transactions](/rpc-service/chains/chains-api/movement/transactions/#submit-batch-transactions) — submits multiple transactions. * [Simulate transaction](/rpc-service/chains/chains-api/movement/transactions-p2/#simulate-transaction) — simulates transaction submission. * [Encode submission](/rpc-service/chains/chains-api/movement/transactions-p2/#encode-submission) — accepts an EncodeSubmissionRequest, which internally is a UserTransactionRequestInner (and optionally secondary signers) encoded as JSON, validates the request format, and then returns that request encoded in BCS. * [Estimate gas price](/rpc-service/chains/chains-api/movement/transactions-p3/#estimate-gas-price) — estimates gas price. **View**: * [Execute view function of a module](/rpc-service/chains/chains-api/movement/transactions-p3/#execute-view-function-of-a-module) — executes the Move function with the given parameters and return its execution result. --- ## Methods ### Accounts, Blocks, Events, General, Table, Transactions - [`Get account`](/rpc-service/chains/chains-api/movement/accounts/#get-account) - [`Get account resources`](/rpc-service/chains/chains-api/movement/accounts/#get-account-resources) - [`Get account modules`](/rpc-service/chains/chains-api/movement/accounts/#get-account-modules) - [`Get account resource`](/rpc-service/chains/chains-api/movement/accounts/#get-account-resource) - [`Get account module`](/rpc-service/chains/chains-api/movement/accounts/#get-account-module) - [`Get blocks by height`](/rpc-service/chains/chains-api/movement/accounts/#get-blocks-by-height) - [`Get blocks by version`](/rpc-service/chains/chains-api/movement/accounts/#get-blocks-by-version) - [`Get events by creation number`](/rpc-service/chains/chains-api/movement/accounts/#get-events-by-creation-number) - [`Get events by event handle`](/rpc-service/chains/chains-api/movement/accounts/#get-events-by-event-handle) - [`Get ledger info`](/rpc-service/chains/chains-api/movement/accounts/#get-ledger-info) - [`Get table item`](/rpc-service/chains/chains-api/movement/accounts/#get-table-item) - [`Get raw table item`](/rpc-service/chains/chains-api/movement/accounts/#get-raw-table-item) - [`Get transactions`](/rpc-service/chains/chains-api/movement/accounts-p2/#get-transactions) - [`Submit transaction`](/rpc-service/chains/chains-api/movement/accounts-p2/#submit-transaction) - [`Get transaction by hash`](/rpc-service/chains/chains-api/movement/accounts-p2/#get-transaction-by-hash) - [`Get transaction by version`](/rpc-service/chains/chains-api/movement/accounts-p2/#get-transaction-by-version) - [`Get account transactions`](/rpc-service/chains/chains-api/movement/accounts-p2/#get-account-transactions) ### Transactions, View - [`Submit batch transactions`](/rpc-service/chains/chains-api/movement/transactions/#submit-batch-transactions) - [`Simulate transaction`](/rpc-service/chains/chains-api/movement/transactions-p2/#simulate-transaction) - [`Encode submission`](/rpc-service/chains/chains-api/movement/transactions-p2/#encode-submission) - [`Estimate gas price`](/rpc-service/chains/chains-api/movement/transactions-p3/#estimate-gas-price) - [`Execute view function of a module`](/rpc-service/chains/chains-api/movement/transactions-p3/#execute-view-function-of-a-module) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/movement/transactions-p2/ title: Movement — Transactions, View (2/3) source: docs/rpc-service/chains/chains-api/movement/transactions-p2.mdx --- # Movement — Transactions, View (2/3) > API reference for [Movement](/rpc-service/chains/chains-api/movement/). [All methods ->](/rpc-service/chains/chains-api/movement/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/movement/transactions/) · 2 · [3](/rpc-service/chains/chains-api/movement/transactions-p3/) ### Simulate transaction > **POST `https://rpc.ankr.com/http/movement_mainnet/v1/transactions/simulate`** Simulates a transaction. The output of the transaction will have the exact transaction outputs and events that running an actual signed transaction would have. However, it will not have the associated state hashes, as they are not updated in storage. This can be used to estimate the maximum gas units for a submitted transaction. To use this, you must: * Create a SignedTransaction with a zero-padded signature. * Submit a SubmitTransactionRequest containing a UserTransactionRequest containing that signature. To use this endpoint with BCS, you must submit a SignedTransaction encoded as BCS. #### Parameters * `estimate_gas_unit_price` (boolean, query): if set to true, the gas unit price in the transaction will be ignored and the estimated value will be used. * `estimate_max_gas_amount` (boolean; query): if set to true, the max gas value in the transaction will be ignored and the maximum possible gas will be used. * `estimate_prioritized_gas_unit_price` (boolean; query): if set to true, the transaction will use a higher price than the original estimate. **Body** A request body is represented by an array of the following parameters: * `sender` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `sequence_number` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `max_gas_amount` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `gas_unit_price` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `expiration_timestamp_secs` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `payload` (object; required): a payload is one of the following objects: 1. A payload which runs a single entry function: * `type` (string; required): a payload type. Example: `entry_function_payload`. * `function` (string; required): an entry function ID is a string representation of an entry function defined on-chain.
Format: `{address}::{module name}::{function name}`
Both `module name` and `function name` are case-sensitive.
Example: `0x1::aptos_coin::transfer` * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 2. A payload which runs a script that can run multiple functions: * `type` (string; required): a payload type. Example: `script_payload`. * `code` (object; required): a Move script bytecode: * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move function: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]: required): a return type of the function. * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 3. An enum of possible transaction payloads: * `type` (string; required): a payload type. Example: `module_bundle_payload`. * `modules` (array[object]; required): * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move module: * `address` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `name` (string; required): a name of the module. * `friends` (array[string]: required): friends of the module. * `exposed_functions` (array[object]; required): public functions of the module: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]; required): a return type of the function. * `structs` (array[object]; required): structs of the module: * `name` (string; required): a name of the struct. * `is_native` (boolean; required): whether the struct is a native struct of Move. * `abilities` (array[string]; required): abilities associated with the struct. * `generic_type_params` (array[object]; required): generic types associated with the struct: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the type that uses it. * `fields` (array[object]; required): fields associated with the struct: * `name` (string; required): a name of the field. * `type` (string; required): a string representation of an on-chain Move type tag that is exposed in transaction payload.
Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` ``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match pattern: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `signature` (object; required): a signature is one of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a signature type. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 3. A multi-agent signature for multi-agent transactions (allows you to have transactions across multiple accounts): * `type` (string; required): a type of signature. Example: `multi_agent_signature`. * `sender` (object; required): a sender is on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of sender signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of sender signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `secondary_signer_addresses` (array[string]; hex; required): the other involved parties' addresses. * `secondary_signers` (array of objects): an array of on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of secondary signers' signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of secondary signers' signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/movement_mainnet/v1/transactions/simulate \ -H 'Content-Type: application/json' \ -d '{ "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } }' ``` #### Response example ```json [ { "version": "32425224034", "hash": "string", "state_change_hash": "string", "event_root_hash": "string", "state_checkpoint_hash": "string", "gas_used": "32425224034", "success": true, "vm_status": "string", "accumulator_root_hash": "string", "changes": [ { "type": "delete_module", "address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "state_key_hash": "string", "module": "0x1::aptos_coin" } ], "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " }, "events": [ { "guid": { "creation_number": "32425224034", "account_address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " }, "sequence_number": "32425224034", "type": "string", "data": null } ], "timestamp": "32425224034" } ] ``` --- ### Encode submission > **POST `https://rpc.ankr.com/http/movement_mainnet/v1/transactions/encode_submission`** This endpoint accepts an EncodeSubmissionRequest, which internally is a UserTransactionRequestInner (and optionally secondary signers) encoded as JSON, validates the request format, and then returns that request encoded in BCS. The client can then use this to create a transaction signature to be used in a SubmitTransactionRequest, which it then passes to the [Submit transaction](/rpc-service/chains/chains-api/movement/accounts-p2/#submit-transaction) POST endpoint. To be clear, this endpoint makes it possible to submit transaction requests to the API from languages that do not have library support for BCS. If you are using an SDK that has BCS support, such as the official Rust, TypeScript, or Python SDKs, you do not need to use this endpoint. To sign a message using the response from this endpoint: * Decode the hex encoded string in the response to bytes. * Sign the bytes to create the signature. * Use that as the signature field in something like Ed25519Signature, which you then use to build a TransactionSignature. #### Parameters Submission encoding request body contains the following parameters: * `sender` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `sequence_number` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `max_gas_amount` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `gas_unit_price` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `expiration_timestamp_secs` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `payload` (object; required): a payload is one of the following objects: 1. A payload which runs a single entry function: * `type` (string; required): a payload type. Example: `entry_function_payload`. * `function` (string; required): an entry function ID is a string representation of an entry function defined on-chain.
Format: `{address}::{module name}::{function name}`
Both `module name` and `function name` are case-sensitive.
Example: `0x1::aptos_coin::transfer` * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 2. A payload which runs a script that can run multiple functions: * `type` (string; required): a payload type. Example: `script_payload`. * `code` (object; required): a Move script bytecode: * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move function: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]: required): a return type of the function. * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 3. An enum of possible transaction payloads: * `type` (string; required): a payload type. Example: `module_bundle_payload`. * `modules` (array[object]; required): * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move module: * `address` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `name` (string; required): a name of the module. * `friends` (array[string]: required): friends of the module. * `exposed_functions` (array[object]; required): public functions of the module: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]; required): a return type of the function. * `structs` (array[object]; required): structs of the module: * `name` (string; required): a name of the struct. * `is_native` (boolean; required): whether the struct is a native struct of Move. * `abilities` (array[string]; required): abilities associated with the struct. * `generic_type_params` (array[object]; required): generic types associated with the struct: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the type that uses it. * `fields` (array[object]; required): fields associated with the struct: * `name` (string; required): a name of the field. * `type` (string; required): a string representation of an on-chain Move type tag that is exposed in transaction payload.
Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` ``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match pattern: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `secondary_signers` (array[string]; hex): secondary signer accounts of the request for Multi-agent. #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/movement_mainnet/v1/transactions/encode_submission \ -H 'Content-Type: application/json' \ -d '{ "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "secondary_signers": [ "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " ] }' ``` --- #### Response example ```json 0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/movement/transactions-p3/ title: Movement — Transactions, View (3/3) source: docs/rpc-service/chains/chains-api/movement/transactions-p3.mdx --- # Movement — Transactions, View (3/3) > API reference for [Movement](/rpc-service/chains/chains-api/movement/). [All methods ->](/rpc-service/chains/chains-api/movement/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/movement/transactions/) · [2](/rpc-service/chains/chains-api/movement/transactions-p2/) · 3 ### Estimate gas price > **GET `https://rpc.ankr.com/http/movement_mainnet/v1/estimate_gas_price`** Currently, the gas estimation is handled by taking the median of the last 100,000 transactions If a user wants to prioritize their transaction and is willing to pay, they can pay more than the gas price. If they're willing to wait longer, they can pay less. Note that the gas price moves with the fee market, and should only increase when demand outweighs supply. If there have been no transactions in the last 100,000 transactions, the price will be 1. #### Parameters None. #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/estimate_gas_price \ -H 'Content-Type: application/json' ``` #### Response example ```json { "deprioritized_gas_estimate": 0, "gas_estimate": 0, "prioritized_gas_estimate": 0 } ``` --- ## View ### Execute view function of a module > **POST `https://rpc.ankr.com/http/movement_mainnet/v1/view`** Executes the Move function with the given parameters and return its execution result. The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410. #### Parameters * `ledger_version` (string; uint64; query): a ledger version to get state of account. If not provided, it will be the latest version.
Example: `32425224034` **Body** The Move view function request body contains the following parameters: * `function` (string; required): an entry function ID is a string representation of an entry function defined on-chain.
Format: `{address}::{module name}::{function name}`
Both the module name and function name are case-sensitive.
Example: `0x1::aptos_coin::transfer` * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/movement_mainnet/v1/view \ -H 'Content-Type: application/json' \ -d '{ "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }' ``` #### Response example ```json [ 0 ] ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/movement/transactions/ title: Movement — Transactions, View (1/3) source: docs/rpc-service/chains/chains-api/movement/transactions.mdx --- # Movement — Transactions, View (1/3) > API reference for [Movement](/rpc-service/chains/chains-api/movement/). [All methods ->](/rpc-service/chains/chains-api/movement/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/movement/transactions-p2/) · [3](/rpc-service/chains/chains-api/movement/transactions-p3/) ### Submit batch transactions > **POST `https://rpc.ankr.com/http/movement_mainnet/v1/transactions/batch`** Submits multiple transactions. The response has three outcomes: 1. All transactions succeed, and it will return a 202. 2. Some transactions succeed, and it will return the failed transactions and a 206. 3. No transactions succeed, and it will also return the failed transactions and a 206. To submit a transaction as JSON, you must submit a SubmitTransactionRequest. To build this request, do the following: 1. Encode the transaction as BCS. If you are using a language that has native BCS support, make sure to use that library. If not, you may take advantage of [Encode submission](/rpc-service/chains/chains-api/movement/transactions-p2/#encode-submission). When using this endpoint, make sure you trust the node you're talking to, as it is possible they could manipulate your request. 2. Sign the encoded transaction and use it to create a TransactionSignature. 3. Submit the request. Make sure to use the "application/json" Content-Type. To submit a transaction as BCS, you must submit a SignedTransaction encoded as BCS. Make sure to use the application/x.aptos.signed_transaction+bcs Content-Type. #### Parameters A request body is represented by an array of the following parameters: * `sender` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `sequence_number` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `max_gas_amount` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `gas_unit_price` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `expiration_timestamp_secs` (string; uint64; required): a string containing a 64-bit unsigned integer. We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
Example: `32425224034` * `payload` (object; required): a payload is one of the following objects: 1. A payload which runs a single entry function: * `type` (string; required): a payload type. Example: `entry_function_payload`. * `function` (string; required): an entry function ID is a string representation of an entry function defined on-chain.
Format: `{address}::{module name}::{function name}`
Both `module name` and `function name` are case-sensitive.
Example: `0x1::aptos_coin::transfer` * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 2. A payload which runs a script that can run multiple functions: * `type` (string; required): a payload type. Example: `script_payload`. * `code` (object; required): a Move script bytecode: * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with `0x` and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move function: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]: required): a return type of the function. * `type_arguments` (array[string]; required): type arguments of the function. * `arguments` (array; required): arguments of the function. 3. An enum of possible transaction payloads: * `type` (string; required): a payload type. Example: `module_bundle_payload`. * `modules` (array[object]; required): * `bytecode` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `abi` (object): a Move module: * `address` (string; hex; required): a hex-encoded 32-byte Aptos account address. This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x. For example, address `0x0000000000000000000000000000000000000000000000000000000000000001` is represented as `0x1`.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `name` (string; required): a name of the module. * `friends` (array[string]: required): friends of the module. * `exposed_functions` (array[object]; required): public functions of the module: * `name` (string; required): a name of the function. * `visibility` (string; required): Move function visibility.
Allowed values: `private`, `public`, `friend` * `is_entry` (boolean; required): whether the function can be called as an entry function directly in a transaction. * `generic_type_params` (array[object]; required): generic type params associated with the Move function: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the function that uses it. * `params` (array[string]; required): parameters associated with the Move function. * `return` (array[string]; required): a return type of the function. * `structs` (array[object]; required): structs of the module: * `name` (string; required): a name of the struct. * `is_native` (boolean; required): whether the struct is a native struct of Move. * `abilities` (array[string]; required): abilities associated with the struct. * `generic_type_params` (array[object]; required): generic types associated with the struct: * `constraints` (array[string]; required): Move abilities tied to the generic type param and associated with the type that uses it. * `fields` (array[object]; required): fields associated with the struct: * `name` (string; required): a name of the field. * `type` (string; required): a string representation of an on-chain Move type tag that is exposed in transaction payload.
Values: - bool - u8 - u16 - u32 - u64 - u128 - u256 - address - signer - vector: `vector<{non-reference MoveTypeId}>` - struct: `{address}::{module_name}::{struct_name}::<{generic types}>` ``` Vector type value examples: - `vector` - `vector>` - `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>` Struct type value examples: - `0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> - `0x1::account::Account` Note: 1. Empty chars should be ignored when comparing 2 struct tag ids. 2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding). ``` Match pattern: `^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$` * `signature` (object; required): a signature is one of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a signature type. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the `Address` type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 3. A multi-agent signature for multi-agent transactions (allows you to have transactions across multiple accounts): * `type` (string; required): a type of signature. Example: `multi_agent_signature`. * `sender` (object; required): a sender is on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of sender signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of sender signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `secondary_signer_addresses` (array[string]; hex; required): the other involved parties' addresses. * `secondary_signers` (array of objects): an array of on of the following objects: 1. A single Ed25519 signature: * `type` (string; required): a type of secondary signers' signature. Example: `ed25519_signature`. * `public_key` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` * `signature` (string; hex; required): all bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` 2. An Ed25519 multi-sig signature (allows k-of-n signing for a transaction): * `type` (string; required): a type of secondary signers' signature. Example: `multi_ed25519_signature`. * `public_keys` (array[string]; hex; required): the public keys for the Ed25519 signature. * `signatures` (array[string]; hex; required): signatures associated with the public keys in the same order. * `threshold` (integer; required): the number of signatures required for a successful transaction. * `bitmap` (string; hex; required): bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
Unlike the Address type, HexEncodedBytes will not trim any zeros.
Example: `0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1` #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/movement_mainnet/v1/transactions/batch \ -H 'Content-Type: application/json' -d '[ { "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "sequence_number": "32425224034", "max_gas_amount": "32425224034", "gas_unit_price": "32425224034", "expiration_timestamp_secs": "32425224034", "payload": { "type": "entry_function_payload", "function": "0x1::aptos_coin::transfer", "type_arguments": [ "string" ], "arguments": [ null ] }, "signature": { "type": "ed25519_signature", "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ", "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 " } } ]' ``` #### Response example ```json { "transaction_failures": [ { "error": { "message": "string", "error_code": "account_not_found", "vm_error_code": 0 }, "transaction_index": 0 } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/near/access-keys-p2/ title: NEAR — Access Keys, Accounts/Contracts, Block/Chunk, Gas, Protocol (2/2) source: docs/rpc-service/chains/chains-api/near/access-keys-p2.mdx --- # NEAR — Access Keys, Accounts/Contracts, Block/Chunk, Gas, Protocol (2/2) > API reference for [NEAR](/rpc-service/chains/chains-api/near/). [All methods ->](/rpc-service/chains/chains-api/near/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/near/access-keys/) · 2 ## Block/Chunk The API enables you to query the network and get details about specific blocks or chunks. ### Block details > Retrieves the block for a given height or hash. You can also use `finality` param to return latest block details. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `block`. * `params` (array; required): * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) #### Request example (`finality`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "block", "params": { "finality": "final" } }' ``` #### Request example (`block_id`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "block", "params": { "block_id": 17821130 } }' ``` #### Request example (`block_hash`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "block", "params": { "block_id": "7nsuuitwS7xcdGnD9JgrE22cRB2vf2VS4yh1N9S71F4d" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "author": "bitcat.pool.f863973.m0", "header": { "height": 17821130, "epoch_id": "7Wr3GFJkYeCxjVGz3gDaxvAMUzXuzG8MjFXTFoAXB6ZZ", "next_epoch_id": "A5AdnxEn7mfHieQ5fRxx9AagCkHNJz6wr61ppEXiWvvh", "hash": "CLo31YCUhzz8ZPtS5vXLFskyZgHV5qWgXinBQHgu9Pyd", "prev_hash": "2yUTTubrv1gJhTUVnHXh66JG3qxStBqySoN6wzRzgdVD", "prev_state_root": "5rSz37fySS8XkVgEy3FAZwUncX4X1thcSpuvCgA6xmec", "chunk_receipts_root": "9ETNjrt6MkwTgSVMMbpukfxRshSD1avBUUa4R4NuqwHv", "chunk_headers_root": "HMpEoBhPvThWZvppLwrXQSSfumVdaDW7WfZoCAPtjPfo", "chunk_tx_root": "7tkzFg8RHBmMw1ncRJZCCZAizgq4rwCftTKYLce8RU8t", "outcome_root": "7tkzFg8RHBmMw1ncRJZCCZAizgq4rwCftTKYLce8RU8t", "chunks_included": 1, "challenges_root": "11111111111111111111111111111111", "timestamp": 1601280114229875635, "timestamp_nanosec": "1601280114229875635", "random_value": "ACdUSF3nehbMTwT7qjUB6Mm4Ynck5TVAWbNH3DR1cjQ7", "validator_proposals": [], "chunk_mask": [true], "gas_price": "100000000", "rent_paid": "0", "validator_reward": "0", "total_supply": "1042339182040791154864822502764857", "challenges_result": [], "last_final_block": "AaxTqjYND5WAKbV2UZaFed6DH1DShN9fEemtnpTsv3eR", "last_ds_final_block": "2yUTTubrv1gJhTUVnHXh66JG3qxStBqySoN6wzRzgdVD", "next_bp_hash": "3ZNEoFYh2CQeJ9dc1pLBeUd1HWG8657j2c1v72ENE45Q", "block_merkle_root": "H3912Nkw6rtamfjsjmafe2uV2p1XmUKDou5ywgxb1gJr", "approvals": [ "ed25519:4hNtc9vLhn2PQhktWtLKJV9g8SBfpm6NBT1w4syNFqoKE7ZMts2WwKA9x1ZUSBGVKYCuDGEqogLvwCF25G7e1UR3", "ed25519:2UNmbTqysMMevVPqJEKSq57hkcxVFcAMdGq7CFhpW65yBKFxYwpoziiWsAtARusLn9Sy1eXM7DkGTXwAqFiSooS6", "ed25519:4sumGoW9dnQCsJRpzkd4FQ5NSJypGQRCppWp7eQ9tpsEcJXjHZN8GVTCyeEk19WmbbMEJ5KBNypryyHzaH2gBxd4", "ed25519:3fP2dri6GjYkmHgEqQWWP9GcoQEgakbaUtfr3391tXtYBgxmiJUEymRe54m7D8bQrSJ3LhKD8gTFT7qqdemRnizR", "ed25519:3mwdqSWNm6RiuZAoZhD6pqsirC2cL48nEZAGoKixpqbrsBpAzqV3W2paH4KtQQ4JPLvk5pnzojaint2kNBCcUyq1", "ed25519:D4hMnxqLyQW4Wo29MRNMej887GH46yJXDKNN4es8UDSi9shJ9Y4FcGqkxdV4AZhn1yUjwN5LwfgAgY6fyczk5L3", null, "ed25519:4WCVm4dn88VJxTkUgcvdS7vs34diBqtQY4XWMRctSN1NpbgdkwwVyxg7d2SbGC22SuED7w4nrToMhcpJXrkhkDmF", "ed25519:JqtC7TFP7U14s7YhRKQEqwbc2RUxoctq75mrBdX91f7DuCWsPpe6ZTTnfHPmuJPjTzFHVZTsaQJWzwfSrrgNpnc", "ed25519:ngGUpWc2SyHmMCkWGTNNNfvZAJQ5z7P92JCmDqB7JW3j8fNH6LobvFFXb2zVdssibJKgnjwBj8CRe6qiZtuYQZM", "ed25519:5kzW6RbjukyJZiw9NTzTPPsQdoqN6EecafjVFEoWmTxQ4uSv1uSXhQYcHK2eq4m84oMmPABQDz2mm73Qx8mDdCQX", "ed25519:5wHnuuxwJJiZ4bXNq5cESnr4YovFU2yaUcuHRDUw3DnLoxkqc15CsegoyUSQKEwtCZ4yETv8Z9QcD6Wr9zHV4AUk", "ed25519:3F9XzWBxto31e8RAcBShAJBzJPgSJQsWbPXR38AfQnJn6AiveGz3JjebQm9Ye63BrnNA57QrPshwknxpzSrcNEZW", "ed25519:2g5s4SKsHt9PMdekkDqVtwwtz14v4edhqdBX1MYA8tB6nDpj3vDCDCTy9pEU8dX31PoQe5ygnf88aTZukMBMK1Yt", "ed25519:3Xz4jqhdyS3qs6xTmWdgjwt5gJraU5czMA89hPhmvbAN4aA7SUKL1HkevpmutRQqqxe7c7uCFeGiDHvDcxhhmD8W", null, "ed25519:55xs3vwPEys39egf9Z8SNyn1JsHPRMgj9HCX1GE7GJsVTcAuutQUCo91E12ZdXkuToYRXb9KzoT8n9XQRCNuLpwY", null, "ed25519:28JrFw7KnhnQPN89qZnnw17KDBjS6CDN7zB1hTg7KGg8qQPoCzakz9DNnaSnx39ji7e2fQSpZt4cNJaD7K7Yu7yo", "ed25519:41hAr5qhtvUYpdD2NK9qqTVnpG325ZoAiwrcmk1MJH7fdpxm7oSKXvXZqh7bTmPhv61hH2RpHnhcGuN4QqLzK2zt", "ed25519:4QacMsQ5FJgvecAYDFq8QBh19BBjh4qU8oeD5bV7p6Zhhu3e6r2iSHTvDBU2Q62RZAaWQQkkEwDUC9rsXdkGVhAt", "ed25519:27smtCZ3WobEvBuD5DggY6kkGxjB9qRVY6kPixgwqvBT1eKbRVoV8cLj1z51S8RTcp7YzAr1vhHJUHgksatR9Udz", "ed25519:4wspCWoAbhYxb3th2eX6ZXvKep1Fsco7mFP5zBodXBR8Wr344ANXSUCri3gUgNCCSoQ2CKSdqDEsvE6Y2jQ9hmbB", "ed25519:46XpYf9ZB9gjDfdnJLHqqhYJpQCuvCgB9tzKWS88GANMCb2j9BM3KXyjaEzynSsaPK8VrKFXQuTsTzgQSeo9cWGW", null, "ed25519:Y5ehsrhEpTRGjG6fHJHsEXj2NYPGMmKguiJHXP7TqsCWHBvNzaJbieR7UDp78hJ1ib7C18J5MB2kCzTXBCF9c3b", "ed25519:3P9363Dc8Kqvgjt3TsNRncUrncCHid7aSRnuySjF4JYmQbApkAxomyMu8xm9Rgo3mj9rqXb16PM7Xjn7hKP6TyVr", null, null, "ed25519:65ATjGsigZ3vMp7sGcp1c4ptxoqhHPkBeAaZ5GWJguVDLyrRLPJrtXhLGjH9DpXd7CZswjyMYq5aRtorLnmmJ7GW", null, "ed25519:5SvqSViXbtsLoFMdtCufyyDgZnrEK7LheFi38X5M2ic17gfV5cz37r85RyixjUv98MbAmgVdmkxVFDGfSbeoHW7X", null, null, "ed25519:2n3fQiBEiDKkB84biXWyQmvnupKX7B8faugY37jVi8hVXuWLggJmaEjqub511RCYwFnwW1RBxYpuJQ455KaniCd4", "ed25519:2K9xKFLJ2fW74tddXtghFGFurKWomAqaJmkKYVZKHQT6zHe5wNSYT3vzMotLQcez5JD1Ta57N9zQ4H1RysB2s5DZ", null, null, "ed25519:3qeCRtcLAqLtQ2YSQLcHDa26ykKX1BvAhP9jshLLYapxSEGGgZJY8sU72p9E78AkXwHP3X2Eq74jvts7gTRzNgMg", null, "ed25519:2czSQCF8wBDomEeSdDRH4gFoyJrp2ppZqR6JDaDGoYpaFkpWxZf2oGDkKfQLZMbfvU6LXkQjJssVHcLCJRMzG8co" ], "signature": "ed25519:58sdWd6kxzhQdCGvHzxqvdtDLJzqspe74f3gytnqdxDLHf4eesXi7B3nYq2YaosCHZJYmcR4HPHKSoFm3WE4MbxT", "latest_protocol_version": 35 }, "chunks": [ { "chunk_hash": "EBM2qg5cGr47EjMPtH88uvmXHDHqmWPzKaQadbWhdw22", "prev_block_hash": "2yUTTubrv1gJhTUVnHXh66JG3qxStBqySoN6wzRzgdVD", "outcome_root": "11111111111111111111111111111111", "prev_state_root": "HqWDq3f5HJuWnsTfwZS6jdAUqDjGFSTvjhb846vV27dx", "encoded_merkle_root": "9zYue7drR1rhfzEEoc4WUXzaYRnRNihvRoGt1BgK7Lkk", "encoded_length": 8, "height_created": 17821130, "height_included": 17821130, "shard_id": 0, "gas_used": 0, "gas_limit": 1000000000000000, "rent_paid": "0", "validator_reward": "0", "balance_burnt": "0", "outgoing_receipts_root": "H4Rd6SGeEBTbxkitsCdzfu9xL9HtZ2eHoPCQXUeZ6bW4", "tx_root": "11111111111111111111111111111111", "validator_proposals": [], "signature": "ed25519:4iPgpYAcPztAvnRHjfpegN37Rd8dTJKCjSd1gKAPLDaLcHUySJHjexMSSfC5iJVy28vqF9VB4psz13x2nt92cbR7" } ] }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/block-chunk#what-could-go-wrong) section. --- ### Changes in block > Retrieves the changes in a block for a given block height or hash. You can also use `finality` param to return latest block details. You may choose to search by a specific block or finality, you can not choose both. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `EXPERIMENTAL_changes_in_block`. * `params` (array; required): * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) #### Request example (`finality`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_changes_in_block", "params": { "finality": "final" } }' ``` #### Request example (`block_id`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_changes_in_block", "params": { "block_id": 17821135 } }' ``` #### Request example (`block_hash`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_changes_in_block", "params": { "block_id": "81k9ked5s34zh13EjJt26mxw5npa485SY4UNoPi6yYLo" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block_hash": "81k9ked5s34zh13EjJt26mxw5npa485SY4UNoPi6yYLo", "changes": [ { "type": "account_touched", "account_id": "lee.testnet" }, { "type": "contract_code_touched", "account_id": "lee.testnet" }, { "type": "access_key_touched", "account_id": "lee.testnet" } ] }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/block-chunk#what-could-go-wrong-1) section. --- ### Chunk details > Retrieves the details of a specific chunk. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `chunk`. * `params` (array; required): * `chunk_id`/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param), [`shard_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) #### Request example (`chunk_id`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "chunk", "params": {"chunk_id": "EBM2qg5cGr47EjMPtH88uvmXHDHqmWPzKaQadbWhdw22"} }' ``` #### Request example (`block_id`, `shard_id`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "chunk", "params": {"block_id": 58934027, "shard_id": 0} }' ``` #### Request example ```json { "jsonrpc": "2.0", "result": { "author": "bitcat.pool.f863973.m0", "header": { "chunk_hash": "EBM2qg5cGr47EjMPtH88uvmXHDHqmWPzKaQadbWhdw22", "prev_block_hash": "2yUTTubrv1gJhTUVnHXh66JG3qxStBqySoN6wzRzgdVD", "outcome_root": "11111111111111111111111111111111", "prev_state_root": "HqWDq3f5HJuWnsTfwZS6jdAUqDjGFSTvjhb846vV27dx", "encoded_merkle_root": "9zYue7drR1rhfzEEoc4WUXzaYRnRNihvRoGt1BgK7Lkk", "encoded_length": 8, "height_created": 17821130, "height_included": 17821130, "shard_id": 0, "gas_used": 0, "gas_limit": 1000000000000000, "rent_paid": "0", "validator_reward": "0", "balance_burnt": "0", "outgoing_receipts_root": "H4Rd6SGeEBTbxkitsCdzfu9xL9HtZ2eHoPCQXUeZ6bW4", "tx_root": "11111111111111111111111111111111", "validator_proposals": [], "signature": "ed25519:4iPgpYAcPztAvnRHjfpegN37Rd8dTJKCjSd1gKAPLDaLcHUySJHjexMSSfC5iJVy28vqF9VB4psz13x2nt92cbR7" }, "transactions": [], "receipts": [] }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/block-chunk#what-could-go-wrong-2) section. --- ## Gas The API enables you to query the gas price for a specific block or hash. ### Gas price > Retrieves the gas price for a specific `block_height` or `block_hash`. Using `[null]` will return the most recent block's gas price. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `gas_price`. * `params` (array; required): * `[block_height]`, `["block_hash"]`, or `[null]` #### Request example (`[block_height]`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "gas_price", "params": [17824600] }' ``` #### Request example (`["block_hash"]`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "gas_price", "params": ["AXa8CHDQSA8RdFCt12rtpFraVq4fDUgJbLPxwbaZcZrj"] }' ``` #### Request example (`[null]`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "gas_price", "params": [null] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "gas_price": "100000000" }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/gas#what-could-go-wrong) section. --- ## Protocol The API enables you to retrieve the current genesis and protocol configuration. ### Genesis config > Retrieves the current genesis configuration. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `EXPERIMENTAL_genesis_config`. * `params` (array; required): None. #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_genesis_config", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "protocol_version": 29, "genesis_time": "2020-07-31T03:39:42.911378Z", "chain_id": "testnet", "genesis_height": 10885359, "num_block_producer_seats": 100, "num_block_producer_seats_per_shard": [100], "avg_hidden_validator_seats_per_shard": [0], "dynamic_resharding": false, "protocol_upgrade_stake_threshold": [4, 5], "protocol_upgrade_num_epochs": 2, "epoch_length": 43200, "gas_limit": 1000000000000000, "min_gas_price": "5000", "max_gas_price": "10000000000000000000000", "block_producer_kickout_threshold": 80, "chunk_producer_kickout_threshold": 90, "online_min_threshold": [90, 100], "online_max_threshold": [99, 100], "gas_price_adjustment_rate": [1, 100], "runtime_config": { "storage_amount_per_byte": "90949470177292823791", "transaction_costs": { "action_receipt_creation_config": { "send_sir": 108059500000, "send_not_sir": 108059500000, "execution": 108059500000 }, "data_receipt_creation_config": { "base_cost": { "send_sir": 4697339419375, "send_not_sir": 4697339419375, "execution": 4697339419375 }, "cost_per_byte": { "send_sir": 59357464, "send_not_sir": 59357464, "execution": 59357464 } }, "action_creation_config": { "create_account_cost": { "send_sir": 99607375000, "send_not_sir": 99607375000, "execution": 99607375000 }, "deploy_contract_cost": { "send_sir": 184765750000, "send_not_sir": 184765750000, "execution": 184765750000 }, "deploy_contract_cost_per_byte": { "send_sir": 6812999, "send_not_sir": 6812999, "execution": 6812999 }, "function_call_cost": { "send_sir": 2319861500000, "send_not_sir": 2319861500000, "execution": 2319861500000 }, "function_call_cost_per_byte": { "send_sir": 2235934, "send_not_sir": 2235934, "execution": 2235934 }, "transfer_cost": { "send_sir": 115123062500, "send_not_sir": 115123062500, "execution": 115123062500 }, "stake_cost": { "send_sir": 141715687500, "send_not_sir": 141715687500, "execution": 102217625000 }, "add_key_cost": { "full_access_cost": { "send_sir": 101765125000, "send_not_sir": 101765125000, "execution": 101765125000 }, "function_call_cost": { "send_sir": 102217625000, "send_not_sir": 102217625000, "execution": 102217625000 }, "function_call_cost_per_byte": { "send_sir": 1925331, "send_not_sir": 1925331, "execution": 1925331 } }, "delete_key_cost": { "send_sir": 94946625000, "send_not_sir": 94946625000, "execution": 94946625000 }, "delete_account_cost": { "send_sir": 147489000000, "send_not_sir": 147489000000, "execution": 147489000000 } }, "storage_usage_config": { "num_bytes_account": 100, "num_extra_bytes_record": 40 }, "burnt_gas_reward": [3, 10], "pessimistic_gas_price_inflation_ratio": [103, 100] }, "wasm_config": { "ext_costs": { "base": 264768111, "contract_compile_base": 35445963, "contract_compile_bytes": 216750, "read_memory_base": 2609863200, "read_memory_byte": 3801333, "write_memory_base": 2803794861, "write_memory_byte": 2723772, "read_register_base": 2517165186, "read_register_byte": 98562, "write_register_base": 2865522486, "write_register_byte": 3801564, "utf8_decoding_base": 3111779061, "utf8_decoding_byte": 291580479, "utf16_decoding_base": 3543313050, "utf16_decoding_byte": 163577493, "sha256_base": 4540970250, "sha256_byte": 24117351, "keccak256_base": 5879491275, "keccak256_byte": 21471105, "keccak512_base": 5811388236, "keccak512_byte": 36649701, "log_base": 3543313050, "log_byte": 13198791, "storage_write_base": 64196736000, "storage_write_key_byte": 70482867, "storage_write_value_byte": 31018539, "storage_write_evicted_byte": 32117307, "storage_read_base": 56356845750, "storage_read_key_byte": 30952533, "storage_read_value_byte": 5611005, "storage_remove_base": 53473030500, "storage_remove_key_byte": 38220384, "storage_remove_ret_value_byte": 11531556, "storage_has_key_base": 54039896625, "storage_has_key_byte": 30790845, "storage_iter_create_prefix_base": 0, "storage_iter_create_prefix_byte": 0, "storage_iter_create_range_base": 0, "storage_iter_create_from_byte": 0, "storage_iter_create_to_byte": 0, "storage_iter_next_base": 0, "storage_iter_next_key_byte": 0, "storage_iter_next_value_byte": 0, "touching_trie_node": 16101955926, "promise_and_base": 1465013400, "promise_and_per_promise": 5452176, "promise_return": 560152386, "validator_stake_base": 911834726400, "validator_total_stake_base": 911834726400 }, "grow_mem_cost": 1, "regular_op_cost": 3856371, "limit_config": { "max_gas_burnt": 200000000000000, "max_gas_burnt_view": 200000000000000, "max_stack_height": 16384, "initial_memory_pages": 1024, "max_memory_pages": 2048, "registers_memory_limit": 1073741824, "max_register_size": 104857600, "max_number_registers": 100, "max_number_logs": 100, "max_total_log_length": 16384, "max_total_prepaid_gas": 300000000000000, "max_actions_per_receipt": 100, "max_number_bytes_method_names": 2000, "max_length_method_name": 256, "max_arguments_length": 4194304, "max_length_returned_data": 4194304, "max_contract_size": 4194304, "max_length_storage_key": 4194304, "max_length_storage_value": 4194304, "max_promises_per_function_call_action": 1024, "max_number_input_data_dependencies": 128 } }, "account_creation_config": { "min_allowed_top_level_account_length": 0, "registrar_account_id": "registrar" } }, "validators": [ { "account_id": "node0", "public_key": "ed25519:7PGseFbWxvYVgZ89K1uTJKYoKetWs7BJtbyXDzfbAcqX", "amount": "1000000000000000000000000000000" }, { "account_id": "node1", "public_key": "ed25519:6DSjZ8mvsRZDvFqFxo8tCKePG96omXW7eVYVSySmDk8e", "amount": "1000000000000000000000000000000" }, { "account_id": "node2", "public_key": "ed25519:GkDv7nSMS3xcqA45cpMvFmfV1o4fRF6zYo1JRR6mNqg5", "amount": "1000000000000000000000000000000" }, { "account_id": "node3", "public_key": "ed25519:ydgzeXHJ5Xyt7M1gXLxqLBW1Ejx6scNV5Nx2pxFM8su", "amount": "1000000000000000000000000000000" } ], "transaction_validity_period": 86400, "protocol_reward_rate": [1, 10], "max_inflation_rate": [1, 20], "total_supply": "1031467299046044096035532756810080", "num_blocks_per_year": 31536000, "protocol_treasury_account": "near", "fishermen_threshold": "10000000000000000000", "minimum_stake_divisor": 10 }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/protocol#what-could-go-wrong) section. --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/near/access-keys/ title: NEAR — Access Keys, Accounts/Contracts, Block/Chunk, Gas, Protocol (1/2) source: docs/rpc-service/chains/chains-api/near/access-keys.mdx --- # NEAR — Access Keys, Accounts/Contracts, Block/Chunk, Gas, Protocol (1/2) > API reference for [NEAR](/rpc-service/chains/chains-api/near/). [All methods ->](/rpc-service/chains/chains-api/near/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/near/access-keys-p2/) ## Access Keys The API enables you to retrieve information about an account's access keys. ### View access key > Retrieves information about a single access key for a given account. If `permission` of the key is `FunctionCall`, it will return more details such as the `allowance`, `receiver_id`, and `method_names`. #### Parameters * `id` (integer; required): a request ID; unlike other networks, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `query`. * `params` (array; required): * `request_type`: `view_access_key` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) * `account_id`: `"example.testnet"` * `public_key`: `"example.testnet's public key"` #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "query", "params": { "request_type": "view_access_key", "finality": "final", "account_id": "client.chainlink.testnet", "public_key": "ed25519:H9k5eiU4xXS3M4z8HzKJSLaZdqGdGwBG49o7orNC4eZW" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "nonce": 85, "permission": { "FunctionCall": { "allowance": "18501534631167209000000000", "receiver_id": "client.chainlink.testnet", "method_names": ["get_token_price"] } }, "block_height": 19884918, "block_hash": "GGJQ8yjmo7aEoj8ZpAhGehnq9BSWFx4xswHYzDwwAP2n" }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/access-keys#what-could-go-wrong) section. --- ### View access key list > Retrieves all access keys for a given account. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `query`. * `params` (array; required): * `request_type`: `view_access_key` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) * `account_id`: `"example.testnet"` #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "query", "params": { "request_type": "view_access_key_list", "finality": "final", "account_id": "example.testnet" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "keys": [ { "public_key": "ed25519:2j6qujbkPFuTstQLLTxKZUw63D5Wu3SG79Gop5JQrNJY", "access_key": { "nonce": 17, "permission": { "FunctionCall": { "allowance": "9999203942481156415000", "receiver_id": "place.meta", "method_names": [] } } } }, { "public_key": "ed25519:46etzhzZHN4NSQ8JEQtbHCX7sT8WByS3vmSEb3fbmSgf", "access_key": { "nonce": 2, "permission": { "FunctionCall": { "allowance": "9999930655034196535000", "receiver_id": "dev-1596616186817-8588944", "method_names": [] } } } }, { "public_key": "ed25519:4F9TwuSqWwvoyu7JVZDsupPhC7oYbYNsisBV2yQvyXFn", "access_key": { "nonce": 0, "permission": "FullAccess" } }, { "public_key": "ed25519:4bZqp6nm1btr92UfKbyADDzJ4oPK9JetHXqEYqbYZmkD", "access_key": { "nonce": 2, "permission": "FullAccess" } }, { "public_key": "ed25519:6ZPzX7hS37jiU9dRxbV1Waf8HSyKKFypJbrnZXzNhqjs", "access_key": { "nonce": 2, "permission": { "FunctionCall": { "allowance": "9999922083697042955000", "receiver_id": "example.testnet", "method_names": [] } } } }, { "public_key": "ed25519:81RKfuo7mBbsaviTmBsq18t6Eq4YLnSi3ye2CBLcKFUX", "access_key": { "nonce": 8, "permission": "FullAccess" } }, { "public_key": "ed25519:B4W1oAYTcG8GxwKev8jQtsYWkGwGdqP24W7eZ6Fmpyzc", "access_key": { "nonce": 0, "permission": { "FunctionCall": { "allowance": "10000000000000000000000", "receiver_id": "dev-1594144238344", "method_names": [] } } } }, { "public_key": "ed25519:BA3AZbACoEzAsxKeToFd36AVpPXFSNhSMW2R6UYeGRwM", "access_key": { "nonce": 0, "permission": { "FunctionCall": { "allowance": "10000000000000000000000", "receiver_id": "new-corgis", "method_names": [] } } } }, { "public_key": "ed25519:BRyHUGAJjRKVTc9ZqXTTSJnFmSca8WLj8TuVe1wXK3LZ", "access_key": { "nonce": 17, "permission": "FullAccess" } }, { "public_key": "ed25519:DjytaZ1HZ5ZFmH3YeJeMCiC886K1XPYeGsbz2E1AZj2J", "access_key": { "nonce": 31, "permission": "FullAccess" } }, { "public_key": "ed25519:DqJn5UCq6vdNAvfhnbpdAeuui9a6Hv9DKYDxeRACPUDP", "access_key": { "nonce": 0, "permission": "FullAccess" } }, { "public_key": "ed25519:FFxG8x6cDDyiErFtRsdw4dBNtCmCtap4tMTjuq3umvSq", "access_key": { "nonce": 0, "permission": "FullAccess" } } ], "block_height": 17798231, "block_hash": "Gm7YSdx22wPuciW1jTTeRGP9mFqmon69ErFQvgcFyEEB" }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/access-keys#what-could-go-wrong-1) section. --- ### View access key changes (single) > Retrieves individual access key changes in a specific block. You can query multiple keys by passing an array of objects containing the `account_id` and `public_key`. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `EXPERIMENTAL_changes`. * `params` (array; required): * `changes_type`: `single_access_key_changes` * `keys`: `[{ account_id, public_key }]` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_changes", "params": { "changes_type": "single_access_key_changes", "keys": [ { "account_id": "example-acct.testnet", "public_key": "ed25519:25KEc7t7MQohAJ4EDThd2vkksKkwangnuJFzcoiXj9oM" } ], "finality": "final" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block_hash": "4kvqE1PsA6ic1LG7S5SqymSEhvjqGqumKjAxnVdNN3ZH", "changes": [ { "cause": { "type": "transaction_processing", "tx_hash": "HshPyqddLxsganFxHHeH9LtkGekXDCuAt6axVgJLboXV" }, "type": "access_key_update", "change": { "account_id": "example-acct.testnet", "public_key": "ed25519:25KEc7t7MQohAJ4EDThd2vkksKkwangnuJFzcoiXj9oM", "access_key": { "nonce": 1, "permission": "FullAccess" } } } ] }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/access-keys#what-could-go-wrong-2) section. --- ### View access key changes (all) > Retrieves the changes to all access keys of a specific block. Multiple accounts can be queried by passing an array of `account_ids`. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `EXPERIMENTAL_changes`. * `params` (array; required): * `changes_type`: `single_access_key_changes` * `account_ids`: `["example.testnet", "example2.testnet"]` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_changes", "params": { "changes_type": "all_access_key_changes", "account_ids": ["example-acct.testnet"], "block_id": "4kvqE1PsA6ic1LG7S5SqymSEhvjqGqumKjAxnVdNN3ZH" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block_hash": "4kvqE1PsA6ic1LG7S5SqymSEhvjqGqumKjAxnVdNN3ZH", "changes": [ { "cause": { "type": "transaction_processing", "tx_hash": "HshPyqddLxsganFxHHeH9LtkGekXDCuAt6axVgJLboXV" }, "type": "access_key_update", "change": { "account_id": "example-acct.testnet", "public_key": "ed25519:25KEc7t7MQohAJ4EDThd2vkksKkwangnuJFzcoiXj9oM", "access_key": { "nonce": 1, "permission": "FullAccess" } } }, { "cause": { "type": "receipt_processing", "receipt_hash": "CetXstu7bdqyUyweRqpY9op5U1Kqzd8pq8T1kqfcgBv2" }, "type": "access_key_update", "change": { "account_id": "example-acct.testnet", "public_key": "ed25519:96pj2aVJH9njmAxakjvUMnNvdB3YUeSAMjbz9aRNU6XY", "access_key": { "nonce": 0, "permission": "FullAccess" } } } ] }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/access-keys#what-could-go-wrong-3) section. --- ## Accounts/Contracts The API enables you to view details about accounts and contracts as well as perform contract calls. ### View account > Retrieves basic account information. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `query`. * `params` (array; required): * `request_type`: `view_account` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) * `account_id`: `"example.testnet"` #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "query", "params": { "request_type": "view_account", "finality": "final", "account_id": "nearkat.testnet" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "amount": "399992611103597728750000000", "locked": "0", "code_hash": "11111111111111111111111111111111", "storage_usage": 642, "storage_paid_at": 0, "block_height": 17795474, "block_hash": "9MjpcnwW3TSdzGweNfPbkx8M74q1XzUcT1PAN8G5bNDz" }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/contracts#what-could-go-wrong) section. --- ### View account changes > Retrieves account changes from transactions in a given account. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `EXPERIMENTAL_changes`. * `params` (array; required): * `changes_type`: `account_changes` * `account_id`: `"example.testnet"` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_changes", "params": { "changes_type": "account_changes", "account_ids": ["your_account.testnet"], "block_id": 19703467 } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block_hash": "6xsfPSG89s6fCMShxxxQTP6D4ZHM9xkGCgubayTDRzAP", "changes": [ { "cause": { "type": "transaction_processing", "tx_hash": "HLvxLKFM7gohFSqXPp5SpyydNEVpAno352qJJbnddsz3" }, "type": "account_update", "change": { "account_id": "your_account.testnet", "amount": "499999959035075000000000000", "locked": "0", "code_hash": "11111111111111111111111111111111", "storage_usage": 182, "storage_paid_at": 0 } }, { "cause": { "type": "receipt_processing", "receipt_hash": "CPenN1dp4DNKnb9LiL5hkPmu1WiKLMuM7msDjEZwDmwa" }, "type": "account_update", "change": { "account_id": "your_account.testnet", "amount": "499999959035075000000000000", "locked": "0", "code_hash": "11111111111111111111111111111111", "storage_usage": 264, "storage_paid_at": 0 } } ] }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/contracts#what-could-go-wrong-1) section. --- ### View contract code > Retrieves the contract code (Wasm binary) deployed to the account. The returned code will be encoded in base64. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `query`. * `params` (array; required): * `request_type`: `view_code` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) * `account_id`: `"guest-book.testnet"` #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "query", "params": { "request_type": "view_code", "finality": "final", "account_id": "guest-book.testnet" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "code_base64": "47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", "hash": "7KoFshMQkdyo5iTx8P2LbLu9jQpxRn24d27FrKShNVXs", "block_height": 17814234, "block_hash": "GT1D8nweVQU1zyCUv399x8vDv2ogVq71w17MyR66hXBB" }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/contracts#what-could-go-wrong-2) section. --- ### View contract state > Retrieves the state (key value pairs) of a contract based on the key prefix (base64 encoded). Pass an empty string for `prefix_base64` if you would like to return the entire state. Please note that the returned state will be base64 encoded as well. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `query`. * `params` (array; required): * `request_type`: `view_state` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) * `account_id`: `"guest-book.testnet"` * `prefix_base64`: `""` #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "query", "params": { "request_type": "view_state", "finality": "final", "account_id": "guest-book.testnet", "prefix_base64": "" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "values": [ { "key": "bTo6MA==", "value": "eyJwcmVtaXVtIjp0cnVlLCJzZW5kZXIiOiJqb3NoZm9yZC50ZXN0bmV0IiwidGV4dCI6ImhlbGxvIn0=", "proof": [] }, { "key": "bTo6MQ==", "value": "eyJwcmVtaXVtIjpmYWxzZSwic2VuZGVyIjoiY2hhZG9oIiwidGV4dCI6ImhlbGxvIGVyeWJvZHkifQ==", "proof": [] }, { "key": "bTo6MTA=", "value": "eyJwcmVtaXVtIjpmYWxzZSwic2VuZGVyIjoic2F0b3NoaWYudGVzdG5ldCIsInRleHQiOiJIaWxsbyEifQ==", "proof": [] }, { "key": "bTo6MTE=", "value": "eyJwcmVtaXVtIjpmYWxzZSwic2VuZGVyIjoidmFsZW50aW5lc29rb2wudGVzdG5ldCIsInRleHQiOiJIaSEifQ==", "proof": [] }, { "key": "bTo6MTI=", "value": "eyJwcmVtaXVtIjp0cnVlLCJzZW5kZXIiOiJobngudGVzdG5ldCIsInRleHQiOiJoZWxsbyJ9", "proof": [] } ], "proof": [], "block_height": 17814234, "block_hash": "GT1D8nweVQU1zyCUv399x8vDv2ogVq71w17MyR66hXBB" }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/contracts#what-could-go-wrong-3) section. --- ### View contract state changes > Retrieves the state change details of a contract based on the key prefix (encoded to base64). Pass an empty string for this param if you would like to return all state changes. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `EXPERIMENTAL_changes`. * `params` (array; required): * `changes_type`: `data_changes` * `account_ids`: `["example.testnet"]` * `key_prefix_base64`: `"base64 encoded key value"` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_changes", "params": { "changes_type": "data_changes", "account_ids": ["guest-book.testnet"], "key_prefix_base64": "", "block_id": 19450732 } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block_hash": "6U8Yd4JFZwJUNfqkD4KaKgTKmpNSmVRTSggpjmsRWdKY", "changes": [ { "cause": { "type": "receipt_processing", "receipt_hash": "9ewznXgs2t7vRCssxW4thgaiwggnMagKybZ7ryLNTT2z" }, "type": "data_update", "change": { "account_id": "guest-book.testnet", "key_base64": "bTo6Mzk=", "value_base64": "eyJwcmVtaXVtIjpmYWxzZSwic2VuZGVyIjoiZmhyLnRlc3RuZXQiLCJ0ZXh0IjoiSGkifQ==" } }, { "cause": { "type": "receipt_processing", "receipt_hash": "9ewznXgs2t7vRCssxW4thgaiwggnMagKybZ7ryLNTT2z" }, "type": "data_update", "change": { "account_id": "guest-book.testnet", "key_base64": "bTpsZW4=", "value_base64": "NDA=" } } ] }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/contracts#what-could-go-wrong-4) section. --- ### View contract code changes > Retrieves code changes made when deploying a contract. The change are returned as a base64-encoded WASM file. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `EXPERIMENTAL_changes`. * `params` (array; required): * `changes_type`: `contract_code_changes` * `account_ids`: `["example.testnet"]` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_changes", "params": { "changes_type": "contract_code_changes", "account_ids": ["dev-1602714453032-7566969"], "block_id": 20046655 } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block_hash": "3yLNV5zdpzRJ8HP5xTXcF7jdFxuHnmKNUwWcok4616WZ", "changes": [ { "cause": { "type": "receipt_processing", "receipt_hash": "CEm3NNaNdu9cijh9NvZMM1srbtEYSsBVwGbZxFQYKt5B" }, "type": "contract_code_update", "change": { "account_id": "dev-1602714453032-7566969", "code_base64": "AGFzbQEAAAABpAM3YAF/AGAAAX9gAn9+AGADf35+AGAEf35+fgF+YAZ/fn5+fn4BfmADf35+AX5gAn9+AX5gAn9/AX9gAn9/AGADf39/AX9gAX8BfmACfn4AYAF+AX5gAX4AYAABfmADfn5+AGAAAGAIfn5+fn5+fn4BfmAJfn5+fn5+fn5+AX5gAn5+AX5gA35+fgF+YAd+fn5+fn5+AGAEfn5+fgBgCX5+fn5+fn5+fgBgBX5+fn5+AX5gA39/fwBgAX8Bf2ACf3wAYAR/f39+AGAFf39/fn8AYAV/f39/fwBgBH9/f38AYAN/f38BfmADf39+AGACf38BfmAFf39/f38Bf2AEf39/fwF/YAZ/f39/f38AYAV/f35/fwBgBH9+f38Bf2ACf34Bf2AHf35+f39+fwBgBX9/f39+AGAEf35+fgBgCX9+fn5+fn5+fgF+YAp/fn5+fn5+fn5+AX5gCH9+fn5+fn5+AGAFf35+fn4AYAp/fn5+fn5+fn5+AGAHf39/f39/fwBgBH98f38Bf2AGf39/f39..." } } ] }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/contracts#what-could-go-wrong-5) section. --- ### Call a contract function > Calls a contract method as a view function. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `query`. * `params` (array; required): * `request_type`: `call_function` * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) * `account_id`: `"example.testnet"` * `method_name`: `name_of_a_example.testnet_method` (example: [`view` methods](https://github.com/near/core-contracts/blob/master/staking-pool/src/lib.rs#L317)) * `args_base64`: `method_arguments_base_64_encoded` #### Request example (`get_num`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "query", "params": { "request_type": "call_function", "finality": "final", "account_id": "dev-1588039999690", "method_name": "get_num", "args_base64": "e30=" } }' ``` #### Request example (`get_account_staked_balance`) The `args_base64` in this example is decoded as `{"account_id":"dev-1588039999690"}`. The `account_id` would likely be the validator and not the same account for this particular view function. ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "query", "params": { "request_type": "call_function", "finality": "final", "account_id": "dev-1588039999690", "method_name": "get_account_staked_balance", "args_base64": "eyJhY2NvdW50X2lkIjoiZGV2LTE1ODgwMzk5OTk2OTAifQ==" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "result": [48], "logs": [], "block_height": 17817336, "block_hash": "4qkA4sUUG8opjH5Q9bL5mWJTnfR4ech879Db1BZXbx6P" }, "id": "dontcare" } ``` Note: `[48]` is an array of bytes, to be specific it is an ASCII code of `0`. `near-sdk-rs` and `near-sdk-js` return JSON-serialized results. For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/contracts#what-could-go-wrong-6) section. --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/near/ title: NEAR description: NEAR is a user-friendly and carbon-neutral blockchain, built from the ground up to be performant, secure, and… Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/near/index.mdx --- # NEAR
> NEAR API is available on [Web3 API platform](https://www.ankr.com/rpc/near). *NEAR* is a user-friendly and carbon-neutral blockchain, built from the ground up to be performant, secure, and infinitely scalable. In technical terms, NEAR is a layer one, sharded, proof-of-stake blockchain built with usability in mind. In order for your Web3 application to interact with NEAR — either by reading blockchain data or sending transactions to the network — it must connect to a NEAR node. Developers interact with the blockchain using the methods provided by the API. Responses come in [JSON format](https://www.json.org/json-en.html). ## Methods supported **Access Keys** — to retrieve information about an account's access keys. * [View access key](/rpc-service/chains/chains-api/near/access-keys/#view-access-key) — retrieves information about a single access key for a given account. * [View access key list](/rpc-service/chains/chains-api/near/access-keys/#view-access-key-list) — retrieves all access keys for a given account. * [View access key changes (single)](/rpc-service/chains/chains-api/near/access-keys/#view-access-key-changes-single) — retrieves individual access key changes in a specific block. * [View access key changes (all)](/rpc-service/chains/chains-api/near/access-keys/#view-access-key-changes-all) — retrieves changes to all access keys of a specific block. **Accounts/Contracts** — to view details about accounts and contracts as well as perform contract calls. * [View account](/rpc-service/chains/chains-api/near/access-keys/#view-account) — retrieves basic account information. * [View account changes](/rpc-service/chains/chains-api/near/access-keys/#view-account-changes) — retrieves account changes from transactions in a given account. * [View contract code](/rpc-service/chains/chains-api/near/access-keys/#view-contract-code) — retrieves the contract code (Wasm binary) deployed to the account. * [View contract state](/rpc-service/chains/chains-api/near/access-keys/#view-contract-state) — retrieves the state (key value pairs) of a contract based on the key prefix (base64 encoded). * [View contract state changes](/rpc-service/chains/chains-api/near/access-keys/#view-contract-state-changes) — retrieves the state change details of a contract based on the key prefix (encoded to base64). * [View contract code changes](/rpc-service/chains/chains-api/near/access-keys/#view-contract-code-changes) — retrieves code changes made when deploying a contract. * [Call a contract function](/rpc-service/chains/chains-api/near/access-keys/#call-a-contract-function) — calls a contract method as a view function. **Block/Chunk** — to query the network and get details about specific blocks or chunks. * [Block details](/rpc-service/chains/chains-api/near/access-keys-p2/#block-details) — retrieves the block for a given height or hash. * [Changes in block](/rpc-service/chains/chains-api/near/access-keys-p2/#changes-in-block) — retrieves the changes in a block for a given block height or hash. * [Chunk details](/rpc-service/chains/chains-api/near/access-keys-p2/#chunk-details) — retrieves details of a specific chunk. **Gas** — to query the gas price for a specific block or hash. * [Gas price](/rpc-service/chains/chains-api/near/access-keys-p2/#gas-price) — retrieves the gas price for a specific block height or block hash. **Protocol** — to retrieve the current genesis and protocol configuration. * [Genesis config](/rpc-service/chains/chains-api/near/access-keys-p2/#genesis-config) — retrieves the current genesis configuration. * [Protocol config](/rpc-service/chains/chains-api/near/protocol/#protocol-config) — retrieves the most recent protocol configuration or a specified block. **Network** — to query status information for nodes and validators. * [Validation status](/rpc-service/chains/chains-api/near/protocol/#validation-status) — queries active validators on the network returning details and the state of validation on the blockchain. **Transactions** — to send transactions and query their status. * [Send transaction (async)](/rpc-service/chains/chains-api/near/protocol/#send-transaction-async) — sends a transaction and immediately returns transaction hash. * [Send transaction (await)](/rpc-service/chains/chains-api/near/protocol/#send-transaction-await) — sends a transaction and waits until transaction is fully completed (has a 10-second timeout). * [Transaction status](/rpc-service/chains/chains-api/near/protocol/#transaction-status) — queries status of a transaction by hash and returns the final transaction result. * [Transaction status with receipts](/rpc-service/chains/chains-api/near/protocol/#transaction-status-with-receipts) — queries status of a transaction by hash, returning the final transaction result and details of all receipts. * [Receipt by ID](/rpc-service/chains/chains-api/near/protocol/#receipt-by-id) — retrieves a receipt by its ID (as is, without a status or execution outcome). --- ## Methods ### Access Keys, Accounts/Contracts, Block/Chunk, Gas, Protocol - [`View access key`](/rpc-service/chains/chains-api/near/access-keys/#view-access-key) - [`View access key list`](/rpc-service/chains/chains-api/near/access-keys/#view-access-key-list) - [`View access key changes (single)`](/rpc-service/chains/chains-api/near/access-keys/#view-access-key-changes-single) - [`View access key changes (all)`](/rpc-service/chains/chains-api/near/access-keys/#view-access-key-changes-all) - [`View account`](/rpc-service/chains/chains-api/near/access-keys/#view-account) - [`View account changes`](/rpc-service/chains/chains-api/near/access-keys/#view-account-changes) - [`View contract code`](/rpc-service/chains/chains-api/near/access-keys/#view-contract-code) - [`View contract state`](/rpc-service/chains/chains-api/near/access-keys/#view-contract-state) - [`View contract state changes`](/rpc-service/chains/chains-api/near/access-keys/#view-contract-state-changes) - [`View contract code changes`](/rpc-service/chains/chains-api/near/access-keys/#view-contract-code-changes) - [`Call a contract function`](/rpc-service/chains/chains-api/near/access-keys/#call-a-contract-function) - [`Block details`](/rpc-service/chains/chains-api/near/access-keys-p2/#block-details) - [`Changes in block`](/rpc-service/chains/chains-api/near/access-keys-p2/#changes-in-block) - [`Chunk details`](/rpc-service/chains/chains-api/near/access-keys-p2/#chunk-details) - [`Gas price`](/rpc-service/chains/chains-api/near/access-keys-p2/#gas-price) - [`Genesis config`](/rpc-service/chains/chains-api/near/access-keys-p2/#genesis-config) ### Protocol, Network, Transactions - [`Protocol config`](/rpc-service/chains/chains-api/near/protocol/#protocol-config) - [`Validation status`](/rpc-service/chains/chains-api/near/protocol/#validation-status) - [`Send transaction (async)`](/rpc-service/chains/chains-api/near/protocol/#send-transaction-async) - [`Send transaction (await)`](/rpc-service/chains/chains-api/near/protocol/#send-transaction-await) - [`Transaction status`](/rpc-service/chains/chains-api/near/protocol/#transaction-status) - [`Transaction status with receipts`](/rpc-service/chains/chains-api/near/protocol/#transaction-status-with-receipts) - [`Receipt by ID`](/rpc-service/chains/chains-api/near/protocol/#receipt-by-id) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/near/protocol/ title: NEAR — Protocol, Network, Transactions source: docs/rpc-service/chains/chains-api/near/protocol.mdx --- # NEAR — Protocol, Network, Transactions > API reference for [NEAR](/rpc-service/chains/chains-api/near/). [All methods ->](/rpc-service/chains/chains-api/near/#methods) ### Protocol config > Retrieves the most recent protocol configuration or a specified block. Useful for finding current storage and transaction costs. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `EXPERIMENTAL_protocol_config`. * `params` (array; required): * [`finality`](https://docs.near.org/api/rpc/setup#using-finality-param)/[`block_id`](https://docs.near.org/api/rpc/setup#using-block_id-param) #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_protocol_config", "params": { "finality": "final" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "protocol_version": 45, "genesis_time": "2020-07-31T03:39:42.911378Z", "chain_id": "testnet", "genesis_height": 42376888, "num_block_producer_seats": 200, "num_block_producer_seats_per_shard": [200], "avg_hidden_validator_seats_per_shard": [0], "dynamic_resharding": false, "protocol_upgrade_stake_threshold": [4, 5], "epoch_length": 43200, "gas_limit": 1000000000000000, "min_gas_price": "5000", "max_gas_price": "10000000000000000000000", "block_producer_kickout_threshold": 80, "chunk_producer_kickout_threshold": 90, "online_min_threshold": [90, 100], "online_max_threshold": [99, 100], "gas_price_adjustment_rate": [1, 100], "runtime_config": { "storage_amount_per_byte": "10000000000000000000", "transaction_costs": { "action_receipt_creation_config": { "send_sir": 108059500000, "send_not_sir": 108059500000, "execution": 108059500000 }, "data_receipt_creation_config": { "base_cost": { "send_sir": 4697339419375, "send_not_sir": 4697339419375, "execution": 4697339419375 }, "cost_per_byte": { "send_sir": 59357464, "send_not_sir": 59357464, "execution": 59357464 } }, "action_creation_config": { "create_account_cost": { "send_sir": 99607375000, "send_not_sir": 99607375000, "execution": 99607375000 }, "deploy_contract_cost": { "send_sir": 184765750000, "send_not_sir": 184765750000, "execution": 184765750000 }, "deploy_contract_cost_per_byte": { "send_sir": 6812999, "send_not_sir": 6812999, "execution": 6812999 }, "function_call_cost": { "send_sir": 2319861500000, "send_not_sir": 2319861500000, "execution": 2319861500000 }, "function_call_cost_per_byte": { "send_sir": 2235934, "send_not_sir": 2235934, "execution": 2235934 }, "transfer_cost": { "send_sir": 115123062500, "send_not_sir": 115123062500, "execution": 115123062500 }, "stake_cost": { "send_sir": 141715687500, "send_not_sir": 141715687500, "execution": 102217625000 }, "add_key_cost": { "full_access_cost": { "send_sir": 101765125000, "send_not_sir": 101765125000, "execution": 101765125000 }, "function_call_cost": { "send_sir": 102217625000, "send_not_sir": 102217625000, "execution": 102217625000 }, "function_call_cost_per_byte": { "send_sir": 1925331, "send_not_sir": 1925331, "execution": 1925331 } }, "delete_key_cost": { "send_sir": 94946625000, "send_not_sir": 94946625000, "execution": 94946625000 }, "delete_account_cost": { "send_sir": 147489000000, "send_not_sir": 147489000000, "execution": 147489000000 } }, "storage_usage_config": { "num_bytes_account": 100, "num_extra_bytes_record": 40 }, "burnt_gas_reward": [3, 10], "pessimistic_gas_price_inflation_ratio": [103, 100] }, "wasm_config": { "ext_costs": { "base": 264768111, "contract_compile_base": 35445963, "contract_compile_bytes": 216750, "read_memory_base": 2609863200, "read_memory_byte": 3801333, "write_memory_base": 2803794861, "write_memory_byte": 2723772, "read_register_base": 2517165186, "read_register_byte": 98562, "write_register_base": 2865522486, "write_register_byte": 3801564, "utf8_decoding_base": 3111779061, "utf8_decoding_byte": 291580479, "utf16_decoding_base": 3543313050, "utf16_decoding_byte": 163577493, "sha256_base": 4540970250, "sha256_byte": 24117351, "keccak256_base": 5879491275, "keccak256_byte": 21471105, "keccak512_base": 5811388236, "keccak512_byte": 36649701, "log_base": 3543313050, "log_byte": 13198791, "storage_write_base": 64196736000, "storage_write_key_byte": 70482867, "storage_write_value_byte": 31018539, "storage_write_evicted_byte": 32117307, "storage_read_base": 56356845750, "storage_read_key_byte": 30952533, "storage_read_value_byte": 5611005, "storage_remove_base": 53473030500, "storage_remove_key_byte": 38220384, "storage_remove_ret_value_byte": 11531556, "storage_has_key_base": 54039896625, "storage_has_key_byte": 30790845, "storage_iter_create_prefix_base": 0, "storage_iter_create_prefix_byte": 0, "storage_iter_create_range_base": 0, "storage_iter_create_from_byte": 0, "storage_iter_create_to_byte": 0, "storage_iter_next_base": 0, "storage_iter_next_key_byte": 0, "storage_iter_next_value_byte": 0, "touching_trie_node": 16101955926, "promise_and_base": 1465013400, "promise_and_per_promise": 5452176, "promise_return": 560152386, "validator_stake_base": 911834726400, "validator_total_stake_base": 911834726400 }, "grow_mem_cost": 1, "regular_op_cost": 3856371, "limit_config": { "max_gas_burnt": 200000000000000, "max_gas_burnt_view": 200000000000000, "max_stack_height": 16384, "initial_memory_pages": 1024, "max_memory_pages": 2048, "registers_memory_limit": 1073741824, "max_register_size": 104857600, "max_number_registers": 100, "max_number_logs": 100, "max_total_log_length": 16384, "max_total_prepaid_gas": 300000000000000, "max_actions_per_receipt": 100, "max_number_bytes_method_names": 2000, "max_length_method_name": 256, "max_arguments_length": 4194304, "max_length_returned_data": 4194304, "max_contract_size": 4194304, "max_length_storage_key": 4194304, "max_length_storage_value": 4194304, "max_promises_per_function_call_action": 1024, "max_number_input_data_dependencies": 128 } }, "account_creation_config": { "min_allowed_top_level_account_length": 0, "registrar_account_id": "registrar" } }, "transaction_validity_period": 86400, "protocol_reward_rate": [1, 10], "max_inflation_rate": [1, 20], "num_blocks_per_year": 31536000, "protocol_treasury_account": "near", "fishermen_threshold": "340282366920938463463374607431768211455", "minimum_stake_divisor": 10 }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/protocol#what-could-go-wrong-1) section. --- ## Network The API enables you to query status information for nodes and validators. ### Validation status > Queries active validators on the network returning details and the state of validation on the blockchain. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `validators`. * `params` (array; required): * `["block hash"]`, `[block number]`, or `[null]` for the latest block. Note: For `["block hash"]` & `[block number]` you will need to query from the last block in an epoch. #### Request example (`["block number"]`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "validators", "params": [17791098] }' ``` #### Request example (`["block hash"]`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "validators", "params": ["FiG2nMjjue3YdgYAyM3ZqWXSaG6RJj5Gk7hvY8vrEoGw"] }' ``` #### Request example (`["null"]`) ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "validators", "params": [null] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "current_validators": [ { "account_id": "01node.pool.f863973.m0", "public_key": "ed25519:3iNqnvBgxJPXCxu6hNdvJso1PEAc1miAD35KQMBCA3aL", "is_slashed": false, "stake": "176429739989396285019500901780", "shards": [0], "num_produced_blocks": 213, "num_expected_blocks": 213 }, { "account_id": "alexandruast.pool.f863973.m0", "public_key": "ed25519:A3XJ3uVGxSi9o2gnG2r8Ra3fqqodRpL4iuLTc6fNdGUj", "is_slashed": false, "stake": "151430394143736014372434860532", "shards": [0], "num_produced_blocks": 213, "num_expected_blocks": 213 }, { "account_id": "aquarius.pool.f863973.m0", "public_key": "ed25519:8NfEarjStDYjJTwKUgQGy7Z7UTGsZaPhTUsExheQN3r1", "is_slashed": false, "stake": "130367563121508828296664196836", "shards": [0], "num_produced_blocks": 212, "num_expected_blocks": 212 } ], "next_validators": [ { "account_id": "01node.pool.f863973.m0", "public_key": "ed25519:3iNqnvBgxJPXCxu6hNdvJso1PEAc1miAD35KQMBCA3aL", "stake": "177341160716540400974121040893", "shards": [0] }, { "account_id": "alexandruast.pool.f863973.m0", "public_key": "ed25519:A3XJ3uVGxSi9o2gnG2r8Ra3fqqodRpL4iuLTc6fNdGUj", "stake": "152212670433756011274558210225", "shards": [0] } ], "current_fishermen": [ { "account_id": "staked.stakingpool", "public_key": "ed25519:5VmCXxWepj22uFoKmrxk6DTiFa3fuTzDcwGxM8uUErpr", "stake": "5957256918881889179239884296" }, { "account_id": "bisontrails.stakingpool", "public_key": "ed25519:ED2v5KtScbk6aNjGcTn1YMDUu3EXfD5HPt1x6RiYBypk", "stake": "7679439354334034871130713908" } ], "next_fishermen": [ { "account_id": "staked.stakingpool", "public_key": "ed25519:5VmCXxWepj22uFoKmrxk6DTiFa3fuTzDcwGxM8uUErpr", "stake": "5957256918881889179239884296" }, { "account_id": "bisontrails.stakingpool", "public_key": "ed25519:ED2v5KtScbk6aNjGcTn1YMDUu3EXfD5HPt1x6RiYBypk", "stake": "7679439354334034871130713908" } ], "current_proposals": [ { "account_id": "kytzu.pool.f863973.m0", "public_key": "ed25519:61tgPZpy8tqFeAwG4vtf2ZKCRoENiP2A1TJVWEwnbxZU", "stake": "114346100195275968419224582943" }, { "account_id": "nodeasy.pool.f863973.m0", "public_key": "ed25519:25Dhg8NBvQhsVTuugav3t1To1X1zKiomDmnh8yN9hHMb", "stake": "132333066144809013154670461579" } ], "prev_epoch_kickout": [], "epoch_start_height": 17754191, "epoch_height": 321 }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/network#what-could-go-wrong-2) section. --- ## Transactions The RPC API enables you to send transactions and query their status. ### Send transaction (async) > Sends a transaction and immediately returns transaction hash. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `broadcast_tx_async`. * `params` (array; required): * `` #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "broadcast_tx_async", "params": [ "DgAAAHNlbmRlci50ZXN0bmV0AOrmAai64SZOv9e/naX4W15pJx0GAap35wTT1T/DwcbbDwAAAAAAAAAQAAAAcmVjZWl2ZXIudGVzdG5ldNMnL7URB1cxPOu3G8jTqlEwlcasagIbKlAJlF5ywVFLAQAAAAMAAACh7czOG8LTAAAAAAAAAGQcOG03xVSFQFjoagOb4NBBqWhERnnz45LY4+52JgZhm1iQKz7qAdPByrGFDQhQ2Mfga8RlbysuQ8D8LlA6bQE=" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "6zgh2u9DqHHiXzdy9ouTP7oGky2T4nugqzqt9wJZwNFm", "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/transactions#what-could-go-wrong) section. --- ### Send transaction (await) > Sends a transaction and waits until transaction is fully completed (has a 10-second timeout). #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `broadcast_tx_commit`. * `params` (array; required): * `` #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "broadcast_tx_commit", "params": [ "DgAAAHNlbmRlci50ZXN0bmV0AOrmAai64SZOv9e/naX4W15pJx0GAap35wTT1T/DwcbbDQAAAAAAAAAQAAAAcmVjZWl2ZXIudGVzdG5ldIODI4YfV/QS++blXpQYT+bOsRblTRW4f547y/LkvMQ9AQAAAAMAAACh7czOG8LTAAAAAAAAAAXcaTJzu9GviPT7AD4mNJGY79jxTrjFLoyPBiLGHgBi8JK1AnhK8QknJ1ourxlvOYJA2xEZE8UR24THmSJcLQw=" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "status": { "SuccessValue": "" }, "transaction": { "signer_id": "sender.testnet", "public_key": "ed25519:Gowpa4kXNyTMRKgt5W7147pmcc2PxiFic8UHW9rsNvJ6", "nonce": 13, "receiver_id": "receiver.testnet", "actions": [ { "Transfer": { "deposit": "1000000000000000000000000" } } ], "signature": "ed25519:7oCBMfSHrZkT7tzPDBxxCd3tWFhTES38eks3MCZMpYPJRfPWKxJsvmwQiVBBxRLoxPTnXVaMU2jPV3MdFKZTobH", "hash": "ASS7oYwGiem9HaNwJe6vS2kznx2CxueKDvU9BAYJRjNR" }, "transaction_outcome": { "proof": [], "block_hash": "9MzuZrRPW1BGpFnZJUJg6SzCrixPpJDfjsNeUobRXsLe", "id": "ASS7oYwGiem9HaNwJe6vS2kznx2CxueKDvU9BAYJRjNR", "outcome": { "logs": [], "receipt_ids": ["BLV2q6p8DX7pVgXRtGtBkyUNrnqkNyU7iSksXG7BjVZh"], "gas_burnt": 223182562500, "tokens_burnt": "22318256250000000000", "executor_id": "sender.testnet", "status": { "SuccessReceiptId": "BLV2q6p8DX7pVgXRtGtBkyUNrnqkNyU7iSksXG7BjVZh" } } }, "receipts_outcome": [ { "proof": [], "block_hash": "5Hpj1PeCi32ZkNXgiD1DrW4wvW4Xtic74DJKfyJ9XL3a", "id": "BLV2q6p8DX7pVgXRtGtBkyUNrnqkNyU7iSksXG7BjVZh", "outcome": { "logs": [], "receipt_ids": ["3sawynPNP8UkeCviGqJGwiwEacfPyxDKRxsEWPpaUqtR"], "gas_burnt": 223182562500, "tokens_burnt": "22318256250000000000", "executor_id": "receiver.testnet", "status": { "SuccessValue": "" } } }, { "proof": [], "block_hash": "CbwEqMpPcu6KwqVpBM3Ry83k6M4H1FrJjES9kBXThcRd", "id": "3sawynPNP8UkeCviGqJGwiwEacfPyxDKRxsEWPpaUqtR", "outcome": { "logs": [], "receipt_ids": [], "gas_burnt": 0, "tokens_burnt": "0", "executor_id": "sender.testnet", "status": { "SuccessValue": "" } } } ] }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/transactions#what-could-go-wrong-1) section. --- ### Transaction status > Queries status of a transaction by hash and returns the final transaction result. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `tx`. * `params` (array; required): * `transaction hash` * `sender account id` #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "tx", "params": ["6zgh2u9DqHHiXzdy9ouTP7oGky2T4nugqzqt9wJZwNFm", "sender.testnet"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "status": { "SuccessValue": "" }, "transaction": { "signer_id": "sender.testnet", "public_key": "ed25519:Gowpa4kXNyTMRKgt5W7147pmcc2PxiFic8UHW9rsNvJ6", "nonce": 15, "receiver_id": "receiver.testnet", "actions": [ { "Transfer": { "deposit": "1000000000000000000000000" } } ], "signature": "ed25519:3168QMdTpcwHvM1dmMYBc8hg9J3Wn8n7MWBSE9WrEpns6P5CaY87RM6k4uzyBkQuML38CZhU18HzmQEevPG1zCvk", "hash": "6zgh2u9DqHHiXzdy9ouTP7oGky2T4nugqzqt9wJZwNFm" }, "transaction_outcome": { "proof": [ { "hash": "F7mL76CMdfbdZ3xCehVGNh1fCyaR37gr3MeGX3EZkiVf", "direction": "Right" } ], "block_hash": "ADTMLVtkhsvzUxuf6m87Pt1dnF5vi1yY7ftxmNpFx7y", "id": "6zgh2u9DqHHiXzdy9ouTP7oGky2T4nugqzqt9wJZwNFm", "outcome": { "logs": [], "receipt_ids": ["3dMfwczW5GQqXbD9GMTnmf8jy5uACxG6FC5dWxm3KcXT"], "gas_burnt": 223182562500, "tokens_burnt": "22318256250000000000", "executor_id": "sender.testnet", "status": { "SuccessReceiptId": "3dMfwczW5GQqXbD9GMTnmf8jy5uACxG6FC5dWxm3KcXT" } } }, "receipts_outcome": [ { "proof": [ { "hash": "6h95oEd7ih62KXfyPT4zsZYont4qy9sWEXc5VQVDhqtG", "direction": "Right" }, { "hash": "6DnibgZk1T669ZprcehUy1GpCSPw1kjzXRGu69nSaUNn", "direction": "Right" } ], "block_hash": "GgFTVr33r4MrpAiHc9mr8TZqLnpZAX1BaZTNvhBnciy2", "id": "3dMfwczW5GQqXbD9GMTnmf8jy5uACxG6FC5dWxm3KcXT", "outcome": { "logs": [], "receipt_ids": ["46KYgN8ddxs4Qy8C7BDQH49XUfcYZsaQmAvdU1nfcL9V"], "gas_burnt": 223182562500, "tokens_burnt": "22318256250000000000", "executor_id": "receiver.testnet", "status": { "SuccessValue": "" } } }, { "proof": [ { "hash": "CD9Y7Bw3MSFgaPZzpc1yP51ajhGDCAsR61qXcMNcRoHf", "direction": "Left" } ], "block_hash": "EGAgKuW6Bd6QKYSaxAkx2pPGmnjrjAcq4UpoUiqMXvPH", "id": "46KYgN8ddxs4Qy8C7BDQH49XUfcYZsaQmAvdU1nfcL9V", "outcome": { "logs": [], "receipt_ids": [], "gas_burnt": 0, "tokens_burnt": "0", "executor_id": "sender.testnet", "status": { "SuccessValue": "" } } } ] }, "id": "dontcare" } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/transactions#what-could-go-wrong-2) section. --- ### Transaction status with receipts > Queries status of a transaction by hash, returning the final transaction result and details of all receipts. #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `EXPERIMENTAL_tx_status`. * `params` (array; required): * `transaction hash` * `sender account id` (used to determine which shard to query for transaction) #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_tx_status", "params": ["HEgnVQZfs9uJzrqTob4g2Xmebqodq9waZvApSkrbcAhd", "bowen"] }' ``` #### Response example ```json { "id": "123", "jsonrpc": "2.0", "result": { "receipts": [ { "predecessor_id": "bowen", "receipt": { "Action": { "actions": [ { "FunctionCall": { "args": "eyJhbW91bnQiOiIxMDAwIiwicmVjZWl2ZXJfaWQiOiJib3dlbiJ9", "deposit": "0", "gas": 100000000000000, "method_name": "transfer" } } ], "gas_price": "186029458", "input_data_ids": [], "output_data_receivers": [], "signer_id": "bowen", "signer_public_key": "ed25519:2f9Zv5kuyuPM5DCyEP5pSqg58NQ8Ct9uSRerZXnCS9fK" } }, "receipt_id": "FXMVxdhSUZaZftbmPJWaoqhEB9GrKB2oqg9Wgvuyvom8", "receiver_id": "evgeny.lockup.m0" }, { "predecessor_id": "evgeny.lockup.m0", "receipt": { "Action": { "actions": [ { "Transfer": { "deposit": "1000" } } ], "gas_price": "186029458", "input_data_ids": [], "output_data_receivers": [], "signer_id": "bowen", "signer_public_key": "ed25519:2f9Zv5kuyuPM5DCyEP5pSqg58NQ8Ct9uSRerZXnCS9fK" } }, "receipt_id": "3Ad7pUygUegMUWUb1rEazfjnTaHfptXCABqKQ6WNq6Wa", "receiver_id": "bowen" }, { "predecessor_id": "system", "receipt": { "Action": { "actions": [ { "Transfer": { "deposit": "19200274886926125000" } } ], "gas_price": "0", "input_data_ids": [], "output_data_receivers": [], "signer_id": "bowen", "signer_public_key": "ed25519:2f9Zv5kuyuPM5DCyEP5pSqg58NQ8Ct9uSRerZXnCS9fK" } }, "receipt_id": "5DdQg9pfoJMX1q6bvhsjyyRihzA3sb9Uq5K1J7vK43Ze", "receiver_id": "bowen" }, { "predecessor_id": "system", "receipt": { "Action": { "actions": [ { "Transfer": { "deposit": "18663792669276228632284" } } ], "gas_price": "0", "input_data_ids": [], "output_data_receivers": [], "signer_id": "bowen", "signer_public_key": "ed25519:2f9Zv5kuyuPM5DCyEP5pSqg58NQ8Ct9uSRerZXnCS9fK" } }, "receipt_id": "FDp8ovTf5uJYDFemW5op6ebjCT2n4CPExHYie3S1h4qp", "receiver_id": "bowen" } ], "receipts_outcome": [ { "block_hash": "HuqYrYsC7h2VERFMgFkqaNqSiFuTH9CA3uJr3BkyNxhF", "id": "FXMVxdhSUZaZftbmPJWaoqhEB9GrKB2oqg9Wgvuyvom8", "outcome": { "executor_id": "evgeny.lockup.m0", "gas_burnt": 3493189769144, "logs": ["Transferring 1000 to account @bowen"], "receipt_ids": [ "3Ad7pUygUegMUWUb1rEazfjnTaHfptXCABqKQ6WNq6Wa", "FDp8ovTf5uJYDFemW5op6ebjCT2n4CPExHYie3S1h4qp" ], "status": { "SuccessReceiptId": "3Ad7pUygUegMUWUb1rEazfjnTaHfptXCABqKQ6WNq6Wa" }, "tokens_burnt": "349318976914400000000" }, "proof": [ { "direction": "Right", "hash": "5WwHEszBcpfrHnt2VTvVDVnEEACNq5EpQdjz1aW9gTAa" } ] }, { "block_hash": "DJ6oK5FtPPSwksS6pKdEjFvHWAaSVocnVNLoyi8aYk1k", "id": "3Ad7pUygUegMUWUb1rEazfjnTaHfptXCABqKQ6WNq6Wa", "outcome": { "executor_id": "bowen", "gas_burnt": 223182562500, "logs": [], "receipt_ids": ["5DdQg9pfoJMX1q6bvhsjyyRihzA3sb9Uq5K1J7vK43Ze"], "status": { "SuccessValue": "" }, "tokens_burnt": "22318256250000000000" }, "proof": [ { "direction": "Right", "hash": "CXSXmKpDU8R3UUrBAsffWMeGfKanKqEHCQrHeZkR3RKT" }, { "direction": "Right", "hash": "2dNo7A1VHKBmMA86m1k3Z9DVXwWgQJGkKGRg8wUR3co9" } ] }, { "block_hash": "9cjUoqAksMbs7ZJ4CXiuwm8vppz9QctTwGmgwZ5mDmUA", "id": "5DdQg9pfoJMX1q6bvhsjyyRihzA3sb9Uq5K1J7vK43Ze", "outcome": { "executor_id": "bowen", "gas_burnt": 0, "logs": [], "receipt_ids": [], "status": { "SuccessValue": "" }, "tokens_burnt": "0" }, "proof": [] }, { "block_hash": "DJ6oK5FtPPSwksS6pKdEjFvHWAaSVocnVNLoyi8aYk1k", "id": "FDp8ovTf5uJYDFemW5op6ebjCT2n4CPExHYie3S1h4qp", "outcome": { "executor_id": "bowen", "gas_burnt": 0, "logs": [], "receipt_ids": [], "status": { "SuccessValue": "" }, "tokens_burnt": "0" }, "proof": [ { "direction": "Left", "hash": "A2Ry6NCeuK8WhRCWc41hy6uddadc5nLJ1NBX5wVYo3Yb" }, { "direction": "Right", "hash": "2dNo7A1VHKBmMA86m1k3Z9DVXwWgQJGkKGRg8wUR3co9" } ] } ], "status": { "SuccessValue": "" }, "transaction": { "actions": [ { "FunctionCall": { "args": "eyJhbW91bnQiOiIxMDAwIiwicmVjZWl2ZXJfaWQiOiJib3dlbiJ9", "deposit": "0", "gas": 100000000000000, "method_name": "transfer" } } ], "hash": "HEgnVQZfs9uJzrqTob4g2Xmebqodq9waZvApSkrbcAhd", "nonce": 77, "public_key": "ed25519:2f9Zv5kuyuPM5DCyEP5pSqg58NQ8Ct9uSRerZXnCS9fK", "receiver_id": "evgeny.lockup.m0", "signature": "ed25519:5v1hJuw5RppKGezJHBFU6z3hwmmdferETud9rUbwxVf6xSBAWyiod93Lezaq4Zdcp4zbukDusQY9PjhV47JVCgBx", "signer_id": "bowen" }, "transaction_outcome": { "block_hash": "9RX2pefXKw8M4EYjLznDF3AMvbkf9asAjN8ACK7gxKsa", "id": "HEgnVQZfs9uJzrqTob4g2Xmebqodq9waZvApSkrbcAhd", "outcome": { "executor_id": "bowen", "gas_burnt": 2428026088898, "logs": [], "receipt_ids": ["FXMVxdhSUZaZftbmPJWaoqhEB9GrKB2oqg9Wgvuyvom8"], "status": { "SuccessReceiptId": "FXMVxdhSUZaZftbmPJWaoqhEB9GrKB2oqg9Wgvuyvom8" }, "tokens_burnt": "242802608889800000000" }, "proof": [ { "direction": "Right", "hash": "DXf4XVmAF5jnjZhcxi1CYxGPuuQrcAmayq9X5inSAYvJ" } ] } } } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/transactions#what-could-go-wrong-3) section. --- ### Receipt by ID > Retrieves a receipt by its ID (as is, without a status or execution outcome). #### Parameters * `id` (integer; required): a request ID; unlike other chains, NEAR "dontcare" about a number you use (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request — `EXPERIMENTAL_receipt`. * `params` (array; required): * `receipt id` #### Request example ```shell curl -X POST https://rpc.ankr.com/near/YOUR_ANKR_API_KEY \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "EXPERIMENTAL_receipt", "params": { "receipt_id": "2EbembRPJhREPtmHCrGv3Xtdm3xoc5BMVYHm3b2kjvMY" } }' ``` #### Response example ```json { "id": "dontcare", "jsonrpc": "2.0", "result": { "predecessor_id": "bohdan.testnet", "receipt": { "Action": { "actions": [ { "Transfer": { "deposit": "1000000000000000000000000" } } ], "gas_price": "103000000", "input_data_ids": [], "output_data_receivers": [], "signer_id": "bohdan.testnet", "signer_public_key": "ed25519:DhC7rPNTBwWJtmVXs1U1SqJztkn9AWbj6jCmQtkrg3TA" } }, "receipt_id": "2EbembRPJhREPtmHCrGv3Xtdm3xoc5BMVYHm3b2kjvMY", "receiver_id": "frol.testnet" } } ``` For understanding what could go wrong and the error codes involved, refer to corresponding NEAR [docs](https://docs.near.org/api/rpc/transactions#what-could-go-wrong-4) section. --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/nervos_ckb/get/ title: Nervos CKB — get, tx, send, test source: docs/rpc-service/chains/chains-api/nervos_ckb/get.mdx --- # Nervos CKB — get, tx, send, test > API reference for [Nervos CKB](/rpc-service/chains/chains-api/nervos_ckb/). [All methods ->](/rpc-service/chains/chains-api/nervos_ckb/#methods) ## `get_tip_block_number` > Returns the highest block number in the canonical chain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (BlockNumber): the highest block number in the canonical chain, as a 0x-prefixed hex string. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_tip_block_number", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x12a69e1", "id": 1 } ``` --- ## `get_tip_header` > Returns the header with the highest block number in the canonical chain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): optionally a verbosity `` (`0x0` returns the serialized header; `0x1`, the default, returns a JSON header object). ### Returns
* `` (HeaderView): the block header, including `number`, `hash`, `parent_hash`, `timestamp`, `epoch`, `compact_target`, `dao`, `nonce`, `transactions_root`, `extra_hash`, `proposals_hash` and `version`. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_tip_header", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "compact_target": "0x1913ca98", "dao": "0x0be3ccb2b7279c59cd86a389ab882a00fe62c81b1474e9090068f4dfb7183707", "epoch": "0x524029e003810", "extra_hash": "0x6ce92f725a28bae121cf062051a95f6b843bc52c9ed75cd17d600f8efdeffd3f", "hash": "0xaa8d68b396f8a01449d829fef85c4065c83e6fa71ec7b1f066674ff752dd0d01", "nonce": "0x4826eb8b5c783719000000092f10020e", "number": "0x12a6ad1", "parent_hash": "0x395a24dc75784a8e0a08f712c1186b8e74bf3d6e6fe5c2a0592cdf443725dde6", "proposals_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": "0x19eb091b1a5", "transactions_root": "0x4343d4eec2b8d1d082fafc8cc056b250bb6ca853d99c5acdbc54555cbbcc7677", "version": "0x0" } } ``` --- ## `get_current_epoch` > Returns the epoch with the highest number in the canonical chain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (EpochView): * `number` (string): the epoch number. * `start_number` (string): the block number of the first block in the epoch. * `length` (string): the number of blocks in the epoch. * `compact_target` (string): the difficulty target of the epoch, in compact form. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_current_epoch", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "compact_target": "0x1913ca98", "length": "0x524", "number": "0x3810", "start_number": "0x12a6833" } } ``` --- ## `get_block_by_number` > Returns the block in the canonical chain with the specified block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (BlockNumber): the block number, as a 0x-prefixed hex string. 2. `` (optional): verbosity — `0x0` returns the serialized block; `0x2` (the default) returns a JSON block object. 3. `` (optional): `with_cycles` — if `true`, the response also includes the execution cycles of each transaction. ### Returns
* `` (BlockView): the block, containing a `header`, the `transactions` array, the `proposals` array and `uncles`. Returns `null` when there is no block at the given number. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_block_by_number", "params": ["0x12a6ad1"], "id": 1 }' ``` ### Response example (trimmed) ```json { "jsonrpc": "2.0", "id": 1, "result": { "header": { "compact_target": "0x1913ca98", "epoch": "0x524029e003810", "hash": "0xaa8d68b396f8a01449d829fef85c4065c83e6fa71ec7b1f066674ff752dd0d01", "number": "0x12a6ad1", "parent_hash": "0x395a24dc75784a8e0a08f712c1186b8e74bf3d6e6fe5c2a0592cdf443725dde6", "timestamp": "0x19eb091b1a5", "transactions_root": "0x4343d4eec2b8d1d082fafc8cc056b250bb6ca853d99c5acdbc54555cbbcc7677", "version": "0x0" }, "proposals": [], "transactions": [ { "cell_deps": [], "header_deps": [], "hash": "0x...", "inputs": [], "outputs": [], "outputs_data": [], "version": "0x0", "witnesses": [] } ], "uncles": [] } } ``` --- ## `get_block` > Returns the information about a block by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (H256): the block hash (32 bytes, 0x-prefixed). 2. `` (optional): verbosity — `0x0` or `0x2` (default). 3. `` (optional): `with_cycles`. ### Returns
* `` (BlockView): the block (same structure as [`get_block_by_number`](#get_block_by_number)). Returns `null` when the block is not found. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_block", "params": ["0xaa8d68b396f8a01449d829fef85c4065c83e6fa71ec7b1f066674ff752dd0d01"], "id": 1 }' ``` ### Response example A `BlockView` object, identical in shape to the [`get_block_by_number`](#get_block_by_number) response. --- ## `get_header` > Returns the information about a block header by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (H256): the block hash. 2. `` (optional): verbosity — `0x0` or `0x1` (default). ### Returns
* `` (HeaderView): the block header (same structure as [`get_tip_header`](#get_tip_header)). Returns `null` when the header is not found. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_header", "params": ["0xaa8d68b396f8a01449d829fef85c4065c83e6fa71ec7b1f066674ff752dd0d01"], "id": 1 }' ``` ### Response example A `HeaderView` object, identical in shape to the [`get_tip_header`](#get_tip_header) response. --- ## `get_header_by_number` > Returns the block header in the canonical chain with the specified block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (BlockNumber): the block number. 2. `` (optional): verbosity — `0x0` or `0x1` (default). ### Returns
* `` (HeaderView): the block header. Returns `null` when there is no block at the given number. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_header_by_number", "params": ["0x12a6ad1"], "id": 1 }' ``` ### Response example A `HeaderView` object, identical in shape to the [`get_tip_header`](#get_tip_header) response. --- ## `get_block_hash` > Returns the block hash of a block in the canonical chain by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (BlockNumber): the block number. ### Returns
* `` (H256): the block hash, or `null` when there is no block at the given number. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_block_hash", "params": ["0x12a6ad1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xaa8d68b396f8a01449d829fef85c4065c83e6fa71ec7b1f066674ff752dd0d01" } ``` --- ## `get_transaction` > Returns the information about a transaction by hash, including its status. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (H256): the transaction hash. 2. `` (optional): verbosity — `0x0`, `0x1` or `0x2` (default). 3. `` (optional): `only_committed` — if `true`, only returns the transaction if it has been committed on chain. ### Returns
* `` (TransactionWithStatus): * `transaction` (object): the transaction (or `null` depending on verbosity / status). * `cycles` (string): the consumed cycles, when available. * `tx_status` (object): `{ status, block_hash, block_number, reason }`. `status` is one of `pending`, `proposed`, `committed`, `unknown` or `rejected`. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_transaction", "params": ["0xa0 ... transaction hash ... 5b"], "id": 1 }' ``` ### Response example (trimmed) ```json { "jsonrpc": "2.0", "id": 1, "result": { "cycles": "0x219c", "transaction": { "hash": "0x...", "inputs": [], "outputs": [] }, "tx_status": { "block_hash": "0xaa8d68b396f8a01449d829fef85c4065c83e6fa71ec7b1f066674ff752dd0d01", "block_number": "0x12a6ad1", "reason": null, "status": "committed" } } } ``` --- ## `get_live_cell` > Returns the status of a cell. The RPC returns extra information if it is a live cell. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (OutPoint): `{ "tx_hash": "", "index": "" }` — the cell out point. 2. ``: `with_data` — if `true`, the response includes the cell data. ### Returns
* `` (CellWithStatus): * `cell` (object): the cell `output` and optional `data`, when the cell is live. * `status` (string): one of `live`, `dead` or `unknown`. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_live_cell", "params": [{ "index": "0x0", "tx_hash": "0xa0ef4eb5f4ce087db3ce8b58c1bb6c6f93a6c4d1c1f1f8f6f8b... " }, true], "id": 1 }' ``` ### Response example (trimmed) ```json { "jsonrpc": "2.0", "id": 1, "result": { "cell": { "data": { "content": "0x", "hash": "0x..." }, "output": { "capacity": "0x802665800", "lock": { "args": "0x", "code_hash": "0x...", "hash_type": "type" }, "type": null } }, "status": "live" } } ``` --- ## `get_consensus` > Returns various consensus parameters of the chain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (Consensus): consensus parameters, including `id`, `genesis_hash`, `primary_epoch_reward_halving_interval`, `epoch_duration_target`, `block_version`, `tx_version`, `max_block_cycles`, `max_block_bytes`, `dao_type_hash`, `secp256k1_blake160_sighash_all_type_hash`, `hardfork_features` and more. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_consensus", "params": [], "id": 1 }' ``` ### Response example (trimmed) ```json { "jsonrpc": "2.0", "id": 1, "result": { "id": "ckb", "genesis_hash": "0x92b197aa1fba0f63633922c61c92375c9c074a93e85963554f5499fe1450d0e5", "epoch_duration_target": "0x3840", "max_block_bytes": "0x91c08", "max_block_cycles": "0xd09dc300", "block_version": "0x0", "tx_version": "0x0", "dao_type_hash": "0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e" } } ``` --- ## `get_fee_rate_statistics` > Returns the fee rate statistics of confirmed blocks on the chain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): optionally a `` (hex) `target` — the number of confirmed blocks to look back over (default `0x15`). ### Returns
* ``: `{ "mean": "", "median": "" }` — the mean and median fee rate (Shannons per kilo-weight) over the target window, or `null` when no statistics are available. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_fee_rate_statistics", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "mean": "0x3e8", "median": "0x3e8" } } ``` --- ## `get_blockchain_info` > Returns general information about the chain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (ChainInfo): * `chain` (string): the network name (e.g. `ckb` for mainnet). * `difficulty` (string): the current difficulty. * `epoch` (string): the current epoch number (packed). * `median_time` (string): the median time of the last 37 blocks (milliseconds). * `is_initial_block_download` (boolean): whether the node is still in initial block download. * `alerts` (array): the active network alerts. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "get_blockchain_info", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "alerts": [], "chain": "ckb", "difficulty": "0xcef571d05179903", "epoch": "0x524029e003810", "is_initial_block_download": false, "median_time": "0x19eb08ed9db" } } ``` --- ## `tx_pool_info` > Returns the transaction pool information. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (TxPoolInfo): * `pending` (string), `proposed` (string), `orphan` (string): the number of transactions in each state. * `total_tx_size` (string), `total_tx_cycles` (string): the aggregate size and cycles of pool transactions. * `min_fee_rate` (string), `min_rbf_rate` (string): the minimum fee rate for acceptance / replace-by-fee. * `tip_hash` (string), `tip_number` (string): the chain tip the pool is based on. * `tx_size_limit` (string), `max_tx_pool_size` (string), `verify_queue_size` (string), `last_txs_updated_at` (string). ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx_pool_info", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "last_txs_updated_at": "0x19eb091d08b", "max_tx_pool_size": "0xaba9500", "min_fee_rate": "0x3e8", "min_rbf_rate": "0x5dc", "orphan": "0x0", "pending": "0x4", "proposed": "0x0", "tip_hash": "0xaa8d68b396f8a01449d829fef85c4065c83e6fa71ec7b1f066674ff752dd0d01", "tip_number": "0x12a6ad1", "total_tx_cycles": "0x67aa33", "total_tx_size": "0xc99", "tx_size_limit": "0x7d000", "verify_queue_size": "0x0" } } ``` --- ## `send_transaction` > Submits a new transaction into the transaction pool. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (Transaction): the transaction object (`version`, `cell_deps`, `header_deps`, `inputs`, `outputs`, `outputs_data`, `witnesses`). 2. `` (optional): `outputs_validator` — `passthrough` or `well_known_scripts_only` (the default). ### Returns
* `` (H256): the transaction hash. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "send_transaction", "params": [ { "version": "0x0", "cell_deps": [], "header_deps": [], "inputs": [], "outputs": [], "outputs_data": [], "witnesses": [] }, "passthrough" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xa0ef4eb5f4ce087db3ce8b58c1bb6c6f93a6c4d1c1f1f8f6f8b94c8f9b5e2c5b" } ``` --- ## `test_tx_pool_accept` > Tests whether the transaction pool would accept a transaction, without actually submitting it. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (Transaction): the transaction object (same structure as [`send_transaction`](#send_transaction)). 2. `` (optional): `outputs_validator` — `passthrough` or `well_known_scripts_only` (the default). ### Returns
* `` (EntryCompleted): `{ "cycles": "", "fee": "" }` — the consumed cycles and the fee the transaction would pay. ### Request example ```shell curl -X POST https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "test_tx_pool_accept", "params": [ { "version": "0x0", "cell_deps": [], "header_deps": [], "inputs": [], "outputs": [], "outputs_data": [], "witnesses": [] }, "passthrough" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "cycles": "0x219c", "fee": "0x16e" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/nervos_ckb/ title: Nervos CKB description: Nervos CKB (Common Knowledge Base) is the Layer 1, proof-of-work blockchain of the Nervos ecosystem. 16 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/nervos_ckb/index.mdx --- # Nervos CKB
> Nervos CKB API is available on [Web3 API platform](https://www.ankr.com/rpc/nervos). *Nervos CKB* (Common Knowledge Base) is the Layer 1, proof-of-work blockchain of the Nervos ecosystem. As the foundation of the ecosystem, it provides trust for all the layers built on top of it. CKB uses an improved Nakamoto consensus (NC-Max) and a generalized UTXO model — the *Cell model* — designed to maximize decentralization while remaining minimal, flexible, and secure. Its primary objective is to reliably preserve any data and assets stored therein. :::warning The **Nervos EVM / Polyjuice (Godwoken)** Layer 2 endpoint (`rpc.ankr.com/nervos`) has been **deprecated and removed**. Nervos officially sunset the Godwoken network starting **June 2025** (a strategic shift toward UTXO-native protocols such as RGB++), so the network is no longer operational upstream. See the official [Godwoken & Force Bridge sunset announcement](https://sunset.forcebridge.com/announcement). Only the native **Nervos CKB (Layer 1)** endpoint documented below is available. ::: In order for your Web3 application to interact with Nervos CKB — either by reading blockchain data or sending transactions to the network — it must connect to a CKB node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It uses JSON (RFC 4627) as data format. CKB exposes its JSON-RPC over `HTTPS` and `WSS`. Endpoint format: ```shell https://rpc.ankr.com/nervos_ckb/YOUR_ANKR_API_KEY ``` Official quick links: [Website](https://www.nervos.org/), [CKB Docs](https://docs.nervos.org/), [JSON-RPC reference](https://github.com/nervosnetwork/ckb/blob/develop/rpc/README.md), [GitHub](https://github.com/nervosnetwork/ckb) --- ## Methods supported
* [`get_tip_block_number`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_tip_block_number) — returns the highest block number in the canonical chain. * [`get_tip_header`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_tip_header) — returns the header with the highest block number in the canonical chain. * [`get_current_epoch`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_current_epoch) — returns the epoch with the highest number in the canonical chain. * [`get_block_by_number`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_block_by_number) — returns the block in the canonical chain with the specified block number. * [`get_block`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_block) — returns the information about a block by hash. * [`get_header`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_header) — returns the information about a block header by hash. * [`get_header_by_number`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_header_by_number) — returns the block header in the canonical chain with the specified block number. * [`get_block_hash`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_block_hash) — returns the block hash of a block in the canonical chain by block number. * [`get_transaction`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_transaction) — returns the information about a transaction by hash, including its status. * [`get_live_cell`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_live_cell) — returns the status of a cell, optionally with its data. * [`get_consensus`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_consensus) — returns various consensus parameters. * [`get_fee_rate_statistics`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_fee_rate_statistics) — returns the fee rate statistics of confirmed blocks. * [`get_blockchain_info`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_blockchain_info) — returns general information about the chain. * [`tx_pool_info`](/rpc-service/chains/chains-api/nervos_ckb/get/#tx_pool_info) — returns the transaction pool information. * [`send_transaction`](/rpc-service/chains/chains-api/nervos_ckb/get/#send_transaction) — submits a new transaction into the transaction pool. * [`test_tx_pool_accept`](/rpc-service/chains/chains-api/nervos_ckb/get/#test_tx_pool_accept) — tests whether the transaction pool would accept a transaction. :::tip CKB encodes integers as 0x-prefixed hexadecimal strings (e.g. block number `0x12a6ad1`). Block hashes and other byte fields are 0x-prefixed hex. ::: :::warning Node administration, mining and network-control methods are not exposed on the shared endpoint — e.g. `local_node_info`, `get_peers`, `get_banned_addresses`, `set_ban`, `sync_state`, `add_node`, `remove_node`, `clear_tx_pool`, `truncate`, `generate_block`, miner methods (`get_block_template`, `submit_block`) and `debug_*`. For dedicated access, contact Sales (`sales@ankr.com`) about the Enterprise plan. ::: --- ## Methods ### get, tx, send, test - [`get_tip_block_number`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_tip_block_number) - [`get_tip_header`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_tip_header) - [`get_current_epoch`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_current_epoch) - [`get_block_by_number`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_block_by_number) - [`get_block`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_block) - [`get_header`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_header) - [`get_header_by_number`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_header_by_number) - [`get_block_hash`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_block_hash) - [`get_transaction`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_transaction) - [`get_live_cell`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_live_cell) - [`get_consensus`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_consensus) - [`get_fee_rate_statistics`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_fee_rate_statistics) - [`get_blockchain_info`](/rpc-service/chains/chains-api/nervos_ckb/get/#get_blockchain_info) - [`tx_pool_info`](/rpc-service/chains/chains-api/nervos_ckb/get/#tx_pool_info) - [`send_transaction`](/rpc-service/chains/chains-api/nervos_ckb/get/#send_transaction) - [`test_tx_pool_accept`](/rpc-service/chains/chains-api/nervos_ckb/get/#test_tx_pool_accept) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/neura/ title: Neura description: Neura is a high-performance, EVM-compatible Layer 1 blockchain purpose-built for real-time decentralized… 29 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/neura/index.mdx --- # Neura
> Neura API is available on [Web3 API platform](https://www.ankr.com/rpc/neura). *Neura* is a high-performance, EVM-compatible Layer 1 blockchain purpose-built for real-time decentralized applications across DeFi and AI-driven systems. Built on the enterprise-grade Hyperledger Besu client and powered by the QBFT consensus mechanism, Neura delivers immediate transaction finality, fork resistance, and low-latency block production — making it ideal for applications that demand speed, consistency, and trust. In order for your Web3 application to interact with Neura — either by reading blockchain data or sending transactions to the network — it must connect to a Neura node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/neura/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/neura/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/neura/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/neura/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_protocolVersion`](/rpc-service/chains/chains-api/neura/web3/#eth_protocolversion) — returns the current protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/neura/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/neura/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/neura/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/neura/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/neura/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/neura/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/neura/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/neura/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/neura/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/neura/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/neura/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/neura/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/neura/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/neura/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/neura/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/neura/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/neura/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/neura/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/neura/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/neura/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/neura/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/neura/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/neura/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/neura/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/neura/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/neura/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/neura/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/neura/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/neura/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/neura/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/neura/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/neura/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/neura/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/neura/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/neura/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/neura/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/neura/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/neura/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/neura/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/neura/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/neura/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/neura/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/neura/web3-p2/ title: Neura — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/neura/web3-p2.mdx --- # Neura — web3, net, eth (2/3) > API reference for [Neura](/rpc-service/chains/chains-api/neura/). [All methods ->](/rpc-service/chains/chains-api/neura/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/neura/web3/) · 2 · [3](/rpc-service/chains/chains-api/neura/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x59C292054ace68C92168EF384BE832EB2e5E95A6", "data": "0x70a082310000000000000000000000005a93a3f8c5e3eae603b36e3e0805a2e2290b1e82" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "to": "0x59C292054ace68C92168EF384BE832EB2e5E95A6", "data": "0xa9059cbb0000000000000000000000005a93a3f8c5e3eae603b36e3e0805a2e2290b1e820000000000000000000000000000000000000000000000000000000000000003e8" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5454" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xc58c67dd8de272aced74bab363bdbfa2be7303a30e63208b03a6e0009f980215", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "number": "0xdb7ee", "hash": "0xc58c67dd8de272aced74bab363bdbfa2be7303a30e63208b03a6e0009f980215", "mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", "parentHash": "0x733cc3d0404da8ba51a82722ad5f78cc4f393b74d2a3c25a097f250e3851f33d", "nonce": "0x0000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "transactionsRoot": "0xf3a8d35560b824e364000044b4637ee20efa33e55bfd3403f0325baa8a5c9990", "stateRoot": "0x3385207e5ba927e6a40b0334d5ed793013f2993e6e4e597a2d415670c391b2ba", "receiptsRoot": "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa", "miner": "0x43896a0561bd4d0d1c7df2851376be9668af60ad", "difficulty": "0x1", "totalDifficulty": "0xdb7ef", "extraData": "0xf90395a00000000000000000000000000000000000000000000000000000000000000000f90111941b729a256cc740ecb21990fd36dac65e17c2c57194220a9ecdad232be681d77428d54a7ea221d452c49430aaaa51aa81bd960a3f23d59f354b51817762839443896a0561bd4d0d1c7df2851376be9668af60ad949cab26f4c7e832a80cac4d18d15d8ad63a0e747e94a9efd3140e2ec9c71574fb3964982a967396bdf594b4d43dd959831e0926ce8e3c5eb6d77cfa92398294ca7dbe50e19a489a347f31341ebac24d9f62628a94d9cd4bcd175f7c8f27b6b5e6f567b381da8e043c94def7ae376e41ee45265dba00577a08a699b4e49a94e204096b762315d9eda669632d69fbf9258128c394e691ad4f0929d4d425b7e3bb93a4663f3aa6465094f62f98c7aa75f08df1a641b96da74795207f3267c080f9025bb84139b6a84f1b7e44fb97501108cbb68b6093462a17f0d4da60441497f1f7abe9c166705659c2b5e4b1889334fd981ba824be8900d641c0c25db927d4cbb52aa97801b841d4dc3c8fa5caee7f56d9d33b4ea7f18dd0eb273ea0ddf515884783f5eba62d804e35fa30bbc974f973dd38f2ab9acc9148c5303372ed39e6227525578788412701b841149e5f17e9560bd826865010bcf1122ac5ff90a625c07d71cfc712cec1d16e061247b3991f61459ebaf021d486957da4f1a49cf3b563de95138debfb7c592fe400b8413d5514025cade28300f40d7689849f2e23a53661a68cb75ffdb8272e426458425fc7700f4797c263038cf3b9d0ee750561e1e1f7d24aed20b2aa2065bf18c77e01b841f2d4dee7b7ec1aa077f51b44e235f7a5e5e0930d49c38e90eda2b616a446127e08d3c9eaf791ce9557eccac411aa19c7f3a01f2243732eeaac1d1fb16e022c9c01b8414f8eac7fcf5685f046cdf7f1bb882ed290944f05ebd2559ce2e43c9696e9b1cb62ce1a8b2e319ce0649bc473441881736be48c0db80012602f78d643c1ed16a900b841577a347e9deaa650d2091e07a7f3692630aa424db6f85dd43c1156758527b0a91c136b259475824494d930f9c981e1c2994408a6b312ff7b464393b9b50f215e00b841ee9538d88ffb3746af230ebd3204df04fdf98f72defcdf8a48c111acaa349b9704409e75b5a2bcfa5caa83f6a2e2b95497c4180f0751aa4dda72d2fcd2b6fddb01b8419bf978077a260ce70f5567c0a8b2a14a5974ddd40affc137d235e7da9f0253b6704f41fcd65ad8fbaa2f0795e980fa64913a3df5502036f16601e60c9068cfdb01", "baseFeePerGas": "0x7", "size": "0x610", "gasLimit": "0x29b92700", "gasUsed": "0x5208", "timestamp": "0x6838556e", "uncles": [], "transactions": [ "0x9a13c8f21e64d586a9318fcf6327dbcd7d94b8ce0819f02b0a874b7730339a54" ] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "number": "0xdb868", "hash": "0xec46dabf28655b542595c0ae57593c56d4d29bb5ed9a262693776739e9ff36a5", "mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", "parentHash": "0x67907b4d6f6dc569f0342586b392ec351ebb8d51a40249642ec97fc06c0cf8e7", "nonce": "0x0000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "stateRoot": "0x99b09f713692f64fd935157b8e7772185c6860191f28e8db5744d3b11b20d471", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "miner": "0x9cab26f4c7e832a80cac4d18d15d8ad63a0e747e", "difficulty": "0x1", "totalDifficulty": "0xdb869", "extraData": "0xf90395a00000000000000000000000000000000000000000000000000000000000000000f90111941b729a256cc740ecb21990fd36dac65e17c2c57194220a9ecdad232be681d77428d54a7ea221d452c49430aaaa51aa81bd960a3f23d59f354b51817762839443896a0561bd4d0d1c7df2851376be9668af60ad949cab26f4c7e832a80cac4d18d15d8ad63a0e747e94a9efd3140e2ec9c71574fb3964982a967396bdf594b4d43dd959831e0926ce8e3c5eb6d77cfa92398294ca7dbe50e19a489a347f31341ebac24d9f62628a94d9cd4bcd175f7c8f27b6b5e6f567b381da8e043c94def7ae376e41ee45265dba00577a08a699b4e49a94e204096b762315d9eda669632d69fbf9258128c394e691ad4f0929d4d425b7e3bb93a4663f3aa6465094f62f98c7aa75f08df1a641b96da74795207f3267c080f9025bb84139b6d3b29f86d90324acec4f44190c60be0428478be875bbeaf24e42a797fc3407755b98ed3ddf4998f5baacbaa3a77fd347a66c4963a47dfff9140b59f964f700b841a35704c76f6c69dd65f7b2758dba6bf68c0714e375c753fbdce7b06e8bc8184f23249c8344d328df7b18697ec3a02abc083e2d446c3ca271204f8a663d5f3e8e01b841922c84e4b6c63f013eb998e8f394e15b4176f1fbd23844daa3ab8ab19d3625a715bb96e921b794a2a7abdaa471b676eb6f0c663f0b5aa3aecec7ce1c4392204201b841794c88ea2764647d01aa26a126a9be542059c7bf6f08229643b05682785322507e0f9a9052b6172c701000beffd89a90d270216a38a4787de32097552d09538900b841a5f283991428adebe0236350b6b8ad6f948bc5856ae161ddcbd943fb3954cb951b6abec73677f2fdf45ff0d4c126d48aaf776354b5d5c0bdd5b88a37badb28ff00b8410c133c9b92d39dcf13d53bdae9b434f40ccd407c6e9a4fd6d73f42a9527ecd1367259e9b0001ecbe5f16786315c4007a64e9f2e7e9ca04bb700fb2ea73067b3600b841ff66c61a7ecc74cb1485d453b3183f9fd3af383cac64e9eacc26690eaae989c64866a75921372df23e6248d4a50f6fff1c1f0b51758bebe58950ba71d29c30ad01b8417e429f90dd61c0ec53f53653ce0af625a1ce4d5d869491410c4208388f4d520329611861d8bf28c393a59a8307c732db4d60cc19e63158ca39b04d2fc5187fc401b84178e9f688af147e7f535ef57d15594d694893ac8d784ed5d85854ec120245ab4054f91424e72ac4a7151c01528738717d1fdb33018bd4ef317ffe2ba1e0757d0501", "baseFeePerGas": "0x7", "size": "0x59b", "gasLimit": "0x29b92700", "gasUsed": "0x0", "timestamp": "0x683856ba", "uncles": [], "transactions": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x9a13c8f21e64d586a9318fcf6327dbcd7d94b8ce0819f02b0a874b7730339a54"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "accessList": [], "blockHash": "0xc58c67dd8de272aced74bab363bdbfa2be7303a30e63208b03a6e0009f980215", "blockNumber": "0xdb7ee", "chainId": "0x10b", "from": "0x59c292054ace68c92168ef384be832eb2e5e95a6", "gas": "0x5208", "gasPrice": "0x7", "maxPriorityFeePerGas": "0x7", "maxFeePerGas": "0x7", "hash": "0x9a13c8f21e64d586a9318fcf6327dbcd7d94b8ce0819f02b0a874b7730339a54", "input": "0x", "nonce": "0xad", "to": "0x59c292054ace68c92168ef384be832eb2e5e95a6", "transactionIndex": "0x0", "type": "0x2", "value": "0x16345785d8a0000", "yParity": "0x1", "v": "0x1", "r": "0x3b183e4d15b04c56c79b1db6e9441585276a7b730795d7269f167d097173f1b1", "s": "0x559886429e5c1d92093d09779287989056e21f50f703074bec804dc3ba761832" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/neura/web3-p3/ title: Neura — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/neura/web3-p3.mdx --- # Neura — web3, net, eth (3/3) > API reference for [Neura](/rpc-service/chains/chains-api/neura/). [All methods ->](/rpc-service/chains/chains-api/neura/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/neura/web3/) · [2](/rpc-service/chains/chains-api/neura/web3-p2/) · 3 ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xc58c67dd8de272aced74bab363bdbfa2be7303a30e63208b03a6e0009f980215", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "accessList": [], "blockHash": "0xc58c67dd8de272aced74bab363bdbfa2be7303a30e63208b03a6e0009f980215", "blockNumber": "0xdb7ee", "chainId": "0x10b", "from": "0x59c292054ace68c92168ef384be832eb2e5e95a6", "gas": "0x5208", "gasPrice": "0x7", "maxPriorityFeePerGas": "0x7", "maxFeePerGas": "0x7", "hash": "0x9a13c8f21e64d586a9318fcf6327dbcd7d94b8ce0819f02b0a874b7730339a54", "input": "0x", "nonce": "0xad", "to": "0x59c292054ace68c92168ef384be832eb2e5e95a6", "transactionIndex": "0x0", "type": "0x2", "value": "0x16345785d8a0000", "yParity": "0x1", "v": "0x1", "r": "0x3b183e4d15b04c56c79b1db6e9441585276a7b730795d7269f167d097173f1b1", "s": "0x559886429e5c1d92093d09779287989056e21f50f703074bec804dc3ba761832" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0xDB7EE", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "accessList": [], "blockHash": "0xc58c67dd8de272aced74bab363bdbfa2be7303a30e63208b03a6e0009f980215", "blockNumber": "0xdb7ee", "chainId": "0x10b", "from": "0x59c292054ace68c92168ef384be832eb2e5e95a6", "gas": "0x5208", "gasPrice": "0x7", "maxPriorityFeePerGas": "0x7", "maxFeePerGas": "0x7", "hash": "0x9a13c8f21e64d586a9318fcf6327dbcd7d94b8ce0819f02b0a874b7730339a54", "input": "0x", "nonce": "0xad", "to": "0x59c292054ace68c92168ef384be832eb2e5e95a6", "transactionIndex": "0x0", "type": "0x2", "value": "0x16345785d8a0000", "yParity": "0x1", "v": "0x1", "r": "0x3b183e4d15b04c56c79b1db6e9441585276a7b730795d7269f167d097173f1b1", "s": "0x559886429e5c1d92093d09779287989056e21f50f703074bec804dc3ba761832" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x9a13c8f21e64d586a9318fcf6327dbcd7d94b8ce0819f02b0a874b7730339a54"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xc58c67dd8de272aced74bab363bdbfa2be7303a30e63208b03a6e0009f980215", "blockNumber": "0xdb7ee", "contractAddress": null, "cumulativeGasUsed": "0x5208", "from": "0x59c292054ace68c92168ef384be832eb2e5e95a6", "gasUsed": "0x5208", "effectiveGasPrice": "0x7", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x59c292054ace68c92168ef384be832eb2e5e95a6", "transactionHash": "0x9a13c8f21e64d586a9318fcf6327dbcd7d94b8ce0819f02b0a874b7730339a54", "transactionIndex": "0x0", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc58c67dd8de272aced74bab363bdbfa2be7303a30e63208b03a6e0009f980215", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x9cAB26F4C7E832A80CAC4d18d15d8aD63a0e747e"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": [], "id": 1 } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/neura/web3/ title: Neura — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/neura/web3.mdx --- # Neura — web3, net, eth (1/3) > API reference for [Neura](/rpc-service/chains/chains-api/neura/). [All methods ->](/rpc-service/chains/chains-api/neura/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/neura/web3-p2/) · [3](/rpc-service/chains/chains-api/neura/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "besu/v25.5-develop-9ab8bc4/linux-x86_64/openjdk-java-21", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "267" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x44" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xdb514" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x59C292054ace68C92168EF384BE832EB2e5E95A6", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xde0b6b336740910" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x59C292054ace68C92168EF384BE832EB2e5E95A6", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x59C292054ace68C92168EF384BE832EB2e5E95A6", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xae" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x626a3d16c6222b00f28029460e57bea80916070af513f686f1118ac2abee3413"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x1", "id": 1 } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xDB0A8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x626a3d16c6222b00f28029460e57bea80916070af513f686f1118ac2abee3413"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x59C292054ace68C92168EF384BE832EB2e5E95A6", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/neura/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x9f8d8f6d5c2baf89407bcd97b7b3d763de98146f5762eae39f18b88b15f1f5da" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/optimism/eth-p2/ title: Optimism — eth (2/2) source: docs/rpc-service/chains/chains-api/optimism/eth-p2.mdx --- # Optimism — eth (2/2) > API reference for [Optimism](/rpc-service/chains/chains-api/optimism/). [All methods ->](/rpc-service/chains/chains-api/optimism/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/optimism/eth/) · 2 ## `eth_getTransactionByHash` > Retrieves preconfirmed transactions by hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the hash of the transaction to retrieve. ### Returns The transaction object if found (including when present in a Flashblock preconfirmation); null if the transaction is unknown. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xd309dcddf89e471a710094cc28be86f66566ae5cd7162ce1f7a3c45df65772d4"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "type": "0x2", "chainId": "0xaa37dc", "nonce": "0x34c", "gas": "0x28e07", "maxFeePerGas": "0x596830f4", "maxPriorityFeePerGas": "0x59682f00", "to": "0xa374602fdccb9807d834598f0b2e2fa9c14646f7", "value": "0x2386f26fc10000", "accessList": [], "input": "0xa28d34940000000000000000000000000000000000000000000000000000000000000140082cee98f9a18608826f76ecfbf227b79cd652eb44572300b9880260b9ed137e00000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000009d4b000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000ca000000000000000000000000b64db3a171752f235e7156ba6590771c4a9358fb29aabec29925d19149012125ce17d62a67fcac8d5950f9dd33cb615b3470d059000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000000510100000000000000ca00009d4b000000000000000000000000000000000000000000000000000000000000000100009d28000000000000000000000000b64db3a171752f235e7156ba6590771c4a9358fb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000412fb2113f9109b2fb642f4e25acab3f5b3faf03b291c24d3cc7901169eb8e198e67944d2f1e00932877505a9202b40a79f0cd175d30b3c670bf0adbef4a99294f1c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000028000000000000000000000000f0970f5bb0968746d77fb3dcecf480bd414e06ed00000000000013880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "r": "0x659374c64f58415582526fa3ad1d0ea977b3a7852c3d22a139a50b548db02230", "s": "0x7b64cfcfa0cc294f6ba90a0779f3c15bb0375acf73dfbaeec116e4915eddee1c", "yParity": "0x0", "v": "0x0", "hash": "0xd309dcddf89e471a710094cc28be86f66566ae5cd7162ce1f7a3c45df65772d4", "blockHash": "0xe6c8a925882b5e982909257ec838d202d14dba64489420a1db09a33966c134e2", "blockNumber": "0x1ec2753", "transactionIndex": "0x1", "from": "0xf0970f5bb0968746d77fb3dcecf480bd414e06ed", "gasPrice": "0x59682ffa" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/optimism/eth/ title: Optimism — eth (1/2) source: docs/rpc-service/chains/chains-api/optimism/eth.mdx --- # Optimism — eth (1/2) > API reference for [Optimism](/rpc-service/chains/chains-api/optimism/). [All methods ->](/rpc-service/chains/chains-api/optimism/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/optimism/eth-p2/) ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x2B901D", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either a hex of the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x5Da70A90CaAf7015DE9754709400a97A988476DB"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- ## `eth_getBlockByNumber` > Use the `pending` tag to retrieve the latest Flashblock. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (tag; required): use the `pending` tag to retrieve the latest Flashblock. 2. `` (required): if `true` — returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns Retrieves the latest Flashblock object. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["pending", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "hash": "0x6d2235b907f1b9bebc438295e8b463350d2136921b064b7b31d2ce42d4d99c27", "parentHash": "0x20ee9c451a2219c826dd3700174aff97555d4808ec87f8e47619de5166962529", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x4200000000000000000000000000000000000011", "stateRoot": "0x93c4bac442017a87354b6ba55f498cd109681dab6b70d099a219123eb65b9543", "transactionsRoot": "0xd7c029100fe389472c79fdaeb96f7666ac908d65985f0186dc816ed065571212", "receiptsRoot": "0x1764372c2fc041df71a78317a4b079715f8f9e9ebe1020555713e172590ec9d3", "logsBloom": "0x00000000000020000000000100000000100010000000021000020000000000000000040000000000000200000200000000040008000000000000000000000000000000000000000000000058000000000000000000000000000000000000000000000000000000080000000000000000000000000010000000200010008000200000000000000000000002000000000800000000000001000000040000000000002002002010000000000000000000000000000040000000000800000000000000000002000000000000000000000000020010000020000000002000002000000000000000000000000000000010000800000000000000000000000100000002", "difficulty": "0x0", "number": "0x1ec2650", "gasLimit": "0x2625a00", "gasUsed": "0x5a59a", "timestamp": "0x68af284c", "extraData": "0x00000000fa00000002", "mixHash": "0x2bc4e5b75df9b6d0aea4e90ab0457163c75a42c4ac388e702a0c14abca08ef48", "nonce": "0x0000000000000000", "baseFeePerGas": "0xfa", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0", "excessBlobGas": "0x0", "uncles": [], "transactions": [ "0x97efaef5b0d4e71d082de8fbf5632523c7135112997ce61f174a0884617e28e0", "0xd04f7ee714c5e6211b294e8d936ebdcec2040b72281a3a82c22d22bec558af3c", "0xe7f598a737d67d8a27ddcac0091ff5ca8a3bc1fcb5bee910f9b67e9f3540232d" ] } } ``` --- ## `eth_getTransactionReceipt` > Retrieves the receipts for preconfirmed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the transaction hash. ### Returns Returns preconfirmation-aware receipt data if the transaction is already included in a Flashblock. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x5a361f07e90d1745dfdffc005a41d336fe10581473195b88466dcbb998c39444"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "type": "0x2", "status": "0x1", "cumulativeGasUsed": "0xed5781", "logs": [ { "address": "0x09526c5844f836f4ef326924d8aa484f8cb135a1", "topics": [ "0xf67870b75d64e9a5f00100af39eb94911d9399b05f9df6d6db0cafc61128d5a4", "0x8a11667d4177561b72e3ba6db5f102ffb49778c6e7d66910d295cf2ef7db711e" ], "data": "0x", "blockHash": "0x874c8b5d774c45a4e276a96884a8e43128c27b7116954ef0357a95090fbbd724", "blockNumber": "0x1ec2729", "blockTimestamp": "0x68af29fe", "transactionHash": "0x5a361f07e90d1745dfdffc005a41d336fe10581473195b88466dcbb998c39444", "transactionIndex": "0x5", "logIndex": "0x1d2", "removed": false } ], "logsBloom": "0x00000000000020000000000100000000000010000000021000000000000000000000040000000000000200000000000000000008000000000000000000000000000000000000000000000058000000000000000000000000800000000000000000000000000000000000000000000000000000000010000000200010000000000000000000000000000002800000000800000000000001000000000000000000000002000000000000000000000000000000000040000000010000000000000000000002000000000000000000000000020010000020000000000000002000000000000000000000000000000000000800000000000000000000000100000002", "transactionHash": "0x5a361f07e90d1745dfdffc005a41d336fe10581473195b88466dcbb998c39444", "transactionIndex": "0x5", "blockHash": "0x874c8b5d774c45a4e276a96884a8e43128c27b7116954ef0357a95090fbbd724", "blockNumber": "0x1ec2729", "gasUsed": "0x2a7dd", "effectiveGasPrice": "0xf433a", "from": "0xeee38505c47acba0c866df7265bd3e25da596b27", "to": "0x09526c5844f836f4ef326924d8aa484f8cb135a1", "contractAddress": null, "l1GasPrice": "0x721c2b", "l1GasUsed": "0x319e", "l1Fee": "0x2b0adac9", "l1BaseFeeScalar": "0x1db0", "l1BlobBaseFee": "0x100", "l1BlobBaseFeeScalar": "0xd2730" } } ``` --- ## `eth_getBalance` > Use the `pending` tag to retrieve the address balance in the latest Flashblock. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (required): the address to check the balance for. 2. `` (tag; required): use the `pending` tag to retrieve the address balance in the latest Flashblock. ### Returns The account balance in wei (hex-encoded string). ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xeeE38505C47acBa0C866df7265bd3E25DA596b27", "pending"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x13ad6697d3b4efea" } ``` --- ## `eth_getTransactionCount` > Use the `pending` tag to retrieve the address nonce in the latest Flashblock. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (required): the account address to query. 2. `` (tag; required): use `pending` to retrieve the nonce including the latest Flashblock state. ### Returns The transaction count (nonce) of the given address, returned as a hex-encoded integer. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xf0970f5bb0968746d77fb3dCeCF480Bd414E06ED", "pending"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x352" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/optimism/ title: Optimism description: Optimism is a fast, stable, and scalable L2 blockchain built by Ethereum developers, for Ethereum developers. 34 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/optimism/index.mdx --- # Optimism
> Optimism API is available on [Web3 API platform](https://www.ankr.com/rpc/optimism). *Optimism* is a fast, stable, and scalable L2 blockchain built by Ethereum developers, for Ethereum developers. Built as a minimal extension to existing Ethereum software, Optimism’s EVM-equivalent architecture scales your Ethereum apps without surprises. If it works on Ethereum, it works on Optimism at a fraction of the cost. In order for your Web3 application to interact with Optimism — either by reading blockchain data or sending transactions to the network — it must connect to an Optimism node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. For Optimism, we support the following methods: * [EVM JSON-RPC methods](/rpc-service/chains/chains-api/optimism/#evm-json-rpc-methods) * [Flashblocks methods](/rpc-service/chains/chains-api/optimism/#flashblocks-methods) --- ## EVM JSON-RPC methods
* [`web3_clientVersion`](/rpc-service/chains/chains-api/optimism/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/optimism/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/optimism/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/optimism/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_protocolversion`](/rpc-service/chains/chains-api/optimism/web3/#eth_protocolversion) — returns the current Ethereum protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/optimism/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/optimism/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/optimism/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/optimism/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/optimism/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/optimism/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/optimism/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/optimism/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/optimism/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/optimism/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/optimism/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/optimism/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/optimism/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/optimism/web3-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/optimism/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/optimism/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/optimism/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/optimism/eth/#eth_getlogs) — returns logs matching the parameters specified. --- ## Flashblocks methods Flashblocks is a core Optimism feature that provides preconfirmation of the upcoming block's transaction ordering (~250 milliseconds) before the full block is sealed (~2 seconds). This enables ultra-fast transaction feedback, allowing applications to deliver instant and interactive user experiences. Flashblocks are particularly valuable for high-frequency trading platforms, real-time games, live dashboards, and other latency-sensitive use cases where even a brief delay feels disruptive. Flashblocks are integrated directly into Optimism’s block production process, therefore developers gain the advantages of low-latency feedback without compromising security or reliability. The result is a seamless foundation for applications that demand speed, responsiveness, and trust. The following RPC methods can return Flashblocks specific data: * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_getblockbynumber) — with `pending`, retrieves the latest Flashblock. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/optimism/web3-p3/#eth_gettransactionreceipt) — retrieves receipts for preconfirmed transactions. * [`eth_getBalance`](/rpc-service/chains/chains-api/optimism/web3/#eth_getbalance) — with `pending`, retrieves the address balance in the latest Flashblock. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/optimism/web3/#eth_gettransactioncount) — with `pending`, retrieves the address nonce in the latest Flashblock. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_gettransactionbyhash) — retrieves preconfirmed transactions by hash. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/optimism/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/optimism/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/optimism/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/optimism/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/optimism/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/optimism/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/optimism/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/optimism/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/optimism/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/optimism/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/optimism/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/optimism/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/optimism/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/optimism/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/optimism/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/optimism/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/optimism/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/optimism/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/optimism/web3-p3/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/optimism/web3-p3/#eth_gettransactionreceipt) ### eth - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/optimism/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/optimism/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/optimism/eth/#eth_getlogs) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/optimism/web3-p3/#eth_gettransactionreceipt) - [`eth_getBalance`](/rpc-service/chains/chains-api/optimism/web3/#eth_getbalance) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/optimism/web3/#eth_gettransactioncount) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/optimism/web3-p2/#eth_gettransactionbyhash) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/optimism/web3-p2/ title: Optimism — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/optimism/web3-p2.mdx --- # Optimism — web3, net, eth (2/3) > API reference for [Optimism](/rpc-service/chains/chains-api/optimism/). [All methods ->](/rpc-service/chains/chains-api/optimism/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/optimism/web3/) · 2 · [3](/rpc-service/chains/chains-api/optimism/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":"0x07f327929A3A3131EB4BE83f784DBD3E5C2698f8"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xcf08" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x6326ed6707a6c28b52994295610963173655a1d127ea637f174ed733d66d4824", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x2", "extraData": "0xd98301090a846765746889676f312e31352e3133856c696e7578000000000000960f93ea46e2665a34c02840497b8cb8507574e76bae487c9e4d72a8c72313f408c9d460e9a0974d2180f906c3057357afe35482ce26338ba6c85427f16aa60d00", "gasLimit": "0xe4e1c0", "gasUsed": "0x1d969", "hash": "0x6326ed6707a6c28b52994295610963173655a1d127ea637f174ed733d66d4824", "logsBloom": "0x04000000000000000000001001000000000000000020000000000000000200000000000000000000000000000000000000000000000000800000000040000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000008000000800000000000000000000000010000000000000000000000000000000000000000000000000000000000000010000000000000000800000000000400102000000000000000000000000000000000100000000000002020000000000000000000000000000000002000000000200800020000000000000000000200000000000000000000000008000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x4777962", "parentHash": "0xc1c52c72a20f9717472d2682205ff9a2e26e7450af0e3c70f45c65e695e27916", "receiptsRoot": "0x30362eab5823888eaf08ea4ec8c2bf7856d7bfeba9eb98cad0c1a6de92ca754a", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x337", "stateRoot": "0x7fdbea84428c764d4a8757e6057046dfcd15f0f482a57a51f1f3659c4b1059ce", "timestamp": "0x63ef4ee7", "totalDifficulty": "0x8eef2c5", "transactions": [ "0x8fcf92cce7a7a7803a18737d5ead11ab3afffd8394e8ee1fb8ccfd7227d1cdbd" ], "transactionsRoot": "0x6dc519ebb4d0acbdbea7a7e676264e66f22cd847016ce584ff20259a00bb74a3", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x4777962", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x2", "extraData": "0xd98301090a846765746889676f312e31352e3133856c696e7578000000000000960f93ea46e2665a34c02840497b8cb8507574e76bae487c9e4d72a8c72313f408c9d460e9a0974d2180f906c3057357afe35482ce26338ba6c85427f16aa60d00", "gasLimit": "0xe4e1c0", "gasUsed": "0x1d969", "hash": "0x6326ed6707a6c28b52994295610963173655a1d127ea637f174ed733d66d4824", "logsBloom": "0x04000000000000000000001001000000000000000020000000000000000200000000000000000000000000000000000000000000000000800000000040000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000008000000800000000000000000000000010000000000000000000000000000000000000000000000000000000000000010000000000000000800000000000400102000000000000000000000000000000000100000000000002020000000000000000000000000000000002000000000200800020000000000000000000200000000000000000000000008000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x4777962", "parentHash": "0xc1c52c72a20f9717472d2682205ff9a2e26e7450af0e3c70f45c65e695e27916", "receiptsRoot": "0x30362eab5823888eaf08ea4ec8c2bf7856d7bfeba9eb98cad0c1a6de92ca754a", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x337", "stateRoot": "0x7fdbea84428c764d4a8757e6057046dfcd15f0f482a57a51f1f3659c4b1059ce", "timestamp": "0x63ef4ee7", "totalDifficulty": "0x8eef2c5", "transactions": [ "0x8fcf92cce7a7a7803a18737d5ead11ab3afffd8394e8ee1fb8ccfd7227d1cdbd" ], "transactionsRoot": "0x6dc519ebb4d0acbdbea7a7e676264e66f22cd847016ce584ff20259a00bb74a3", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x635add970f86930850511ed1a490512d72135ea255f9e2e37b17ab4e4331f726"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa2456a6d9186112c41e8e00a182a390d0453cd97bdbd0702f362c75db4f11703", "blockNumber": "0x4777969", "from": "0xf9e8466141d032aaae3306227bb34c8278737425", "gas": "0x73347", "gasPrice": "0xf4240", "hash": "0x635add970f86930850511ed1a490512d72135ea255f9e2e37b17ab4e4331f726", "input": "0xd294f093", "nonce": "0x4c", "to": "0x4a16a42407aa491564643e1dfc1fd50af29794ef", "transactionIndex": "0x0", "value": "0x0", "v": "0x37", "r": "0xf0d949424a51f2f1e2f61fd095588d42ad89f0b861cdb1d16f3d2471bb17a3e", "s": "0x285287ca022d5a057cc3c498f7bab00340379544db9064f81c7933cab48cda79", "queueOrigin": "sequencer", "l1TxOrigin": null, "l1BlockNumber": "0xfe05cd", "l1Timestamp": "0x63ef4ef6", "index": "0x4777968", "queueIndex": null, "rawTransaction": "0xf8674c830f424083073347944a16a42407aa491564643e1dfc1fd50af29794ef8084d294f09337a00f0d949424a51f2f1e2f61fd095588d42ad89f0b861cdb1d16f3d2471bb17a3ea0285287ca022d5a057cc3c498f7bab00340379544db9064f81c7933cab48cda79" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x6326ed6707a6c28b52994295610963173655a1d127ea637f174ed733d66d4824", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x6326ed6707a6c28b52994295610963173655a1d127ea637f174ed733d66d4824", "blockNumber": "0x4777962", "from": "0x7e9c7856d6d5c676bc4e8ba916fb9e0d9f56c0e7", "gas": "0x1f2d4", "gasPrice": "0xf4240", "hash": "0x8fcf92cce7a7a7803a18737d5ead11ab3afffd8394e8ee1fb8ccfd7227d1cdbd", "input": "0x3a1b1d570000000000000000000000007e9c7856d6d5c676bc4e8ba916fb9e0d9f56c0e700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x11", "to": "0xf2d409bc24300f248fdd3b1e067de24be28abb85", "transactionIndex": "0x0", "value": "0x38d7ea4c68000", "v": "0x37", "r": "0xfc37422e663092cda2f59aeb848ec306d503c7a09a074f778014168bf718aeb2", "s": "0x7eeb40d7d0c95fba51d096560a4aa3a47d5803ab54d98bd39209ac298ecd3039", "queueOrigin": "sequencer", "l1TxOrigin": null, "l1BlockNumber": "0xfe05cd", "l1Timestamp": "0x63ef4ee7", "index": "0x4777961", "queueIndex": null, "rawTransaction": "0xf8cf11830f42408301f2d494f2d409bc24300f248fdd3b1e067de24be28abb8587038d7ea4c68000b8643a1b1d570000000000000000000000007e9c7856d6d5c676bc4e8ba916fb9e0d9f56c0e70000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000037a0fc37422e663092cda2f59aeb848ec306d503c7a09a074f778014168bf718aeb2a07eeb40d7d0c95fba51d096560a4aa3a47d5803ab54d98bd39209ac298ecd3039" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/optimism/web3-p3/ title: Optimism — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/optimism/web3-p3.mdx --- # Optimism — web3, net, eth (3/3) > API reference for [Optimism](/rpc-service/chains/chains-api/optimism/). [All methods ->](/rpc-service/chains/chains-api/optimism/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/optimism/web3/) · [2](/rpc-service/chains/chains-api/optimism/web3-p2/) · 3 ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x4777962", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x6326ed6707a6c28b52994295610963173655a1d127ea637f174ed733d66d4824", "blockNumber": "0x4777962", "from": "0x7e9c7856d6d5c676bc4e8ba916fb9e0d9f56c0e7", "gas": "0x1f2d4", "gasPrice": "0xf4240", "hash": "0x8fcf92cce7a7a7803a18737d5ead11ab3afffd8394e8ee1fb8ccfd7227d1cdbd", "input": "0x3a1b1d570000000000000000000000007e9c7856d6d5c676bc4e8ba916fb9e0d9f56c0e700000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x11", "to": "0xf2d409bc24300f248fdd3b1e067de24be28abb85", "transactionIndex": "0x0", "value": "0x38d7ea4c68000", "v": "0x37", "r": "0xfc37422e663092cda2f59aeb848ec306d503c7a09a074f778014168bf718aeb2", "s": "0x7eeb40d7d0c95fba51d096560a4aa3a47d5803ab54d98bd39209ac298ecd3039", "queueOrigin": "sequencer", "l1TxOrigin": null, "l1BlockNumber": "0xfe05cd", "l1Timestamp": "0x63ef4ee7", "index": "0x4777961", "queueIndex": null, "rawTransaction": "0xf8cf11830f42408301f2d494f2d409bc24300f248fdd3b1e067de24be28abb8587038d7ea4c68000b8643a1b1d570000000000000000000000007e9c7856d6d5c676bc4e8ba916fb9e0d9f56c0e70000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000037a0fc37422e663092cda2f59aeb848ec306d503c7a09a074f778014168bf718aeb2a07eeb40d7d0c95fba51d096560a4aa3a47d5803ab54d98bd39209ac298ecd3039" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x33bf901ebb3e623a06069dbffd91eeb32e5355f88b500e18b7e35ae643ccaa85"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xba3b252e1c01a6519c8e7e10889ef856daebae7be561cd209df5c9f371442b3d", "blockNumber": "0x4777963", "contractAddress": null, "cumulativeGasUsed": "0x196bc", "from": "0xb1a396af608a464344c6d61894260144419bcfb3", "gasUsed": "0x196bc", "l1Fee": "0x6422c2699180", "l1FeeScalar": "1", "l1GasPrice": "0x589ffb0e0", "l1GasUsed": "0x1214", "logs": [ { "address": "0x4200000000000000000000000000000000000006", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000068f5c0a2de713a54991e01858fd27a3832401849", "0x000000000000000000000000ff8c6e782bdbceba8bd0ee7ea2556ea7df580b9b" ], "data": "0x000000000000000000000000000000000000000000000000190fc71d7d5ef813", "blockNumber": "0x4777963", "transactionHash": "0x33bf901ebb3e623a06069dbffd91eeb32e5355f88b500e18b7e35ae643ccaa85", "transactionIndex": "0x0", "blockHash": "0xba3b252e1c01a6519c8e7e10889ef856daebae7be561cd209df5c9f371442b3d", "logIndex": "0x0", "removed": false }, { "address": "0x4200000000000000000000000000000000000042", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000ff8c6e782bdbceba8bd0ee7ea2556ea7df580b9b", "0x00000000000000000000000068f5c0a2de713a54991e01858fd27a3832401849" ], "data": "0x00000000000000000000000000000000000000000000003bce4a60159782cc40", "blockNumber": "0x4777963", "transactionHash": "0x33bf901ebb3e623a06069dbffd91eeb32e5355f88b500e18b7e35ae643ccaa85", "transactionIndex": "0x0", "blockHash": "0xba3b252e1c01a6519c8e7e10889ef856daebae7be561cd209df5c9f371442b3d", "logIndex": "0x1", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000040000000000000000000000000000000000100000000000000000000020000000000000000040000000000000000820000008080000000000000000000000000200000000000000000000100000000004000000000000000000000000000000000010000800000000000004000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000002000000000000000000000000008000000002000000000000000000000000000000000000000000401000000000000000000000000000000000000000", "status": "0x1", "to": "0xff8c6e782bdbceba8bd0ee7ea2556ea7df580b9b", "transactionHash": "0x33bf901ebb3e623a06069dbffd91eeb32e5355f88b500e18b7e35ae643ccaa85", "transactionIndex": "0x0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/optimism/web3/ title: Optimism — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/optimism/web3.mdx --- # Optimism — web3, net, eth (1/3) > API reference for [Optimism](/rpc-service/chains/chains-api/optimism/). [All methods ->](/rpc-service/chains/chains-api/optimism/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/optimism/web3-p2/) · [3](/rpc-service/chains/chains-api/optimism/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v1.9.10-stable/linux-amd64/go1.19.3", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "10" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x40", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xf4240" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47774df" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address to check for balance. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x323B69eaAa302B940f4cAFA9FB8684016959600f", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x158ab28842d51ca0a" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address of the storage (hex encoded). 2. `` (quantity; required): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xf9e8466141d032AAaE3306227bb34c8278737425", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4d" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x6326ed6707a6c28b52994295610963173655a1d127ea637f174ed733d66d4824"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x4777962"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x6326ed6707a6c28b52994295610963173655a1d127ea637f174ed733d66d4824"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x4777962"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xb1398c4D958B97c181Df60148678f04eCEc62c69", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/optimism/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/polkadot/ title: Polkadot description: Polkadot is the first fully-sharded blockchain. Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/polkadot/index.mdx --- # Polkadot
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Polkadot API is available on [Web3 API platform](https://www.ankr.com/rpc/polkadot). *Polkadot* is the first fully-sharded blockchain. Polkadot enables scalability by allowing specialized blockchains to communicate with each other in a secure, trust-free environment. Polkadot is built to connect and secure unique blockchains, whether they be public, permissionless networks, private consortium chains, or other Web3 technologies. It enables an internet where independent blockchains can exchange information under common security guarantees. In order for your Web3 application to interact with Polkadot — either by reading blockchain data or sending transactions to the network — it must connect to a Polkadot node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods ### Methods supported - [`chain_getBlock`](/rpc-service/chains/chains-api/polkadot/methods-supported/#chain_getblock) - [`chain_getBlockHash`](/rpc-service/chains/chains-api/polkadot/methods-supported/#chain_getblockhash) - [`chain_getHeader`](/rpc-service/chains/chains-api/polkadot/methods-supported/#chain_getheader) - [`chain_getFinalizedHead`](/rpc-service/chains/chains-api/polkadot/methods-supported/#chain_getfinalizedhead) - [`state_getStorage`](/rpc-service/chains/chains-api/polkadot/methods-supported/#state_getstorage) - [`state_getStorageHash`](/rpc-service/chains/chains-api/polkadot/methods-supported/#state_getstoragehash) - [`state_getStorageSize`](/rpc-service/chains/chains-api/polkadot/methods-supported/#state_getstoragesize) - [`grandpa_proveFinality`](/rpc-service/chains/chains-api/polkadot/methods-supported/#grandpa_provefinality) - [`grandpa_roundState`](/rpc-service/chains/chains-api/polkadot/methods-supported/#grandpa_roundstate) - [`system_chain`](/rpc-service/chains/chains-api/polkadot/methods-supported/#system_chain) - [`system_chainType`](/rpc-service/chains/chains-api/polkadot/methods-supported/#system_chaintype) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/polkadot/methods-supported/ title: Polkadot — Methods supported source: docs/rpc-service/chains/chains-api/polkadot/methods-supported.mdx --- # Polkadot — Methods supported > API reference for [Polkadot](/rpc-service/chains/chains-api/polkadot/). [All methods ->](/rpc-service/chains/chains-api/polkadot/#methods) ## Methods supported * [`chain_getBlock`](#chain_getblock) — retrieves the header and body of a relay chain block. * [`chain_getBlockHash`](#chain_getblockhash) — retrieves the block hash for a specific block. * [`chain_getHeader`](#chain_getheader) — retrieves the header for a specific block. * [`chain_getFinalizedHead`](#chain_getfinalizedhead) — retrieves the hash of the last finalized block in the canon chain. * [`state_getStorage`](#state_getstorage) — retrieves the storage for a key. * [`state_getStorageHash`](#state_getstoragehash) — retrieves the storage hash. * [`state_getStorageSize`](#state_getstoragesize) — retrieves the storage size. * [`grandpa_proveFinality`](#grandpa_provefinality) — proves finality for the given block number, returning the Justification for the last block in the set. * [`grandpa_roundState`](#grandpa_roundstate) — returns the state of the current best round state as well as the ongoing background rounds. * [`system_chain`](#system_chain) — retrieves the chain. * [`system_chainType`](#system_chaintype) — retrieves the chain type. --- ### `chain_getBlock` > Retrieves the header and body of a relay chain block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data; 32 byte; optional): a hash of the block to retrieve; if omitted, retrieves the latest finalized block. #### Returns * `SignedBlock`: the header and body data of a relay chain block. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlock", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block": { "header": { "parentHash": "0xe121a7c43cbe19eab2601d422df9173a84553cda9f0cd59e0656227696f46d30", "number": "0xedaaed", "stateRoot": "0x4f4dd4f1bc408dfd01222a8d1401a96c9abb8be86ab60c0e01f10b4a54834b6f", "extrinsicsRoot": "0xf310b41030a9bbf5788176a0a187a7fe84833729fb763883329bcc2f9a308a03", "digest": { "logs": [ "0x0642414245b50103fc000000f4aebb1000000000440c17d240df02d42ddab5c961fe2649e30f69aea189e5bc95487ae5f889a74bc516a159ccc7db48e5253dae8f1168be0c66597b18ab1e2248ecd3862eae9e0a8c74b856d20d6916ab8cbe3cd4955f183c231bde98ca24dbb3f201468cc23b0f", "0x054241424501015a6148654f94084ca0373a6d708704ce54ae704e159d51eb00d7de032b2b3824a91a4509f94f90fda82a3ff372b0003c0440475b9218e6469d883eeba276ac8a" ] } }, "extrinsics": [ "0x280403000bc076d42e8801", "0xdd02040c00ecaaed009c98002408011220c9b7d94c0c8dc84ca9034c1a6926bfb2e0b1e31c0c9fbaee8126874d32d122840878742f6970342f3134312e39382e3231392e3139392f7463702f33303333336c682f6970342f3130302e36342e332e31322f7463702f333033333379190000f600000029010000903755c7655994b2ca1f457d26c947041f9e6970e6b3cf578ee8459d061cc20d3d7e65d5c166fcca21059ad60b89d21f8a2b5574da4414adb72941c0c2e44d8c" ] }, "justifications": null }, "id": 1 } ``` --- ### `chain_getBlockHash` > Retrieves the block hash for a specific block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): `` (string; hex; optional): the number of a block to retrieve the hash for; if omitted, retrieves the latest finalized block. #### Returns * ``: the block hash of the block specified. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlockHash", "params": ["0xb48f90"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0x92f387735d1d4459c8e6d5931bc350712a1697866ed708fb241ee97a1bd0da94", "id": 1 } ``` --- ### `chain_getHeader` > Retrieves the header for a specific block. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data; 32 byte; optional): a hash of the block to retrieve the header for; if omitted, shows the result for the latest finalized block. #### Returns * `
`: the header of the block specified. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getHeader", "params": ["0x56547256415c6ca5d7e43e32f0664ede1aa78aae59e07cdc64f2037beba31e9e"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "parentHash": "0x88ac4b5bc7ea4e0cb1b8d8e1d2dce838e37d1a4480c4bde37bdfdcc9c8fffb64", "number": "0xb48f75", "stateRoot": "0xa2baf709447aa9055b4ca5046fc76a0ca05ace90758fcf3bc3bc004612173bfa", "extrinsicsRoot": "0xe94f82eae3aba9331e0370f1c3b7d72da3bd9a82dd36711448d6197b6659e308", "digest": { "logs": [ "0x0642414245b50103c0000000076382100000000084c21f756e3473b8717c13d27c85a94466cbd0f64fe8bbd37cbf23dd46c70e5a49626481005b811dfcff67dda4b12ee502cb3589c6b2ff6450c6537f18298c08fd2942aaa2f0ee1591522fe4dc0482949c920a046201cf39f7ba766af4907509", "0x05424142450101340de0372f172ba4d9c12d767ddd42e2f1844691c93f74773e7839ccba29b96f400a6b8bbea109e807033696c182f08c8c02918c3521968612cd20ed82af0b89" ] } }, "id": 1 } ``` --- ### `chain_getFinalizedHead` > Retrieves the hash of the last finalized block in the canon chain. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: the hash of the last finalized block in the canon chain. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getFinalizedHead", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0xc487e58e468240ea30fa17a2d982fb47d0213dd64e6b980e4a0cb4fb6bcc3ca6", "id": 1 } ``` --- ### `state_getStorage` > Retrieves the storage for a key. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex ; required): the key to retrieve the storage for. * `` (data; 32 byte; optional): a hash of the block. #### Returns * ``: the storage data. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorage", "params": ["0xf0c365c3cf59d671eb72da0e7a4113c49f1f0515f462cdcf84e0f1d6045dfcbb"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0xf08af92e88010000", "id": 1 } ``` --- ### `state_getStorageHash` > Retrieves the storage hash. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): a storage key. * `` (data; 32 byte; optional): a hash of the block. #### Returns * ``: the storage hash. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageHash", "params": ["0xf0c365c3cf59d671eb72da0e7a4113c49f1f0515f462cdcf84e0f1d6045dfcbb"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0xcadcddea7fce8dd4169f521f2c043b3637bca8b07870994491d3b3d9bdfb4102", "id": 1 } ``` --- ### `state_getStorageSize` > Retrieves the storage size. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the storage key. * `` (data; 32 byte; optional): a hash of the block. #### Returns * ``: the storage size. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "state_getStorageSize", "params": ["0xf0c365c3cf59d671eb72da0e7a4113c49f1f0515f462cdcf84e0f1d6045dfcbb"] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": 8, "id": 1 } ``` --- ### `grandpa_proveFinality` > Proves finality for the given block number, returning the Justification for the last block in the set. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (integer; required): the number of a block to prove finality for. #### Returns * `Option`: the Justification for the last block in the set. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "grandpa_proveFinality", "params": [11833440] }' ``` --- ### `grandpa_roundState` > Returns the state of the current best round state as well as the ongoing background rounds. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: the states of reported rounds. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "grandpa_roundState", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "setId": 1446, "best": { "round": 14118, "totalWeight": 297, "thresholdWeight": 199, "prevotes": { "currentWeight": 297, "missing": [] }, "precommits": { "currentWeight": 0, "missing": [ "12cCLNxo2WqvqizuMrgHtpjUz2s5xmomTM7y3FWESbvjcwq", "14ZryeDT1MmSSX29QaJ2pbNjJDv8hoLTfwFmDwe6mDMh3Vj", "15E5zYJhV2iqZXmL1FKe8MdFocj9n1phEaJob4izAaXA9bw" ] } }, "background": [] }, "id": 1 } ``` --- ### `system_chain` > Retrieves the chain. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: a chain name. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_chain", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "Polkadot", "id": 1 } ``` --- ### `system_chainType` > Retrieves the chain type. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * ``: a chain type. #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "system_chainType", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "Live", "id": 1 } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/polygon/eth/ title: Polygon — eth source: docs/rpc-service/chains/chains-api/polygon/eth.mdx --- # Polygon — eth > API reference for [Polygon](/rpc-service/chains/chains-api/polygon/). [All methods ->](/rpc-service/chains/chains-api/polygon/#methods) ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xa9309df0fb8e16f292a476bf2e73b17d542fc594bf1461e1ac2a0e69e371712a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc2696012418986efd674f775d95fbc1d6e0a80ce66aa222f66dc6dad04275de8", "blockNumber": "0x2591606", "contractAddress": null, "cumulativeGasUsed": "0x607dbf", "effectiveGasPrice": "0x3560bb8ea7", "from": "0x777ad55efc465052d6a4ab7bc75b6a15175bb399", "gasUsed": "0x2ab7e", "logs": [ { "address": "0x310990e8091b5cf083fa55f500f140cfbb959016", "topics": [ "0xf6a97944f31ea060dfde0566e4167c1a1082551e64b60ecb14d599a9d023d451", "0x000000000000000000000000000000000000000000000000000000000039018e" ], "data": "0x0000000000000000000000000000000000000000000000000000000006566020000000000000000000000000777ad55efc465052d6a4ab7bc75b6a15175bb39900000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000039a8ef13bc407f82039e29a216ad294a0002526601000000000000000000000000000000000000000000000000000000000000000f00000000000000000000000000000000000000000000000000000000065652d80000000000000000000000000000000000000000000000000000000006565c380000000000000000000000000000000000000000000000000000000006565c380000000000000000000000000000000000000000000000000000000006565c3800000000000000000000000000000000000000000000000000000000065660200000000000000000000000000000000000000000000000000000000006566020000000000000000000000000000000000000000000000000000000000656602000000000000000000000000000000000000000000000000000000000065660200000000000000000000000000000000000000000000000000000000006566020000000000000000000000000000000000000000000000000000000000656640800000000000000000000000000000000000000000000000000000000065667f000000000000000000000000000000000000000000000000000000000065667f000000000000000000000000000000000000000000000000000000000065667f000000000000000000000000000000000000000000000000000000000065667f0000000000000000000000000000000000000000000000000000000000656759b000000000000000000000000000000000000000000000000000000000000000f0e0603040a0f00010809050b07020d0000000000000000000000000000000000", "blockNumber": "0x2591606", "transactionHash": "0xa9309df0fb8e16f292a476bf2e73b17d542fc594bf1461e1ac2a0e69e371712a", "transactionIndex": "0x23", "blockHash": "0xc2696012418986efd674f775d95fbc1d6e0a80ce66aa222f66dc6dad04275de8", "logIndex": "0x65", "removed": false }, { "address": "0x310990e8091b5cf083fa55f500f140cfbb959016", "topics": [ "0x0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac60271", "0x000000000000000000000000000000000000000000000000000000000039018e", "0x0000000000000000000000000000000000000000000000000000000000000000" ], "data": "0x0000000000000000000000000000000000000000000000000000000063ef666f", "blockNumber": "0x2591606", "transactionHash": "0xa9309df0fb8e16f292a476bf2e73b17d542fc594bf1461e1ac2a0e69e371712a", "transactionIndex": "0x23", "blockHash": "0xc2696012418986efd674f775d95fbc1d6e0a80ce66aa222f66dc6dad04275de8", "logIndex": "0x66", "removed": false }, { "address": "0x310990e8091b5cf083fa55f500f140cfbb959016", "topics": [ "0x0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f", "0x0000000000000000000000000000000000000000000000000000000006566020", "0x000000000000000000000000000000000000000000000000000000000039018e" ], "data": "0x0000000000000000000000000000000000000000000000000000000063ef666f", "blockNumber": "0x2591606", "transactionHash": "0xa9309df0fb8e16f292a476bf2e73b17d542fc594bf1461e1ac2a0e69e371712a", "transactionIndex": "0x23", "blockHash": "0xc2696012418986efd674f775d95fbc1d6e0a80ce66aa222f66dc6dad04275de8", "logIndex": "0x67", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000200000000110000000000000000000080000000008000000240080000000000000000200000000000000000000001002000800000000001000000000100020000000000000000020000000000000000000800000000000000000080000000000000000000000008000000000000000000000400000680000000000000080000000000200000001040000000000000000000000000000000000000000000000000004000000100000000000001000000000000004000000000000008100000000020002000000000000000000000000000000000000000000000000000000000100000", "status": "0x1", "to": "0x310990e8091b5cf083fa55f500f140cfbb959016", "transactionHash": "0xa9309df0fb8e16f292a476bf2e73b17d542fc594bf1461e1ac2a0e69e371712a", "transactionIndex": "0x23", "type": "0x0" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x2B901D", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either a hex of the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x5Da70A90CaAf7015DE9754709400a97A988476DB"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/polygon/ title: Polygon description: Polygon is a scaling solution for public blockchains. 29 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/polygon/index.mdx --- # Polygon
> Polygon API is available on [Web3 API platform](https://www.ankr.com/rpc/polygon). *Polygon* is a scaling solution for public blockchains. Polygon PoS supports all the existing Ethereum tooling along with faster and cheaper transactions. In order for your Web3 application to interact with Polygon — either by reading blockchain data or sending transactions to the network — it must connect to a Polygon node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/polygon/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/polygon/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/polygon/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/polygon/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_protocolversion`](/rpc-service/chains/chains-api/polygon/web3/#eth_protocolversion) — returns the current Ethereum protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/polygon/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/polygon/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/polygon/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/polygon/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/polygon/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/polygon/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/polygon/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/polygon/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/polygon/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/polygon/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/polygon/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/polygon/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/polygon/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/polygon/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/polygon/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/polygon/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/polygon/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/polygon/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/polygon/web3-p3/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/polygon/web3-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/polygon/eth/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/polygon/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/polygon/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/polygon/eth/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/polygon/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/polygon/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/polygon/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/polygon/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/polygon/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/polygon/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/polygon/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/polygon/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/polygon/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/polygon/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/polygon/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/polygon/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/polygon/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/polygon/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/polygon/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/polygon/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/polygon/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/polygon/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/polygon/web3-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/polygon/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/polygon/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/polygon/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/polygon/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/polygon/web3-p3/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/polygon/web3-p3/#eth_gettransactionbyblocknumberandindex) ### eth - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/polygon/eth/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/polygon/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/polygon/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/polygon/eth/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/polygon/web3-p2/ title: Polygon — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/polygon/web3-p2.mdx --- # Polygon — web3, net, eth (2/3) > API reference for [Polygon](/rpc-service/chains/chains-api/polygon/). [All methods ->](/rpc-service/chains/chains-api/polygon/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/polygon/web3/) · 2 · [3](/rpc-service/chains/chains-api/polygon/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":"0x07f327929A3A3131EB4BE83f784DBD3E5C2698f8"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xcf08" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block's hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x2ecac89ca5fb469d40a264575a8e4787545a1624bc2e63106a5278f7562a0a06", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x2b269c837f", "difficulty": "0x15", "extraData": "0xd682030383626f7288676f312e31392e32856c696e7578000000000000000000d743d3f9e6e3d6582bdf81a8485c510874c0231f7dc157e782a363eb744b14bb20b466269d2ea90ec49f0ed5189e5eb4a8fff462d885ccf00c594e9d1dcfb5bc01", "gasLimit": "0x1c54f80", "gasUsed": "0xc4a7ea", "hash": "0x2ecac89ca5fb469d40a264575a8e4787545a1624bc2e63106a5278f7562a0a06", "logsBloom": "0x44a88cee582107c20c897153ec2188e012094f11cb21160cdd00176794861b0b40595404c644a418e231103c02d0e10160a5a5620a962041ae31635ea1a72051243c5074be96ea480267948d20e119fc5a22a4e84b57200259173ae5be2d13f4542c640283020d0121405945290f8a7912164c39cc0c0785eb09c818e6d8151d068706ce2caa4497508108441ac800a516f32481a3101ecc30011c66020f182deb4900b234b4151200088154888b6570dc6401422966e0943405232c2d607864f198d58785102d905ec18c1f4e1102087acd1642044aa472ea3de8bb08006a6e3238c2ec0900290906af2884bd2096b3c13a1ca702bade0d6c15d82cc2140e3f", "miner": "0x1efecb61a2f80aa34d3b9218b564a64d05946290", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x2591605", "parentHash": "0x55b416e4027b725889a605e2b10fa64529736f82ab27aa3fb3c34a052b2a0b67", "receiptsRoot": "0x96a49aa0cea28bc29f294c2a8c3d23f2399308f9e00132e829f1573dfb5fe673", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0xc79d", "stateRoot": "0x01602f08f81a8dcf887c90bc766d1c2b774acb4f859ccf662bb56c818104860c", "timestamp": "0x63ef666d", "totalDifficulty": "0x262bac54", "transactions": [ "0x3d88238b3d314dbe50c9402a91ef284044704ab68643d51253a6fa2e885268bd", "0xc70418ba35358b0ac6a03a86972f2f802d684df5d493b480bb1e40db9b2e1858", "0xbed1d31688226cb5018323bdfc616ae56b0e4e2599487781f4cab12402db8d9d", "0xcafa76ed823b2fcb390cfb39709dee38b877069962b0c26790af1d4b02bd06d9", "0xbaaf6e7fbcc7e7c7916b0c2be8eeae5d7d69a040931e2378ced71911498c6488", "0x3bf1d3067da0a920eb4a3a2401d62fb21f9a4d957ec6117f02d83d7a3f069b6b", "0x18e8411b139b4e2beb3d20892b262fe5f33589211d1b501dfb52badff6a5b750", "0xd81cc2fac01c759aab1535c2d5cdec393111e2dff157b382b1a747f73dd97c58", "0x2b5933e4c7f27b495e4a9558238528b395025670a15fe3d405cbff66267d5baa", "0x63915c6ab03ea8d94f25ea36d6a27b7bf5b9506a32ca06b879f65d7c9627367d", "0xcdd2c222ab4683b49d472d4c687c4f20372a708515ea20f3a73f73ad82700b64", "0x6c6a1f58e587674322d15159527b69ae00105d297f71fc872d19c2426f45faf0", "0x17624f68372ad9407b12c319907488c323968cc20285d74e68d4295ad148346d", "0x6f0ffef0df4cd61c5a9d0ef2eea026714933d64f8b5e3992739bde2c47a8fba5", "0x0ac25864c0bf55e41a1355e2291a5f66e1ea3959166f14e92490dd9123c71026", "0x1d762d9a04bb5cc4169a133c56d8f816e3dc202c857d93d3ed1ed68f3495ba7e", "0x214805e9125236cc5467147763fc2b526db023e900f4657b4dda04dfe3555f7a", "0xc24bb4416cfb909b232ea36a13b9aa67462f0cf255b1e34cd31a4ffa6e24f186", "0xcbeaedfbfd47786285a767457fefe95ca0b95d354d17d769bfaba1b6cb4050ad", "0x4f2d18b4aa023901c44e355354dcaadaf28a948ae8aebd5747398985b45d8656" ], "transactionsRoot": "0x609fb2e2ec4fb7ea27ac99ca20b889bfb169ac499141a28ad2d0183fec8564e8", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x2591606", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x2acb3b0370", "difficulty": "0x15", "extraData": "0xd682030383626f7288676f312e31392e32856c696e7578000000000000000000bbb8fa5e3f9be33953ed7df4b9fee8e82c294c1692a555d8af52b39aa1e6e8931ed2da6237a0c1bfa086744b29446ed788b46b5f5f37eb8e8a4310584e3d1c3b01", "gasLimit": "0x1c5c0d2", "gasUsed": "0x80dd78", "hash": "0xc2696012418986efd674f775d95fbc1d6e0a80ce66aa222f66dc6dad04275de8", "logsBloom": "0x642190c2480c0661464990b88020342b244608074111480b05020260046210004108110c58600a92c228611404c84c140021b5658122728820a003428e2c2ac132bcc700b98640a88024401db0a7a1d840668448a11c8820486719460584328928062000a200f2102130514024ac4865800540a8ea0ac1ada830c85053990190003106818d01008f8ca1b047be806584615106804062420030090a24c100009033288808d2c09a00163c0870c8892411d2804ca32028c805140000294032084002201713d10ac081028128122303040114450340040abc645ab18e0404013d462f9c20aa90820d10884e0a410022a3a3a0814085826440c12a68180502548c2b", "miner": "0x1efecb61a2f80aa34d3b9218b564a64d05946290", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x2591606", "parentHash": "0x2ecac89ca5fb469d40a264575a8e4787545a1624bc2e63106a5278f7562a0a06", "receiptsRoot": "0xc78b075c3a837e517909ec2dff426466fa0741f9b20421b8f845d1e9d6873a51", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x8662", "stateRoot": "0x8cc1816fcab8d2c9ffee9787ccc57ef3ca622b3fccd4b0fee4a0f91823fa6df9", "timestamp": "0x63ef666f", "totalDifficulty": "0x262bac69", "transactions": [ "0x0a9675514d58d1d7e08e9199b01dc8f63c5945a50e4453de29633a71d186eeee", "0xb4d9c864f9185adac1eec4821e5b31eb0a33b6600d09baf8eae07a99e5be8316", "0xc05729de4a044c8c209c6187024e8521c1699a50e771a010dfd6e70769637432", "0x71ea98d3dbda4eee53a93dd76b09bfa7ce57bc5dbafeddfe6c2a0cd0d02fce23", "0x013469cad8707b697921345917a72217e1f41a696a17485e27af1ff053b58cd0", "0xfceb59ecfaf4409f54235d7743e383dd701b109375c9b287cba9aaa340794e9c", "0x7c49f7e6495ae42b8c86cb1465389484c3ddfdca8a7c20b5cee82ed7d8ae93aa", "0xf031a21b0f4d7fb40ba881af3971b859192c3e4688353d4bdafb176e1c793649", "0x9e133c0283f3929c869de120670e5fe19a103e1856680f2452127f7e98679c1d", "0x179fc2fa1302c7e6282bc1c7cb822f5d9bfb71f3d2351417375927d51374bed1", "0xfd7ce56bc28ab7953361107763b36b7be75ee2d2843fc25d54ab19ebce4d8b66", "0xfdb99d3ddf8fa4a089e1bfa1dfbae7a92f6e60a1f005595d4942e72a72d84aa7", "0xcf7dec7ec0b13137b922e9ffb8b2f5b43170e5ab2e5c533623d776f32500370d", "0x3fff45a981339c7b98364e768e179b6859a356af862282220584ea2961f2defa", "0x8a8aa374f35cdfb4efb1bd0295b0211624c8a7337f7f59d70fc56a6e6e5ae789", "0xe9fac677086ed07947ae5d0f9ebeadcf5a1982f60d8b52f5fcfdbb0598a6d91c", "0x7d4a006b40dd4bd3690a17c6ff039322933042e6b6c7322fb20ec21265d1184d", "0x38c43494c7c0d8f3793409f1826c47c24e2d890bb8ad857a5c2d8c1e30eb314f", "0x9deb6f25163c000682ede123720852a05ca481b4181365c1432aa4cdd190c9cc", "0x176a650f618c823849581f962031b3ab22b59932699c57525cc475f9db4c1dae" ], "transactionsRoot": "0x04819e988c4e7056bd2584b14cdb6322b821a5e5f7aeea8456d7cc83e05b061e", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x8dfbca3cbea2acedc50e318207b625fd4d6844d746313a8c116ff51c4b0a6475"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc2696012418986efd674f775d95fbc1d6e0a80ce66aa222f66dc6dad04275de8", "blockNumber": "0x2591606", "from": "0x65bf36d6499a504100eb504f0719271f5c4174ec", "gas": "0x493e0", "gasPrice": "0x34ba1383ab", "maxFeePerGas": "0x1ddec2e843b", "maxPriorityFeePerGas": "0x9eed8803b", "hash": "0x8dfbca3cbea2acedc50e318207b625fd4d6844d746313a8c116ff51c4b0a6475", "input": "0x6a7612020000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030d40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e11c7768bb704502bad2e1a5353a6a6994726c6b0000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041031a854479a3791ff2b658c1744600b4dee8dc5f7638a7f3b2a1d2e42b1cb4ab19d718b41fd6d6482ddb7d4079b4f161df186bec8e502a7968784a3f1fa3d6a01b00000000000000000000000000000000000000000000000000000000000000", "nonce": "0x2bd98c", "to": "0x476d58bd39ed586f357c8a830e9ef8a89d5ec4fa", "transactionIndex": "0x25", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x89", "v": "0x0", "r": "0xba540054b6e10ef5d24957f52572b4764a846f83583f20809c4a5ae7b0855691", "s": "0x71fa5ec85b94ce853e151ba1ee45415ce687b92d49ed1a1832b5a42717d21e5e" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/polygon/web3-p3/ title: Polygon — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/polygon/web3-p3.mdx --- # Polygon — web3, net, eth (3/3) > API reference for [Polygon](/rpc-service/chains/chains-api/polygon/). [All methods ->](/rpc-service/chains/chains-api/polygon/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/polygon/web3/) · [2](/rpc-service/chains/chains-api/polygon/web3-p2/) · 3 ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xc2696012418986efd674f775d95fbc1d6e0a80ce66aa222f66dc6dad04275de8", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc2696012418986efd674f775d95fbc1d6e0a80ce66aa222f66dc6dad04275de8", "blockNumber": "0x2591606", "from": "0x77bafc508a83110bdfab0e9788660ef6b802ce7d", "gas": "0x61a80", "gasPrice": "0x168e3330c00", "maxPriorityFeePerGas": "0x168e3330c00", "maxFeePerGas": "0x168e3330c00", "hash": "0x0a9675514d58d1d7e08e9199b01dc8f63c5945a50e4453de29633a71d186eeee", "input": "0x7e23d59600000000000000000000000000000000000000000000000000000000d09dc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000143c68bde987136e4cc000000000000000000000000000000000000000000000143cab11525f36a74791", "nonce": "0x212b", "to": "0xf19d044ef87c272010566d5b5c3e94684b88f579", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x89", "v": "0x1", "r": "0x14c08004aaf6397c4ad0b9ec6af0031a7c20b9c8d33bbd947922ce1c975d352d", "s": "0x6a54d96e7d752b3983da5a5d6abe204c3394b4c1cfcbc7647752c9b125b9d5e5" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x2591606", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc2696012418986efd674f775d95fbc1d6e0a80ce66aa222f66dc6dad04275de8", "blockNumber": "0x2591606", "from": "0x77bafc508a83110bdfab0e9788660ef6b802ce7d", "gas": "0x61a80", "gasPrice": "0x168e3330c00", "maxPriorityFeePerGas": "0x168e3330c00", "maxFeePerGas": "0x168e3330c00", "hash": "0x0a9675514d58d1d7e08e9199b01dc8f63c5945a50e4453de29633a71d186eeee", "input": "0x7e23d59600000000000000000000000000000000000000000000000000000000d09dc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000143c68bde987136e4cc000000000000000000000000000000000000000000000143cab11525f36a74791", "nonce": "0x212b", "to": "0xf19d044ef87c272010566d5b5c3e94684b88f579", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x89", "v": "0x1", "r": "0x14c08004aaf6397c4ad0b9ec6af0031a7c20b9c8d33bbd947922ce1c975d352d", "s": "0x6a54d96e7d752b3983da5a5d6abe204c3394b4c1cfcbc7647752c9b125b9d5e5" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/polygon/web3/ title: Polygon — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/polygon/web3.mdx --- # Polygon — web3, net, eth (1/3) > API reference for [Polygon](/rpc-service/chains/chains-api/polygon/). [All methods ->](/rpc-service/chains/chains-api/polygon/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/polygon/web3-p2/) · [3](/rpc-service/chains/chains-api/polygon/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "bor/v0.3.3-stable/linux-amd64/go1.19.3", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "137" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x42", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3495ba9628" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x25915f9" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address to check for balance. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x7670a5B3Ae9E4408d34F06d1530a0076516E6b97", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2f2283fc8f9bc004" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address of the storage (hex encoded). 2. `` (quantity; required): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xc4Cb6cB969e8b4e309Ab98E4Da51b77887aFaD96", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xe471" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xc2696012418986efd674f775d95fbc1d6e0a80ce66aa222f66dc6dad04275de8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3e" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x2591606"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3e" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x6326ed6707a6c28b52994295610963173655a1d127ea637f174ed733d66d4824"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x4777962"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xb1398c4D958B97c181Df60148678f04eCEc62c69", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/polygon/eth/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/polygon/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/rollux/eth/ title: Rollux — eth, optimism source: docs/rpc-service/chains/chains-api/rollux/eth.mdx --- # Rollux — eth, optimism > API reference for [Rollux](/rpc-service/chains/chains-api/rollux/). [All methods ->](/rpc-service/chains/chains-api/rollux/#methods) ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x09a358b7a22b1edea3e7dd72bb265aeca6a1cafe4487330c0be5d8fff9a32376", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- ## `optimism_outputAtBlock` > Retrieves the output root at a specific block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `blockNumber` (quantity|tag): either the 64 bits L2 integer _block number_ or one of the following _block tag_ strings: * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data, 32 bytes): the output root version number, beginning with 0. * `` (data, 32 bytes): the output root. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux_opnode/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "optimism_outputAtBlock", "params": ["0x7EFB22"], "id": 1 }' ``` ### Response example ```json { "jsonrpc":"2.0", "id":1, "result":[ "0x0000000000000000000000000000000000000000000000000000000000000000", "0xabe711e34c1387c8c56d0def8ce77e454d6a0bfd26cef2396626202238442421" ] } ``` --- ## `optimism_syncStatus` > Retrieves the synchronization status. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux_opnode/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "optimism_syncStatus", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "current_l1": { "hash": "0x5adcfcbd1c2fcf9e06bfdaa8414a4586f84e11f487396abca940299eb0ed2da5", "number": 7569281, "parentHash": "0xfd022ca8a8c4e0f3bfd67081c18551840ea0717cc01d9a94601e1e41e92616d3", "timestamp": 1662862860 }, "head_l1": { "hash": "0x5c12fde5ea79aefe4b52c0c8cc0e0eb33a2ccb423cb3cd9c9132e18ad42e89b6", "number": 8042823, "parentHash": "0x74818f8ecaa932431bf9523e929dcfa11ab382c752529d8271a24810884a2551", "timestamp": 1669735356 }, "safe_l1": { "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "number": 0, "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": 0 }, "finalized_l1": { "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "number": 0, "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": 0 }, "unsafe_l2": { "hash": "0x1cad05886ec0e2cda728674e00eadcbb9245ff34c0bfd86c866673a615c1c43a", "number": 1752, "parentHash": "0x0115dbbd26aaf9563d7e3cad65bad41926d94b2643ccb080f71e394c2c3d62a3", "timestamp": 1662861300, "l1origin": { "hash": "0x43fe1601041056e9a2a5dabaa20715518ae0058abf67a69f5ebdd53b1f6ff02f", "number": 7569162 }, "sequenceNumber": 0 }, "safe_l2": { "hash": "0x1cad05886ec0e2cda728674e00eadcbb9245ff34c0bfd86c866673a615c1c43a", "number": 1752, "parentHash": "0x0115dbbd26aaf9563d7e3cad65bad41926d94b2643ccb080f71e394c2c3d62a3", "timestamp": 1662861300, "l1origin": { "hash": "0x43fe1601041056e9a2a5dabaa20715518ae0058abf67a69f5ebdd53b1f6ff02f", "number": 7569162 }, "sequenceNumber": 0 }, "finalized_l2": { "hash": "0x6758307d692d4f2f6650acd3762674749a0c1cc2530b9b481845d0f8ee1bd456", "number": 0, "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": 1662857796, "l1origin": { "hash": "0xb0bbb79a00fb8485185b1bedfac386812d662e1cddba77b67a26e1ed9ba8f0ec", "number": 7568910 }, "sequenceNumber": 0 } } } ``` --- ## `optimism_rollupConfig` > Retrieves the rollup configuration parameters. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux_opnode/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "optimism_rollupConfig", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc":"2.0", "id":1, "result":{ "genesis":{ "l1":{ "hash":"0xb0bbb79a00fb8485185b1bedfac386812d662e1cddba77b67a26e1ed9ba8f0ec", "number":7568910 }, "l2":{ "hash":"0x6758307d692d4f2f6650acd3762674749a0c1cc2530b9b481845d0f8ee1bd456", "number":0 }, "l2_time":1662857796 }, "block_time":2, "max_sequencer_drift":120, "seq_window_size":120, "channel_timeout":30, "l1_chain_id":5, "l2_chain_id":28528, "p2p_sequencer_address":"0x59dc8e68a80833cc8a9592d532fed42374c8b5dc", "fee_recipient_address":"0xdffc6a1c238ff9504b055ad7efeee0148f2d62bd", "batch_inbox_address":"0xfeb2acb903f95fb5f5497157c0727a7d16e3fd16", "batch_sender_address":"0x4ff79526ea1d492a3db2aa210d7318ff13f2012c", "deposit_contract_address":"0xa581ca3353db73115c4625ffc7adf5db379434a8" } } ``` --- ## `optimism_version` > Retrieves the software version. ### Parameters ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux_opnode/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "optimism_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"v0.0.0-" } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/rollux/ title: Rollux description: Rollux is a suite of rollup-based Layer 2 solutions designed to enable EVM users with near-instant low-cost… 32 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/rollux/index.mdx --- # Rollux
> Rollux API is available on [Web3 API platform](https://www.ankr.com/rpc/rollux). *Rollux* is a suite of rollup-based Layer 2 solutions designed to enable EVM users with near-instant low-cost transfers, executions, and contract deployments. Rollux utilizes Syscoin's Layer 1 for best-of-breed secure decentralized [settlement](https://docs.syscoin.org/docs/intro/syscoin-what/#settlement-layer) and Syscoin PoDA for Layer 1 data availability, offering more efficiency, lower costs, and higher throughput than other L1 DA alternatives. As a suite, Rollux is set to encompass both Optimistic and ZK (zero-knowledge) based approaches, enabling users and projects to choose a network or solution that fits them best. Rollux API supports the following requests: * [EVM methods](/rpc-service/chains/chains-api/rollux/#evm-methods) — Rollux Mainnet/Testnet. * [Op-node methods](/rpc-service/chains/chains-api/rollux/#op-node-methods) — Rollux Op-node Mainnet/Testnet. In order for your Web3 application to interact with Rollux — either by reading blockchain data or sending transactions to the network — it must connect to a Rollux node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## EVM methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/rollux/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/rollux/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/rollux/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/rollux/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/rollux/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/rollux/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/rollux/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/rollux/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/rollux/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/rollux/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/rollux/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/rollux/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/rollux/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/rollux/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/rollux/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/rollux/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/rollux/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/rollux/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/rollux/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/rollux/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/rollux/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/rollux/eth/#eth_getlogs) — returns logs matching the parameters specified. --- ## Op-node methods * [`optimism_outputAtBlock`](/rpc-service/chains/chains-api/rollux/eth/#optimism_outputatblock) — retrieves the output root at a specific block. * [`optimism_syncStatus`](/rpc-service/chains/chains-api/rollux/eth/#optimism_syncstatus) — retrieves the synchronization status. * [`optimism_rollupConfig`](/rpc-service/chains/chains-api/rollux/eth/#optimism_rollupconfig) — retrieves the rollup configuration parameters. * [`optimism_version`](/rpc-service/chains/chains-api/rollux/eth/#optimism_version) — retrieves the software version. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/rollux/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/rollux/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/rollux/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/rollux/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/rollux/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/rollux/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/rollux/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/rollux/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/rollux/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/rollux/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/rollux/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/rollux/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/rollux/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/rollux/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/rollux/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/rollux/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/rollux/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/rollux/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/rollux/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/rollux/web3-p3/#eth_gettransactionreceipt) ### eth, optimism - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/rollux/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/rollux/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/rollux/eth/#eth_getlogs) - [`optimism_outputAtBlock`](/rpc-service/chains/chains-api/rollux/eth/#optimism_outputatblock) - [`optimism_syncStatus`](/rpc-service/chains/chains-api/rollux/eth/#optimism_syncstatus) - [`optimism_rollupConfig`](/rpc-service/chains/chains-api/rollux/eth/#optimism_rollupconfig) - [`optimism_version`](/rpc-service/chains/chains-api/rollux/eth/#optimism_version) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/rollux/web3-p2/ title: Rollux — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/rollux/web3-p2.mdx --- # Rollux — web3, net, eth (2/3) > API reference for [Rollux](/rpc-service/chains/chains-api/rollux/). [All methods ->](/rpc-service/chains/chains-api/rollux/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/rollux/web3/) · 2 · [3](/rpc-service/chains/chains-api/rollux/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xcc7f18dddc6a1dead3238bb1556b234e9b5cf2cccdbbd6ce8d6f11ce6bf27bbd", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x32", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x17d7840", "gasUsed": "0xb705", "hash": "0xcc7f18dddc6a1dead3238bb1556b234e9b5cf2cccdbbd6ce8d6f11ce6bf27bbd", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x182d08", "parentHash": "0x6e4a66bcc3fe4d5455db6c54467cb2e942e300456ebe46933bd2fae1bcc6b24d", "receiptsRoot": "0xbe451c8e014ba1edc26a94ea4fc1104586c565143fee1d58e4bca3730df08f98", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x365", "stateRoot": "0x8dd829fc7666ee4d9c96aff921f1effa5b14bd5ca26f45b26ddc489fb964f622", "timestamp": "0x64414548", "totalDifficulty": "0x0", "transactions": [ "0x5c9622a83fafb94c444599d8478238d6c00fe68c2a0340e0c88d8955fb770c99" ], "transactionsRoot": "0x2d172c6bb62049148c892335d2eaf3750667d6fa7883a2c1815158366245c996", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x32", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x17d7840", "gasUsed": "0xb705", "hash": "0x72e97d0a4ec5c980e0c2897ac67eba820bcbcdc3f0e6b932afcd96779aa7f8ee", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x182f29", "parentHash": "0xab48e79137763b1a7904d5dcede457db3899786470255a4ef012090e6608f362", "receiptsRoot": "0xbe451c8e014ba1edc26a94ea4fc1104586c565143fee1d58e4bca3730df08f98", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x365", "stateRoot": "0xce62df852739adafb9463fa081a7f3adbae9c059d1f26c44a242ab8c2836a669", "timestamp": "0x6441498a", "totalDifficulty": "0x0", "transactions": [ "0x64e1838a1bb3473d6921ef1be28bd21b361ed812e497d3cb73251ad2afaaf7ce" ], "transactionsRoot": "0xdec62152a777bb15fc29340b9f907f6c634ceb32f0ea48cb3d50f003042c9d7c", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x335acc7eaf7b4f8c8349f2cb4b251003983380f399e6f3de4c6975fec606c48a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc7f0ab3a72f7d1cb7d85c0fa0657ab8dfc3ed73e48a3348a2a45404023333388", "blockNumber": "0x182f54", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x335acc7eaf7b4f8c8349f2cb4b251003983380f399e6f3de4c6975fec606c48a", "input": "0x015d8eb90000000000000000000000000000000000000000000000000000000000041809000000000000000000000000000000000000000000000000000000006441497f0000000000000000000000000000000000000000000000000000000000000007e400aa410ae75067a8772f16ffdae85bf54a5ee4de037d08255b54cad41bf367000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000d97b2a26cb85252998fe7b4bd4ec2118bf6b6e000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240", "nonce": "0x182f53", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0xc97cb47f9ec7322b2ac239807fd38c75a72374e253041796fad3465b4bf4c4c3", "mint": "0x0" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xc7f0ab3a72f7d1cb7d85c0fa0657ab8dfc3ed73e48a3348a2a45404023333388", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc7f0ab3a72f7d1cb7d85c0fa0657ab8dfc3ed73e48a3348a2a45404023333388", "blockNumber": "0x182f54", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x335acc7eaf7b4f8c8349f2cb4b251003983380f399e6f3de4c6975fec606c48a", "input": "0x015d8eb90000000000000000000000000000000000000000000000000000000000041809000000000000000000000000000000000000000000000000000000006441497f0000000000000000000000000000000000000000000000000000000000000007e400aa410ae75067a8772f16ffdae85bf54a5ee4de037d08255b54cad41bf367000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000d97b2a26cb85252998fe7b4bd4ec2118bf6b6e000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240", "nonce": "0x182f53", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0xc97cb47f9ec7322b2ac239807fd38c75a72374e253041796fad3465b4bf4c4c3", "mint": "0x0" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x182F7B", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x09a358b7a22b1edea3e7dd72bb265aeca6a1cafe4487330c0be5d8fff9a32376", "blockNumber": "0x182f7b", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x7183552985456c12574cee308ee6d87e94c26bf79e5544c3faa27560a4547d58", "input": "0x015d8eb9000000000000000000000000000000000000000000000000000000000004180b00000000000000000000000000000000000000000000000000000000644149de000000000000000000000000000000000000000000000000000000000000000760150c284f88c5c4298b7b180db0896530a80c6626fa5eff4f472386b961a46e000000000000000000000000000000000000000000000000000000000000000f00000000000000000000000000d97b2a26cb85252998fe7b4bd4ec2118bf6b6e000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240", "nonce": "0x182f7a", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x98d827f404aea3c0e7e87498f91bb702e19fa709adce587100cec61f558d6225", "mint": "0x0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/rollux/web3-p3/ title: Rollux — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/rollux/web3-p3.mdx --- # Rollux — web3, net, eth (3/3) > API reference for [Rollux](/rpc-service/chains/chains-api/rollux/). [All methods ->](/rpc-service/chains/chains-api/rollux/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/rollux/web3/) · [2](/rpc-service/chains/chains-api/rollux/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x7183552985456c12574cee308ee6d87e94c26bf79e5544c3faa27560a4547d58"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x09a358b7a22b1edea3e7dd72bb265aeca6a1cafe4487330c0be5d8fff9a32376", "blockNumber": "0x182f7b", "contractAddress": null, "cumulativeGasUsed": "0xb705", "depositNonce": "0x182f7a", "effectiveGasPrice": "0x0", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gasUsed": "0xb705", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x4200000000000000000000000000000000000015", "transactionHash": "0x7183552985456c12574cee308ee6d87e94c26bf79e5544c3faa27560a4547d58", "transactionIndex": "0x0", "type": "0x7e" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/rollux/web3/ title: Rollux — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/rollux/web3.mdx --- # Rollux — web3, net, eth (1/3) > API reference for [Rollux](/rpc-service/chains/chains-api/rollux/). [All methods ->](/rpc-service/chains/chains-api/rollux/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/rollux/web3-p2/) · [3](/rpc-service/chains/chains-api/rollux/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Geth/v0.1.0-unstable-7d8421c8-20230327/linux-amd64/go1.20.2" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "57000" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3b9aca32" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x181d6c" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x0C4213EAF74f78dF9edcd4737cDa7f536a034e30", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x79034F498a4cf7329E3253a7a40108A349a4f824", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x5D2238753F3ca5E649f9250C303d5c196A069F24", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x27d01ddaf2778e496ed7450982f981899b2615eed9c08acdefc8bf1a72c50b8f"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x181F99"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x27d01ddaf2778e496ed7450982f981899b2615eed9c08acdefc8bf1a72c50b8f"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x181F99"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/rollux/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/rollux/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/scroll/ title: Scroll description: Scroll is a zkEVM-based zkRollup on Ethereum that enables native compatibility for existing Ethereum… 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/scroll/index.mdx --- # Scroll
> Scroll API is available on [Web3 API platform](https://www.ankr.com/rpc/scroll). *Scroll* is a zkEVM-based zkRollup on Ethereum that enables native compatibility for existing Ethereum applications and tools. In order for your Web3 application to interact with Scroll — either by reading blockchain data or sending transactions to the network — it must connect to a Scroll node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/scroll/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/scroll/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/scroll/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/scroll/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/scroll/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/scroll/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/scroll/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/scroll/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/scroll/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/scroll/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/scroll/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/scroll/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/scroll/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/scroll/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/scroll/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/scroll/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/scroll/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/scroll/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/scroll/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/scroll/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/scroll/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/scroll/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/scroll/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/scroll/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/scroll/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/scroll/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/scroll/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/scroll/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/scroll/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/scroll/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/scroll/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/scroll/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/scroll/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/scroll/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/scroll/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/scroll/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/scroll/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/scroll/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/scroll/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/scroll/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/scroll/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/scroll/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/scroll/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/scroll/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/scroll/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/scroll/web3-p2/ title: Scroll — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/scroll/web3-p2.mdx --- # Scroll — web3, net, eth (2/3) > API reference for [Scroll](/rpc-service/chains/chains-api/scroll/). [All methods ->](/rpc-service/chains/chains-api/scroll/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/scroll/web3/) · 2 · [3](/rpc-service/chains/chains-api/scroll/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xa27ed65225f17e52e37fe17179c7555ef7872f327b207003052526f8984bc555", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x7", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1dcd6500", "gasUsed": "0xbf3e21", "hash": "0xe57223771971444a9f9974bf9d71b5c5063096f8797cea488ebed3b0982cdef4", "logsBloom": "0x00000000000000000000000000000000800000000000000000000000100000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000002000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xfe5c98dc6083eacfe955c095880335ca1ab7e89f", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x258d48", "parentHash": "0x20e6410c7730e15a294f008ba67803c48b6945c7159e5b95fff24d362fa587fa", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x57d0", "stateRoot": "0x9da992aa17632dab93e1679d2fdd1610bbc63e20f0584f2bce3a7b006704f2c8", "timestamp": "0x6442808d", "totalDifficulty": "0x0", "transactions": [ "0x89155bd6674bce4118473c5f77b8b8c8d673708059e408509472a03de2d610a8", "0xffed7a903eb8e35dee7fc6fb0958d17e9f45abae74b47e7876640b9d81852a25" ], "transactionsRoot": "0xa5dbf4dd415d4b17dbb49ed09ef5228fa4311fc66e713ca3e8251d1f7cd7a1f2", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x2", "extraData": "0xd983030102846765746889676f312e31382e3130856c696e7578000000000000162454003bbc8571ef43bd352a9b2c6df90dfdbe66d2942b8b3209c01821e2d67fc7c8f3abde5c06358d36e9c7f4711fd847c0781ee5aa9271169fca4577365900", "gasLimit": "0x7a1200", "gasUsed": "0x2350bd", "hash": "0xe07f4c85980a3f032456a52d8015eb1c33df87b5fedd2952fe0d81a34aaf98d9", "logsBloom": "0x000000000000004000201018008000000000080002000001028020008000000000000100000000200000400000000100000000000002200004040001402010000080001000800c0800000008000800000001000000200000000000008000040000400000020000020000002200000820000000000800200000000010040944400000020048000000000000020000000000040001008000000001000000000000020000000080200000040000000200200020000000000000100000000000000800000002000008000020080008000000000000000000000000000000000020000010000000000040000020040000008000400080000200600000100000004a00", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x1bd335", "parentHash": "0xd8153412ddb0d95a2eb4911f279ea1506318648061df37dacecc77bb1a80a5ba", "receiptsRoot": "0x513a8f472f83f34893982bc3c012ab65d5b30b3491acf3ab92165244ffb230b1", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x2a2d", "stateRoot": "0x2455bcdbb354e7684dfafa5a01b5360b24363578e494bfa050993780823cf498", "timestamp": "0x64511d7e", "totalDifficulty": "0x37a62c", "transactions": [ "0x0c70bcb18492df1e2f9253af520ad9f7b4bbbf5d932503f421d62b692e254823", "0x080615f071b01dfc549742805650c141d9af344b1d0e63320cdcbce9e2ea33c4", "0x327b5bbba0d96b64ab3702f900d745ae03c936b885a33eed3a66f0d73d5707fc", "0x9e17acdc0d315a25ba92ad50036ff415a01ecf92457aa7fedf2a4c82b3ae7a3c", "0x574fd33b9eb85f35dd8930f230cb4719c4e1e5a3a0a3ec414a4947df1fb8c363", "0x28bb7b06b6d5f1253440db05922643af50ebfac4bc1054c27701320720b3b84a" ], "transactionsRoot": "0x9c42d059812cd46eb8a7cade5d17dbc3fa952dfec1729948b24b77828950fb2f", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x56bd9725a88d6c921be73989a9b07aa510aea960bed3fe1e4a2079e5a7080866"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe57223771971444a9f9974bf9d71b5c5063096f8797cea488ebed3b0982cdef4", "blockNumber": "0x258d48", "from": "0x2bcfe12a949267e3da5874e44554b29fa4b753e6", "gas": "0x5208", "gasPrice": "0x59682f07", "maxFeePerGas": "0x59682f0e", "maxPriorityFeePerGas": "0x59682f00", "hash": "0x89155bd6674bce4118473c5f77b8b8c8d673708059e408509472a03de2d610a8", "input": "0x", "nonce": "0x1495", "to": "0xce95205bd0c62b07632a58ce014df56a8826c895", "transactionIndex": "0x0", "value": "0x29a2241af62c0000", "type": "0x2", "accessList": [], "chainId": "0x1b59", "v": "0x1", "r": "0xe792908cf13aaf7feb3647a5f6dbcb43b792044193e7fe2f3b072fe3e0b2c9f5", "s": "0x71e89e72e509dd7d9f21c522ae4c4511d2016fc1ccb988fbb6b6c81736ffc1a5" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x78a2ee41bf3e3aa90ca86a417a570dae0b7a2fb6d07e930a8863b113714b28aa", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe57223771971444a9f9974bf9d71b5c5063096f8797cea488ebed3b0982cdef4", "blockNumber": "0x258d48", "from": "0x2bcfe12a949267e3da5874e44554b29fa4b753e6", "gas": "0x5208", "gasPrice": "0x59682f07", "maxFeePerGas": "0x59682f0e", "maxPriorityFeePerGas": "0x59682f00", "hash": "0x89155bd6674bce4118473c5f77b8b8c8d673708059e408509472a03de2d610a8", "input": "0x", "nonce": "0x1495", "to": "0xce95205bd0c62b07632a58ce014df56a8826c895", "transactionIndex": "0x0", "value": "0x29a2241af62c0000", "type": "0x2", "accessList": [], "chainId": "0x1b59", "v": "0x1", "r": "0xe792908cf13aaf7feb3647a5f6dbcb43b792044193e7fe2f3b072fe3e0b2c9f5", "s": "0x71e89e72e509dd7d9f21c522ae4c4511d2016fc1ccb988fbb6b6c81736ffc1a5" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xc0dacceafa20dfa3b17d7eac4c92a1c9f634156cf4208634d962c330ff00c6d4", "blockNumber": "0x1bd373", "from": "0x9e88f77a3bad85f77d4d7a71ad5029921fb1a3bf", "gas": "0x5eba", "gasPrice": "0xf4240", "hash": "0x3d495cd9c17914ad455070fce019e88a97c52fccc05f1488838a83150b903889", "input": "0xd09de08a", "nonce": "0x4f", "to": "0x14cf6809d47a90774f3e454e22464e2208bcdbc2", "transactionIndex": "0x0", "value": "0x0", "type": "0x0", "v": "0x104ec5", "r": "0xd34890b17836c1bac4b93abc96dce2d02605dcfe4171da23737290d4acd0454b", "s": "0x256c12db87e41e7fabfc9f26ca244570bc8687185cfb592c5e4973f7052dc450" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/scroll/web3-p3/ title: Scroll — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/scroll/web3-p3.mdx --- # Scroll — web3, net, eth (3/3) > API reference for [Scroll](/rpc-service/chains/chains-api/scroll/). [All methods ->](/rpc-service/chains/chains-api/scroll/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/scroll/web3/) · [2](/rpc-service/chains/chains-api/scroll/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x4f8f2af943f4772cc839630a0eee717ef772effd17108b71d3682f88397dc35c"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe57223771971444a9f9974bf9d71b5c5063096f8797cea488ebed3b0982cdef4", "blockNumber": "0x258d48", "contractAddress": null, "cumulativeGasUsed": "0x76b8ce", "effectiveGasPrice": "0x59682f07", "from": "0x2bcfe12a949267e3da5874e44554b29fa4b753e6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0xce95205bd0c62b07632a58ce014df56a8826c895", "transactionHash": "0x89155bd6674bce4118473c5f77b8b8c8d673708059e408509472a03de2d610a8", "transactionIndex": "0x0" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xe2e91bbe607850e420ddaf88c86cfb3b866d1720ab34ad3b6e210129aa4cb4b8", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x88402E", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xB962416d5166BA33251a7c0516691dEfbC4F3416"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/scroll/web3/ title: Scroll — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/scroll/web3.mdx --- # Scroll — web3, net, eth (1/3) > API reference for [Scroll](/rpc-service/chains/chains-api/scroll/). [All methods ->](/rpc-service/chains/chains-api/scroll/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/scroll/web3-p2/) · [3](/rpc-service/chains/chains-api/scroll/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Geth/v3.1.2-alpha-b986f1ea/linux-amd64/go1.20" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "534353" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xf4240" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1bd107" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xED628DB74acC951d6B622BA37836cE7115aD0D3E", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x2A0529679712FE748E948B03B2c6A25D71cedC7E", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x6186d5Fbd5437E2E1884d12eFde897850C12c1b4", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x281" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x63d3e62c42e9e6249835fc493167189e5b0a44e4ffea04096aee169686776084"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "null" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x63d3e62c42e9e6249835fc493167189e5b0a44e4ffea04096aee169686776084"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "null" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x3418eaFea1B214E419Bf8D90D94d33348e85577C", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/scroll/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/scroll/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0xce95205Bd0C62b07632a58Ce014DF56a8826C895","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/secret-network/ title: Secret Network description: Secret Network is the first blockchain with customizable privacy. Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/secret-network/index.mdx --- # Secret Network
> Secret Network API is available on [Web3 API platform](https://www.ankr.com/rpc/scrt). *Secret Network* is the first blockchain with customizable privacy. You get to choose what you share, who you share with, and how long you share it for. This protects users and empowers developers to build a better Web3. We support the following networks and protocols for Secret Network: * [Tendermint JSON-RPC/REST API](/rpc-service/chains/chains-api/secret-network/#tendermint-json-rpcrest-methods) * [Cosmos REST API](/rpc-service/chains/chains-api/secret-network/#cosmos-rest-methods) Currently, we provide two interfaces to query Secret Network API — [JSON-RPC](https://www.jsonrpc.org/specification) and REST. Responses for both of them come in [JSON format](https://www.json.org/json-en.html). Here is the request/response structure to use for querying: ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/block?height=1 ``` ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/base/tendermint/v1beta1/blocks/{height} ``` ```json { "id": 0, "jsonrpc": "2.0", "result": { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } } ``` --- ## Tendermint JSON-RPC/REST methods **Info — node information**: * [`blockchain`](/rpc-service/chains/chains-api/secret-network/information/#blockchain) — retrieves block headers (max: 20) for `minHeight <= height <= maxHeight`. * [`block`](/rpc-service/chains/chains-api/secret-network/information/#block) — retrieves a block at a specified height. * [`block_by_hash`](/rpc-service/chains/chains-api/secret-network/information/#block_by_hash) — retrieves a block by hash. * [`block_results`](/rpc-service/chains/chains-api/secret-network/information/#block_results) — retrieves block results at a specified height. * [`commit`](/rpc-service/chains/chains-api/secret-network/information/#commit) — retrieves commit results at a specified height. * [`validators`](/rpc-service/chains/chains-api/secret-network/information/#validators) — retrieves a validator set at a specified height. * [`genesis_chunked`](/rpc-service/chains/chains-api/secret-network/information/#genesis_chunked) — retrieves the Genesis in multiple chunks. * [`dump_consensus_state`](/rpc-service/chains/chains-api/secret-network/information/#dump_consensus_state) — retrieves consensus state. * [`consensus_state`](/rpc-service/chains/chains-api/secret-network/information-p2/#consensus_state) — retrieves consensus state. * [`consensus_params`](/rpc-service/chains/chains-api/secret-network/information-p2/#consensus_params) — retrieves consensus parameters. * [`unconfirmed_txs`](/rpc-service/chains/chains-api/secret-network/information-p2/#unconfirmed_txs) — retrieves the list of unconfirmed transactions. * [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/secret-network/information-p2/#num_unconfirmed_txs) — retrieves data about unconfirmed transactions. * [`tx_search`](/rpc-service/chains/chains-api/secret-network/information-p2/#tx_search) — searches for transactions. * [`block_search`](/rpc-service/chains/chains-api/secret-network/information-p2/#block_search) — searches for blocks by `BeginBlock` and `EndBlock` events. * [`tx`](/rpc-service/chains/chains-api/secret-network/information-p2/#tx) — retrieves transactions by hash. **Tx — transactions broadcast information**: * [`broadcast_tx_sync`](/rpc-service/chains/chains-api/secret-network/information-p2/#broadcast_tx_sync) — returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. * [`broadcast_tx_async`](/rpc-service/chains/chains-api/secret-network/information-p2/#broadcast_tx_async) — returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. * [`broadcast_tx_commit`](/rpc-service/chains/chains-api/secret-network/information-p2/#broadcast_tx_commit) — returns with the responses from `CheckTx` and `DeliverTx`. * [`check_tx`](/rpc-service/chains/chains-api/secret-network/information-p2/#check_tx) — checks the transaction without executing it. **ABCI — ABCI info**: * [`abci_info`](/rpc-service/chains/chains-api/secret-network/information-p3/#abci_info) — retrieves info about the application. * [`abci_query`](/rpc-service/chains/chains-api/secret-network/information-p3/#abci_query) — queries the application for some information. --- ## Cosmos REST methods **Gaia REST**: * [`/node_info`](/rpc-service/chains/chains-api/secret-network/information-p3/#node_info) — retrieves the properties of the connected node. **Transactions**: * [`/txs`](/rpc-service/chains/chains-api/secret-network/information-p3/#txs) — broadcasts a signed transaction to a full node. **Staking**: * [`/staking/delegators/{delegatorAddr}/delegations`](/rpc-service/chains/chains-api/secret-network/information-p3/#stakingdelegatorsdelegatoraddrdelegations) — submits a delegation. * [`/staking/delegators/{delegatorAddr}/unbonding_delegations`](/rpc-service/chains/chains-api/secret-network/information-p3/#stakingdelegatorsdelegatoraddrunbonding_delegations) — submits an unbonding delegation. **Query**: * [`/cosmos/auth/v1beta1/accounts`](/rpc-service/chains/chains-api/secret-network/query/#cosmosauthv1beta1accounts) — retrieves all the existing accounts. * [`/cosmos/auth/v1beta1/accounts/{address}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosauthv1beta1accountsaddress) — retrieves account details based on address. * [`/cosmos/auth/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query/#cosmosauthv1beta1params) — retrieves all parameters. * [`/cosmos/bank/v1beta1/balances/{address}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1balancesaddress) — retrieves the balance of all coins for a single account. * [`/cosmos/bank/v1beta1/balances/{address}/{denom}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1balancesaddressdenom) — retrieves the balance of a single coin for a single account. * [`/cosmos/bank/v1beta1/denoms_metadata`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1denoms_metadata) — retrieves the client metadata for all registered coin denominations. * [`/cosmos/bank/v1beta1/denoms_metadata/{denom}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1denoms_metadatadenom) — retrieves the client metadata of a given coin denomination. * [`/cosmos/bank/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1params) — retrieves the parameters of x/bank module. * [`/cosmos/bank/v1beta1/supply`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1supply) — retrieves the total supply of all coins. * [`/cosmos/distribution/v1beta1/community_pool`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1community_pool) — retrieves the community pool coins. * [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1delegatorsdelegator_addressrewards) — retrieves the total rewards accrued by each validator. * [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1delegatorsdelegator_addressrewardsvalidator_address) — retrieves the total rewards accrued by a delegation. * [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1delegatorsdelegator_addressvalidators) — retrieves the validators of a delegator. * [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1delegatorsdelegator_addresswithdraw_address) — retrieves a withdrawal address of a delegator. * [`/cosmos/distribution/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1params) — retrieves parameters of the distribution module. * [`/cosmos/distribution/v1beta1/validators/{validator_address}/commission`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1validatorsvalidator_addresscommission) — retrieves accumulated commission for a validator. * [`/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1validatorsvalidator_addressoutstanding_rewards) — retrieves rewards of a validator address. * [`/cosmos/distribution/v1beta1/validators/{validator_address}/slashes`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1validatorsvalidator_addressslashes) — retrieves slash events of a validator. * [`/cosmos/evidence/v1beta1/evidence`](/rpc-service/chains/chains-api/secret-network/query/#cosmosevidencev1beta1evidence) — retrieves all evidence. * [`/cosmos/evidence/v1beta1/evidence/{evidence_hash}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosevidencev1beta1evidenceevidence_hash) — retrieves evidence based on evidence hash. * [`/cosmos/gov/v1beta1/params/{params_type}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosgovv1beta1paramsparams_type) — retrieves all parameters of the gov module. * [`/cosmos/gov/v1beta1/proposals`](/rpc-service/chains/chains-api/secret-network/query/#cosmosgovv1beta1proposals) — retrieves all proposals based on given status. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_id) — retrieves proposal details based on proposal ID. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_iddeposits) — retrieves all deposits of a single proposal. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_iddepositsdepositor) — retrieves single deposit information based on proposal ID and deposit address. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}/tally`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_idtally) — retrieves the tally of a proposal vote. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_idvotes) — retrieves votes of a given proposal. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_idvotesvoter) — retrieves voted information based on proposal ID and voter address. * [`/cosmos/mint/v1beta1/annual_provisions`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosmintv1beta1annual_provisions) — retrieves the current minting annual provisions value. * [`/cosmos/mint/v1beta1/inflation`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosmintv1beta1inflation) — retrieves the current minting inflation value. * [`/cosmos/mint/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosmintv1beta1params) — retrieves the total set of minting parameters. * [`/cosmos/slashing/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosslashingv1beta1params) — retrieves the parameters of a slashing module. * [`/cosmos/slashing/v1beta1/signing_infos`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosslashingv1beta1signing_infos) — retrieves signing info of all validators. * [`/cosmos/slashing/v1beta1/signing_infos/{cons_address}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosslashingv1beta1signing_infoscons_address) — retrieves the signing info of given cons address. * [`/cosmos/staking/v1beta1/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1delegationsdelegator_addr) — retrieves all delegations of a given delegator address. * [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrredelegations) — retrieves redelegations of a given address. * [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrunbonding_delegations) — retrieves all unbonding delegations of a given delegator address. * [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidators) — retrieves all validators info for a given delegator address. * [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidatorsvalidator_addr) — retrieves validator info by given delegator validator pair. * [`/cosmos/staking/v1beta1/historical_info/{height}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1historical_infoheight) — retrieves the historical info for a given height. * [`/cosmos/staking/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1params) — retrieves the staking parameters. * [`/cosmos/staking/v1beta1/pool`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1pool) — retrieves the pool info. * [`/cosmos/staking/v1beta1/validators`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validators) — retrieves all validators that match the given status. * [`/cosmos/staking/v1beta1/validators/{validator_addr}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validatorsvalidator_addr) — retrieves validator info for a given validator address. * [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegations) — retrieves delegate info for a given validator. * [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addr) — retrieves delegate info for given validator delegator pair. * [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addrunbonding_delegation) — retrieves unbonding info for given validator delegator pair. * [`/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrunbonding_delegations) — retrieves unbonding delegations of a given validator address. * [`/cosmos/upgrade/v1beta1/applied_plan/{name}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosupgradev1beta1applied_planname) — retrieves a previously applied upgrade plan by its name. * [`/cosmos/upgrade/v1beta1/current_plan`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosupgradev1beta1current_plan) — retrieves the current upgrade plan. * [`/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosupgradev1beta1upgraded_consensus_statelast_height) — retrieves the consensus state that will serve as a trusted kernel for the next version of this chain. * [`/cosmos/authz/v1beta1/grants`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosauthzv1beta1grants) — retrieves the list of `Authorization`, granted to the grantee by the granter. * [`/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosfeegrantv1beta1allowancegrantergrantee) — retrieves the fee granted to the grantee by the granter. * [`/cosmos/feegrant/v1beta1/allowances/{grantee}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosfeegrantv1beta1allowancesgrantee) — retrieves all the grants for an address. **Services**: * [`/cosmos/base/tendermint/v1beta1/blocks/latest`](/rpc-service/chains/chains-api/secret-network/services/#cosmosbasetendermintv1beta1blockslatest) — retrieves the latest block. * [`/cosmos/base/tendermint/v1beta1/blocks/{height}`](/rpc-service/chains/chains-api/secret-network/services/#cosmosbasetendermintv1beta1blocksheight) — retrieves the block for a given height. * [`/cosmos/base/tendermint/v1beta1/validatorsets/latest`](/rpc-service/chains/chains-api/secret-network/services/#cosmosbasetendermintv1beta1validatorsetslatest) — retrieves the latest validator-set. * [`/cosmos/base/tendermint/v1beta1/validatorsets/{height}`](/rpc-service/chains/chains-api/secret-network/services/#cosmosbasetendermintv1beta1validatorsetsheight) — retrieves the validator-set at a given height. * [`/cosmos/tx/v1beta1/simulate`](/rpc-service/chains/chains-api/secret-network/services/#cosmostxv1beta1simulate) — simulates executing a transaction to estimate gas usage. * [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/secret-network/services/#cosmostxv1beta1txs) — retrieves transactions by event. * [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/secret-network/services/#cosmostxv1beta1txs-1) — broadcasts a transaction. * [`/cosmos/tx/v1beta1/txs/{hash}`](/rpc-service/chains/chains-api/secret-network/services/#cosmostxv1beta1txshash) — retrieves a transaction by hash. --- ## Methods ### Information, Transactions, ABCI, Gaia REST, Staking - [`blockchain`](/rpc-service/chains/chains-api/secret-network/information/#blockchain) - [`block`](/rpc-service/chains/chains-api/secret-network/information/#block) - [`block_by_hash`](/rpc-service/chains/chains-api/secret-network/information/#block_by_hash) - [`block_results`](/rpc-service/chains/chains-api/secret-network/information/#block_results) - [`commit`](/rpc-service/chains/chains-api/secret-network/information/#commit) - [`validators`](/rpc-service/chains/chains-api/secret-network/information/#validators) - [`genesis_chunked`](/rpc-service/chains/chains-api/secret-network/information/#genesis_chunked) - [`dump_consensus_state`](/rpc-service/chains/chains-api/secret-network/information/#dump_consensus_state) - [`consensus_state`](/rpc-service/chains/chains-api/secret-network/information-p2/#consensus_state) - [`consensus_params`](/rpc-service/chains/chains-api/secret-network/information-p2/#consensus_params) - [`unconfirmed_txs`](/rpc-service/chains/chains-api/secret-network/information-p2/#unconfirmed_txs) - [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/secret-network/information-p2/#num_unconfirmed_txs) - [`tx_search`](/rpc-service/chains/chains-api/secret-network/information-p2/#tx_search) - [`block_search`](/rpc-service/chains/chains-api/secret-network/information-p2/#block_search) - [`tx`](/rpc-service/chains/chains-api/secret-network/information-p2/#tx) - [`broadcast_tx_sync`](/rpc-service/chains/chains-api/secret-network/information-p2/#broadcast_tx_sync) - [`Parameters`](/rpc-service/chains/chains-api/secret-network/query/#parameters-15) - [`broadcast_tx_async`](/rpc-service/chains/chains-api/secret-network/information-p2/#broadcast_tx_async) - [`broadcast_tx_commit`](/rpc-service/chains/chains-api/secret-network/information-p2/#broadcast_tx_commit) - [`check_tx`](/rpc-service/chains/chains-api/secret-network/information-p2/#check_tx) - [`abci_info`](/rpc-service/chains/chains-api/secret-network/information-p3/#abci_info) - [`abci_query`](/rpc-service/chains/chains-api/secret-network/information-p3/#abci_query) - [`/node_info`](/rpc-service/chains/chains-api/secret-network/information-p3/#node_info) - [`/txs`](/rpc-service/chains/chains-api/secret-network/information-p3/#txs) - [`/staking/delegators/{delegatorAddr}/delegations`](/rpc-service/chains/chains-api/secret-network/information-p3/#stakingdelegatorsdelegatoraddrdelegations) - [`/staking/delegators/{delegatorAddr}/unbonding_delegations`](/rpc-service/chains/chains-api/secret-network/information-p3/#stakingdelegatorsdelegatoraddrunbonding_delegations) ### Query - [`/cosmos/auth/v1beta1/accounts`](/rpc-service/chains/chains-api/secret-network/query/#cosmosauthv1beta1accounts) - [`/cosmos/auth/v1beta1/accounts/{address}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosauthv1beta1accountsaddress) - [`/cosmos/auth/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query/#cosmosauthv1beta1params) - [`/cosmos/bank/v1beta1/balances/{address}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1balancesaddress) - [`/cosmos/bank/v1beta1/balances/{address}/{denom}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1balancesaddressdenom) - [`/cosmos/bank/v1beta1/denoms_metadata`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1denoms_metadata) - [`/cosmos/bank/v1beta1/denoms_metadata/{denom}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1denoms_metadatadenom) - [`/cosmos/bank/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1params) - [`/cosmos/bank/v1beta1/supply`](/rpc-service/chains/chains-api/secret-network/query/#cosmosbankv1beta1supply) - [`/cosmos/distribution/v1beta1/community_pool`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1community_pool) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1delegatorsdelegator_addressrewards) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1delegatorsdelegator_addressrewardsvalidator_address) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1delegatorsdelegator_addressvalidators) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1delegatorsdelegator_addresswithdraw_address) - [`/cosmos/distribution/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1params) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/commission`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1validatorsvalidator_addresscommission) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1validatorsvalidator_addressoutstanding_rewards) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/slashes`](/rpc-service/chains/chains-api/secret-network/query/#cosmosdistributionv1beta1validatorsvalidator_addressslashes) - [`/cosmos/evidence/v1beta1/evidence`](/rpc-service/chains/chains-api/secret-network/query/#cosmosevidencev1beta1evidence) - [`/cosmos/evidence/v1beta1/evidence/{evidence_hash}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosevidencev1beta1evidenceevidence_hash) - [`/cosmos/gov/v1beta1/params/{params_type}`](/rpc-service/chains/chains-api/secret-network/query/#cosmosgovv1beta1paramsparams_type) - [`/cosmos/gov/v1beta1/proposals`](/rpc-service/chains/chains-api/secret-network/query/#cosmosgovv1beta1proposals) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_id) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_iddeposits) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_iddepositsdepositor) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/tally`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_idtally) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_idvotes) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosgovv1beta1proposalsproposal_idvotesvoter) - [`/cosmos/mint/v1beta1/annual_provisions`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosmintv1beta1annual_provisions) - [`Response example`](/rpc-service/chains/chains-api/secret-network/information/#response-example) - [`/cosmos/mint/v1beta1/inflation`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosmintv1beta1inflation) - [`/cosmos/mint/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosmintv1beta1params) - [`/cosmos/slashing/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosslashingv1beta1params) - [`/cosmos/slashing/v1beta1/signing_infos`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosslashingv1beta1signing_infos) - [`/cosmos/slashing/v1beta1/signing_infos/{cons_address}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosslashingv1beta1signing_infoscons_address) - [`/cosmos/staking/v1beta1/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1delegationsdelegator_addr) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrredelegations) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrunbonding_delegations) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidators) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidatorsvalidator_addr) - [`/cosmos/staking/v1beta1/historical_info/{height}`](/rpc-service/chains/chains-api/secret-network/query-p2/#cosmosstakingv1beta1historical_infoheight) - [`/cosmos/staking/v1beta1/params`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1params) - [`/cosmos/staking/v1beta1/pool`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1pool) - [`/cosmos/staking/v1beta1/validators`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validators) - [`/cosmos/staking/v1beta1/validators/{validator_addr}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validatorsvalidator_addr) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegations) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addr) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addrunbonding_delegation) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrunbonding_delegations) - [`/cosmos/upgrade/v1beta1/applied_plan/{name}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosupgradev1beta1applied_planname) - [`/cosmos/upgrade/v1beta1/current_plan`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosupgradev1beta1current_plan) - [`/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosupgradev1beta1upgraded_consensus_statelast_height) - [`/cosmos/authz/v1beta1/grants`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosauthzv1beta1grants) - [`/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosfeegrantv1beta1allowancegrantergrantee) - [`/cosmos/feegrant/v1beta1/allowances/{grantee}`](/rpc-service/chains/chains-api/secret-network/query-p3/#cosmosfeegrantv1beta1allowancesgrantee) ### Services - [`/cosmos/base/tendermint/v1beta1/blocks/latest`](/rpc-service/chains/chains-api/secret-network/services/#cosmosbasetendermintv1beta1blockslatest) - [`/cosmos/base/tendermint/v1beta1/blocks/{height}`](/rpc-service/chains/chains-api/secret-network/services/#cosmosbasetendermintv1beta1blocksheight) - [`/cosmos/base/tendermint/v1beta1/validatorsets/latest`](/rpc-service/chains/chains-api/secret-network/services/#cosmosbasetendermintv1beta1validatorsetslatest) - [`/cosmos/base/tendermint/v1beta1/validatorsets/{height}`](/rpc-service/chains/chains-api/secret-network/services/#cosmosbasetendermintv1beta1validatorsetsheight) - [`/cosmos/tx/v1beta1/simulate`](/rpc-service/chains/chains-api/secret-network/services/#cosmostxv1beta1simulate) - [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/secret-network/services/#cosmostxv1beta1txs-1) - [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/secret-network/services/#cosmostxv1beta1txs-1) - [`/cosmos/tx/v1beta1/txs/{hash}`](/rpc-service/chains/chains-api/secret-network/services/#cosmostxv1beta1txshash) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/secret-network/information-p2/ title: Secret Network — Information, Transactions, ABCI, Gaia REST, Staking (2/3) source: docs/rpc-service/chains/chains-api/secret-network/information-p2.mdx --- # Secret Network — Information, Transactions, ABCI, Gaia REST, Staking (2/3) > API reference for [Secret Network](/rpc-service/chains/chains-api/secret-network/). [All methods ->](/rpc-service/chains/chains-api/secret-network/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/secret-network/information/) · 2 · [3](/rpc-service/chains/chains-api/secret-network/information-p3/) ## Information ### `consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns Consensus state results. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/consensus_state ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "round_state": { "height/round/step": "1262197/0/8", "start_time": "2019-08-01T11:52:38.962730289Z", "proposal_block_hash": "634ADAF1F402663BEC2ABC340ECE8B4B45AA906FA603272ACC5F5EED3097E009", "locked_block_hash": "634ADAF1F402663BEC2ABC340ECE8B4B45AA906FA603272ACC5F5EED3097E009", "valid_block_hash": "634ADAF1F402663BEC2ABC340ECE8B4B45AA906FA603272ACC5F5EED3097E009", "height_vote_set": [ { "round": 0, "prevotes": [ "Vote{0:000001E443FD 1262197/00/1(Prevote) 634ADAF1F402 7BB974E1BA40 @ 2019-08-01T11:52:35.513572509Z}", "nil-Vote" ], "prevotes_bit_array": "BA{100:xxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} 169753436/170151262 = 1.00", "precommits": [ "Vote{5:18C78D135C9D 1262197/00/2(Precommit) 634ADAF1F402 8B5EFFFEABCD @ 2019-08-01T11:52:36.25600005Z}", "nil-Vote" ], "precommits_bit_array": "BA{100:xxxxxx_xxxxx_xxxx_x_xxx_xx_xx_xx__x_x_x__xxxxxxxxxxxxxx_xxxx_xx_xxxxxx_xxxxxxxx_xxxx_xxx_x_xxxx__xxx} 118726247/170151262 = 0.70" } ], "proposer": { "address": "D540AB022088612AC74B287D076DBFBC4A377A2E", "index": 0 } } } } ``` --- ### `consensus_params` > Retrieves consensus parameters. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be returned. #### Returns Consensus parameters results. #### Request parameters ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_params", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/consensus_params?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "block_height": "1", "consensus_params": { "block": { "max_bytes": "22020096", "max_gas": "1000", "time_iota_ms": "1000" }, "evidence": { "max_age": "100000" }, "validator": { "pub_key_types": [ "ed25519" ] } } } } ``` --- ### `unconfirmed_txs` > Retrieves the list of unconfirmed transactions. #### Parameters
* `limit` (integer; default: 30; max: 100): the maximum number of unconfirmed transactions to return. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unconfirmed_txs", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/unconfirmed_txs?limit=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "n_txs": "82", "total": "82", "total_bytes": "19974", "txs": [ "gAPwYl3uCjCMTXENChSMnIkb5ZpYHBKIZqecFEV2tuZr7xIUA75/FmYq9WymsOBJ0XSJ8yV8zmQKMIxNcQ0KFIyciRvlmlgcEohmp5wURXa25mvvEhQbrvwbvlNiT+Yjr86G+YQNx7kRVgowjE1xDQoUjJyJG+WaWBwSiGannBRFdrbma+8SFK2m+1oxgILuQLO55n8mWfnbIzyPCjCMTXENChSMnIkb5ZpYHBKIZqecFEV2tuZr7xIUQNGfkmhTNMis4j+dyMDIWXdIPiYKMIxNcQ0KFIyciRvlmlgcEohmp5wURXa25mvvEhS8sL0D0wwgGCItQwVowak5YB38KRIUCg4KBXVhdG9tEgUxMDA1NBDoxRgaagom61rphyECn8x7emhhKdRCB2io7aS/6Cpuq5NbVqbODmqOT3jWw6kSQKUresk+d+Gw0BhjiggTsu8+1voW+VlDCQ1GRYnMaFOHXhyFv7BCLhFWxLxHSAYT8a5XqoMayosZf9mANKdXArA=" ] } } ``` --- ### `num_unconfirmed_txs` > Retrieves data on unconfirmed transactions. #### Parameters
None. #### Returns The status of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "num_unconfirmed_txs", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/num_unconfirmed_txs ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "n_txs": "31", "total": "82", "total_bytes": "19974" } } ``` --- ### `tx_search` > Searches for transactions with their results. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height and txhash. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx_search", "params": ["4D2000", true, "1", "30", "asc"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/tx_search?query=tx.height%4D2000&prove=true&page=1&per_page=30&order_by=asc ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "txs": [ { "hash": "D70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED", "height": "1000", "index": 0, "tx_result": { "log": "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]", "gas_wanted": "200000", "gas_used": "28596", "tags": { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } }, "tx": "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=", "proof": { "RootHash": "72FE6BF6D4109105357AECE0A82E99D0F6288854D16D8767C5E72C57F876A14D", "Data": "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=", "Proof": { "total": "2", "index": "0", "leaf_hash": "eoJxKCzF3m72Xiwb/Q43vJ37/2Sx8sfNS9JKJohlsYI=", "aunts": [ "eWb+HG/eMmukrQj4vNGyFYb3nKQncAWacq4HF5eFzDY=" ] } } } ], "total_count": "2" } } ``` --- ### `block_search` > Searches for blocks by `BeginBlock` and `EndBlock` events. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height. #### Returns The list of paginated blocks matching the search criteria. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_search", "params": ["4D2000", "1", "30", "asc"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/block_search?query=block.height%4D2000&page=1&per_page=30&order_by=asc ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "blocks": [ { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } ], "total_count": 2 } } ``` --- ### `tx` > Retrieves a transaction by hash. #### Parameters
* `hash` (string; required): a hash of a transaction to retrieve. * `prove` (boolean; default: false): adds proofs of the transaction's inclusion in the block. #### Returns Transaction info. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx", "params": ["0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/tx?hash=0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED&prove=true ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "hash": "D70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED", "height": "1000", "index": 0, "tx_result": { "log": "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]", "gas_wanted": "200000", "gas_used": "28596", "tags": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] }, "tx": "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=" } } ``` --- ## Transactions ### `broadcast_tx_sync` > Returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSONRPC via a websocket. See https://docs.tendermint.com/v0.34/app-dev/subscribing-to-events-via-websocket.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. ### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_sync", "params": ["456"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/broadcast_tx_sync?tx=456 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "code": "0", "data": "", "log": "", "codespace": "ibc", "hash": "0D33F2F03A5234F38706E43004489E061AC40A2E" }, "error": "" } ``` --- ### `broadcast_tx_async` > Returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSONRPC via a websocket. See https://docs.tendermint.com/v0.34/app-dev/subscribing-to-events-via-websocket.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). 3. A node is offline. Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_async", "params": ["123"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/broadcast_tx_async?tx=123 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "code": "0", "data": "", "log": "", "codespace": "ibc", "hash": "0D33F2F03A5234F38706E43004489E061AC40A2E" }, "error": "" } ``` --- ### `broadcast_tx_commit` > Returns with the responses from `CheckTx` and `DeliverTx`. :::warning Use only for testing and development. In production, use `BroadcastTxSync` or `BroadcastTxAsync`. You can subscribe for the transaction result using JSONRPC via a websocket (see [Tendermint docs](https://docs.tendermint.com/v0.34/app-dev/subscribing-to-events-via-websocket.html)). ::: :::tip CONTRACT: only returns error if `mempool.CheckTx()` errs or if we timeout waiting for tx to commit. If `CheckTx` or `DeliverTx` fails, no error will be returned, but the result will contain a non-OK ABCI code. Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. ::: #### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_commit", "params": ["785"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/broadcast_tx_commit?tx=785 ``` #### Response example ```json { "error": "", "result": { "height": "26682", "hash": "75CA0F856A4DA078FC4911580360E70CEFB2EBEE", "deliver_tx": { "log": "", "data": "", "code": "0" }, "check_tx": { "log": "", "data": "", "code": "0" } }, "id": 0, "jsonrpc": "2.0" } ``` --- ### `check_tx` > Checks the transaction without executing it. The transaction won't be added to the mempool. Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "check_tx", "params": ["785"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/check_tx?tx=785 ``` #### Response example ```json { "error": "", "result": { "code": "0", "data": "", "log": "", "info": "", "gas_wanted": "1", "gas_used": "0", "events": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "codespace": "bank" }, "id": 0, "jsonrpc": "2.0" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/secret-network/information-p3/ title: Secret Network — Information, Transactions, ABCI, Gaia REST, Staking (3/3) source: docs/rpc-service/chains/chains-api/secret-network/information-p3.mdx --- # Secret Network — Information, Transactions, ABCI, Gaia REST, Staking (3/3) > API reference for [Secret Network](/rpc-service/chains/chains-api/secret-network/). [All methods ->](/rpc-service/chains/chains-api/secret-network/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/secret-network/information/) · [2](/rpc-service/chains/chains-api/secret-network/information-p2/) · 3 ## ABCI ### `abci_info` > Retrieves application info. #### Parameters
None. #### Returns Application info. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_info", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/abci_info ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "response": { "data": "secret", "version": "1.6.1", "last_block_height": "7690381", "last_block_app_hash": "J1tJC9R3q3cNzkDcI7ipyi9NuZ8XUVbMyy7B42TPWuc=" } } } ``` --- ### `abci_query` > Queries the application for particular information. #### Parameters
* `path` (string; required): a path to the data ("/a/b/c"). * `data` (string; required): the data. * `height` (integer; default: 0): the height (0 means latest). * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. #### Returns Particular info according to the query submitted. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_query", "params": ["a/b/c", "the_data", "1", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/blockchain?path=%2Fa%2Fb%2Fc&data=the_data&height=1&prove=true ``` #### Response example ```json { "error": "", "result": { "response": { "log": "exists", "height": "0", "proof": "010114FED0DAD959F36091AD761C922ABA3CBF1D8349990101020103011406AA2262E2F448242DF2C2607C3CDC705313EE3B0001149D16177BC71E445476174622EA559715C293740C", "value": "61626364", "key": "61626364", "index": "-1", "code": "0" } }, "id": 0, "jsonrpc": "2.0" } ``` --- ## Gaia REST ### `/node_info` > Retrieves the properties of the connected node. #### Parameters
None. #### Returns Node status. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/node_info ``` #### Response example ```json { "application_version": { "build_tags": "string", "client_name": "string", "commit": "string", "go": "string", "name": "string", "server_name": "string", "version": "string" }, "node_info": { "id": "string", "moniker": "validator-name", "protocol_version": { "p2p": 7, "block": 10, "app": 0 }, "network": "gaia-2", "channels": "string", "listen_addr": "192.168.56.1:26656", "version": "0.15.0", "other": { "tx_index": "on", "rpc_address": "tcp://0.0.0.0:26657" } } } ``` --- ## Transactions ### `/txs` > Broadcasts a signed transaction to a full node. #### Parameters
* `txBroadcast` (object; required): the transaction must be a signed StdTx. The supported broadcast modes include `block` (returns after tx commit), `sync` (returns after CheckTx) and `async` (returns right away). ```json { "tx": { "msg": [ "string" ], "fee": { "gas": "string", "amount": [ { "denom": "stake", "amount": "50" } ] }, "memo": "string", "signature": { "signature": "MEUCIQD02fsDPra8MtbRsyB1w7bqTM55Wu138zQbFcWx4+CFyAIge5WNPfKIuvzBZ69MyqHsqD8S1IwiEp+iUb6VSdtlpgY=", "pub_key": { "type": "tendermint/PubKeySecp256k1", "value": "Avz04VhtKJh8ACCVzlI8aTosGy0ikFXKIVHQ3jKMrosH" }, "account_number": "0", "sequence": "0" } }, "mode": "block" } ``` #### Returns Tx broadcasting result. #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/scrt_cosmos/txs ``` #### Response example ```json { "check_tx": { "code": 0, "data": "data", "log": "log", "gas_used": 5000, "gas_wanted": 10000, "info": "info", "tags": [ "", "" ] }, "deliver_tx": { "code": 5, "data": "data", "log": "log", "gas_used": 5000, "gas_wanted": 10000, "info": "info", "tags": [ "", "" ] }, "hash": "EE5F3404034C524501629B56E0DDC38FAD651F04", "height": 0 } ``` --- ## Staking ### `/staking/delegators/{delegatorAddr}/delegations` > Submits a delegation. #### Parameters
* `delegation` (body): delegates an amount of liquid coins to a validator. ```json { "base_req": { "from": "cosmos1g9ahr6xhht5rmqven628nklxluzyv8z9jqjcmc", "memo": "Sent via Cosmos Voyager", "chain_id": "Cosmos-Hub", "account_number": "0", "sequence": "1", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "stake", "amount": "50" } ], "simulate": false }, "delegator_address": "cosmos1depk54cuajgkzea6zpgkq36tnjwdzv4afc3d27", "validator_address": "cosmosvaloper16xyempempp92x9hyzz9wrgf94r6j9h5f2w4n2l", "amount": { "denom": "stake", "amount": "50" } } ``` * `delegatorAddr` (string; required): a Bech32 AccAddress of a delegator. #### Returns Submission result codes: * 200 — OK. * 400 — Invalid delegator address or delegation request body. * 401 — Key password is wrong. * 500 — Internal Server Error. #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/scrt_cosmos/staking/delegators/{delegatorAddr}/delegations ``` #### Response example ```json { "msg": [ "string" ], "fee": { "gas": "string", "amount": [ { "denom": "stake", "amount": "50" } ] }, "memo": "string", "signature": { "signature": "MEUCIQD02fsDPra8MtbRsyB1w7bqTM55Wu138zQbFcWx4+CFyAIge5WNPfKIuvzBZ69MyqHsqD8S1IwiEp+iUb6VSdtlpgY=", "pub_key": { "type": "tendermint/PubKeySecp256k1", "value": "Avz04VhtKJh8ACCVzlI8aTosGy0ikFXKIVHQ3jKMrosH" }, "account_number": "0", "sequence": "0" } } ``` --- ### `/staking/delegators/{delegatorAddr}/unbonding_delegations` > Submits an unbonding delegation. #### Parameters
* `delegation` (body): unbonds an amount of bonded shares from a validator. ```json { "base_req": { "from": "cosmos1g9ahr6xhht5rmqven628nklxluzyv8z9jqjcmc", "memo": "Sent via Cosmos Voyager", "chain_id": "Cosmos-Hub", "account_number": "0", "sequence": "1", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "stake", "amount": "50" } ], "simulate": false }, "delegator_address": "cosmos1depk54cuajgkzea6zpgkq36tnjwdzv4afc3d27", "validator_address": "cosmosvaloper16xyempempp92x9hyzz9wrgf94r6j9h5f2w4n2l", "amount": { "denom": "stake", "amount": "50" } } ``` * `delegatorAddr` (string; required): a Bech32 AccAddress of a delegator. ``` cosmos16xyempempp92x9hyzz9wrgf94r6j9h5f06pxxv ``` #### Returns Result codes: * 200 — OK. * 400 — Invalid delegator address or unbonding delegation request body. * 401 — Key password is wrong. * 500 — Internal Server Error. #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/scrt_cosmos/staking/delegators/{delegatorAddr}/unbonding_delegations ``` #### Response example ```json { "msg": [ "string" ], "fee": { "gas": "string", "amount": [ { "denom": "stake", "amount": "50" } ] }, "memo": "string", "signature": { "signature": "MEUCIQD02fsDPra8MtbRsyB1w7bqTM55Wu138zQbFcWx4+CFyAIge5WNPfKIuvzBZ69MyqHsqD8S1IwiEp+iUb6VSdtlpgY=", "pub_key": { "type": "tendermint/PubKeySecp256k1", "value": "Avz04VhtKJh8ACCVzlI8aTosGy0ikFXKIVHQ3jKMrosH" }, "account_number": "0", "sequence": "0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/secret-network/information/ title: Secret Network — Information, Transactions, ABCI, Gaia REST, Staking (1/3) source: docs/rpc-service/chains/chains-api/secret-network/information.mdx --- # Secret Network — Information, Transactions, ABCI, Gaia REST, Staking (1/3) > API reference for [Secret Network](/rpc-service/chains/chains-api/secret-network/). [All methods ->](/rpc-service/chains/chains-api/secret-network/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/secret-network/information-p2/) · [3](/rpc-service/chains/chains-api/secret-network/information-p3/) ## Information ### `blockchain` > Retrieves block headers for `minHeight <= height <= maxHeight`. At most 20 items will return for the `minHeight` or `maxHeight` parameters specified. If `maxHeight` does not yet exist, the blocks up to the current height will return. If `minHeight` does not exist (pruning), the earliest existing height will be used. #### Parameters
* `minHeight` (integer): the minimum block height to return. * `maxHeight` (integer): the maximum block height to return. #### Returns Block headers, in descending order (highest first). #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "blockchain", "params": ["1", "2"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/blockchain?minHeight=1&maxHeight=2 ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "last_height": "1276718", "block_metas": [ { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block_size": 1000000, "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "num_txs": "54" } ] } } ``` --- ### `block` > Retrieves a block at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block is to be fetched. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/blockchain?height=1 ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } } ``` --- ### `block_by_hash` > Retrieves a block by hash. #### Parameters
* `hash` (string; required): a block hash. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_by_hash", "params": ["0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/block_by_hash?hash=0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } } ``` --- ### `block_results` > Retrieves block results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block info is to be fetched. #### Returns Block results. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_results", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/block_results?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "height": "12", "txs_results": [ { "code": "0", "data": "", "log": "not enough gas", "info": "", "gas_wanted": "100", "gas_used": "100", "events": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "codespace": "ibc" } ], "begin_block_events": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "end_block": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "validator_updates": [ { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "power": "300" } ], "consensus_params_updates": { "block": { "max_bytes": "22020096", "max_gas": "1000", "time_iota_ms": "1000" }, "evidence": { "max_age": "100000" }, "validator": { "pub_key_types": [ "ed25519" ] } } } } ``` --- ### `commit` > Retrieves commit results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be fetched. #### Returns Commit results. Canonical switches from false to true for block H once block H+1 has been committed, until then it's subjective and only reflects what this node has seen so far. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "commit", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/commit?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "signed_header": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "commit": { "height": "1311801", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "timestamp": "2019-04-22T17:01:58.376629719Z", "signature": "14jaTQXYRt8kbLKEhdHq7AXycrFImiLuZx50uOjs2+Zv+2i7RTG/jnObD07Jo2ubZ8xd7bNBJMqkgtkd0oQHAw==" } ] } }, "canonical": true } } ``` --- ### `validators` > Retrieves a validator set at a specified height. Validators are sorted by voting power. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the validator set corresponding to the latest block is to be fetched. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30; max: 100): a number of entries per page. #### Returns Commit results. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "validators", "params": ["1","1","30"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/validators?height=1&page=2&per_page=30 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "block_height": "55", "validators": [ { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } ], "count": "1", "total": "25" } } ``` --- ### `genesis_chunked` > Retrieves Genesis in multiple chunks. Gets genesis document in multiple chunks to make it easier to iterate through larger genesis structures. Each chunk is produced by converting the genesis document to JSON and then splitting the resulting payload into 16MB blocks, and then Base64-encoding each block. #### Parameters
* `chunk` (integer; default: 0): a sequence number of the chunk to download. #### Returns A Genesis chunk response. #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "genesis_chunked", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/genesis_chunked?chunk=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "chunk": 0, "total": 1, "data": "Z2VuZXNpcwo=" } } ``` --- ### `dump_consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns A complete consensus state. See the [Vote string description](https://pkg.go.dev/github.com/tendermint/tendermint/types?tab=doc#Vote.String). #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "dump_consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/dump_consensus_state ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "round_state": { "height": "1311801", "round": 0, "step": 3, "start_time": "2019-08-05T11:28:49.064658805Z", "commit_time": "2019-08-05T11:28:44.064658805Z", "validators": { "validators": [ { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } ], "proposer": { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } }, "locked_round": -1, "valid_round": "-1", "votes": [ { "round": "0", "prevotes": [ "nil-Vote", "Vote{19:46A3F8B8393B 1311801/00/1(Prevote) 000000000000 64CE682305CB @ 2019-08-05T11:28:47.374703444Z}" ], "prevotes_bit_array": "BA{100:___________________x________________________________________________________________________________} 209706/170220253 = 0.00", "precommits": [ "nil-Vote" ], "precommits_bit_array": "BA{100:____________________________________________________________________________________________________} 0/170220253 = 0.00" } ], "commit_round": -1, "last_commit": { "votes": [ "Vote{0:000001E443FD 1311800/00/2(Precommit) 3071ADB27D1A 77EE1B6B6847 @ 2019-08-05T11:28:43.810128139Z}" ], "votes_bit_array": "BA{100:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} 170220253/170220253 = 1.00", "peer_maj_23s": {} }, "last_validators": { "validators": [ { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } ], "proposer": { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } }, "triggered_timeout_precommit": false }, "peers": [ { "node_address": "357f6a6c1d27414579a8185060aa8adf9815c43c@68.183.41.207:26656", "peer_state": { "round_state": { "height": "1311801", "round": "0", "step": 3, "start_time": "2019-08-05T11:28:49.21730864Z", "proposal": false, "proposal_block_parts_header": { "total": 0, "hash": "" }, "proposal_pol_round": -1, "proposal_pol": "____________________________________________________________________________________________________", "prevotes": "___________________x________________________________________________________________________________", "precommits": "____________________________________________________________________________________________________", "last_commit_round": 0, "last_commit": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "catchup_commit_round": -1, "catchup_commit": "____________________________________________________________________________________________________" }, "stats": { "votes": "1159558", "block_parts": "4786" } } } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/secret-network/query-p2/ title: Secret Network — Query (2/3) source: docs/rpc-service/chains/chains-api/secret-network/query-p2.mdx --- # Secret Network — Query (2/3) > API reference for [Secret Network](/rpc-service/chains/chains-api/secret-network/). [All methods ->](/rpc-service/chains/chains-api/secret-network/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/secret-network/query/) · 2 · [3](/rpc-service/chains/chains-api/secret-network/query-p3/) ## Query ### `/cosmos/gov/v1beta1/proposals/{proposal_id}` > Retrieves proposal details based on proposal ID. #### Parameters
* `proposal_id` (string; uint64; path; required): the unique ID of the proposal. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id} ``` #### Response example ```json { "proposal": { "proposal_id": "string", "content": { "type_url": "string", "value": "string" }, "status": "PROPOSAL_STATUS_UNSPECIFIED", "final_tally_result": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" }, "submit_time": "2023-03-02T11:08:57.204Z", "deposit_end_time": "2023-03-02T11:08:57.204Z", "total_deposit": [ { "denom": "string", "amount": "string" } ], "voting_start_time": "2023-03-02T11:08:57.204Z", "voting_end_time": "2023-03-02T11:08:57.204Z" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` > Retrieves all deposits of a single proposal. #### Parameters
* `proposal_id` (string; uint64; path; required): the unique ID of the proposal. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits ``` #### Response example ```json { "deposits": [ { "proposal_id": "string", "depositor": "string", "amount": [ { "denom": "string", "amount": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}` > Retrieves single deposit information based on proposal ID and deposit address. #### Parameters
* `proposal_id` (string; uint64; path; required): the unique ID of the proposal. * `depositor` (string; path; required): the deposit addresses from the proposals. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor} ``` #### Response example ```json { "deposit": { "proposal_id": "string", "depositor": "string", "amount": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/tally` > Retrieves the tally of a proposal vote. #### Parameters
* `proposal_id` (string; uint64; path; required): the unique ID of the proposal. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id}/tally ``` #### Response example ```json { "tally": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/votes` > Retrieves the votes of a given proposal. #### Parameters
* `proposal_id` (string; uint64; path; required): the unique ID of the proposal. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id}/votes ``` #### Response example ```json { "votes": [ { "proposal_id": "string", "voter": "string", "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_UNSPECIFIED", "weight": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}` > Retrieves voted information based on proposal ID and voter address. #### Parameters
* `proposal_id` (string; uint64; path; required): the unique ID of the proposal. * `voter` (string; path; required): the voter address for the proposal. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter} ``` #### Response example ```json { "vote": { "proposal_id": "string", "voter": "string", "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_UNSPECIFIED", "weight": "string" } ] } } ``` --- ### `/cosmos/mint/v1beta1/annual_provisions` > Retrieves the current minting annual provisions value. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/mint/v1beta1/annual_provisions ``` ### Response example ```json { "annual_provisions": "string" } ``` --- ### `/cosmos/mint/v1beta1/inflation` > Retrieves the current minting inflation value. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/mint/v1beta1/inflation ``` #### Response example ```json { "inflation": "string" } ``` --- ### `/cosmos/mint/v1beta1/params` > Retrieves the total set of minting parameters. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/mint/v1beta1/params ``` #### Response example ```json { "params": { "mint_denom": "string", "inflation_rate_change": "string", "inflation_max": "string", "inflation_min": "string", "goal_bonded": "string", "blocks_per_year": "string" } } ``` --- ### `/cosmos/slashing/v1beta1/params` > Retrieves the parameters of a slashing module. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/slashing/v1beta1/params ``` #### Response example ```json { "params": { "signed_blocks_window": "string", "min_signed_per_window": "string", "downtime_jail_duration": "string", "slash_fraction_double_sign": "string", "slash_fraction_downtime": "string" } } ``` --- ### `/cosmos/slashing/v1beta1/signing_infos` > Retrieves signing info of all validators. #### Parameters
* `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/slashing/v1beta1/signing_infos ``` #### Response example ```json { "info": [ { "address": "string", "start_height": "string", "index_offset": "string", "jailed_until": "2023-03-02T11:34:53.641Z", "tombstoned": true, "missed_blocks_counter": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/slashing/v1beta1/signing_infos/{cons_address}` > Retrieves the signing info of given cons address. #### Parameters
* `cons_address` (string; path; required): the address to query signing info from. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/slashing/v1beta1/signing_infos/{cons_address} ``` #### Response example ```json { "val_signing_info": { "address": "string", "start_height": "string", "index_offset": "string", "jailed_until": "2023-03-02T11:37:10.986Z", "tombstoned": true, "missed_blocks_counter": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegations/{delegator_addr}` > Retrieves all delegations of a given delegator address. #### Parameters
* `delegator_addr` (string; path; required): the address of the delegator to query for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/delegations/{delegator_addr} ``` #### Response example ```json { "delegation_responses": [ { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations` > Retrieves redelegations of a given address. #### Parameters
* `delegator_addr` (string; path; required): the address of the delegator to query for. * `src_validator_addr` (string; query): the validator address to redelegate from. * `dst_validator_addr` (string; query): the validator address to redelegate to. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations ``` #### Response example ```json { "redelegation_responses": [ { "redelegation": { "delegator_address": "string", "validator_src_address": "string", "validator_dst_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2023-03-02T11:44:00.360Z", "initial_balance": "string", "shares_dst": "string" } ] }, "entries": [ { "redelegation_entry": { "creation_height": "string", "completion_time": "2023-03-02T11:44:00.360Z", "initial_balance": "string", "shares_dst": "string" }, "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations` > Retrieves all unbonding delegations of a given delegator address. #### Parameters
* `delegator_addr` (string; path; required): the address of the delegator to query for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations ``` #### Reponse example ```json { "unbonding_responses": [ { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2023-03-02T11:47:55.798Z", "initial_balance": "string", "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators` > Retrieves all validators info for a given delegator address. #### Parameters
* `delegator_addr` (string; path; required): the address of the delegator to query for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators ``` #### Response example ```json { "validators": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2023-03-02T11:50:03.594Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2023-03-02T11:50:03.594Z" }, "min_self_delegation": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}` > Retrieves validator info by given delegator validator pair. #### Parameters
* `delegator_addr` (string; path; required): the delegator address to query for. * `validator_addr` (string; path; required): the validator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr} ``` #### Response example ```json { "validator": { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2023-03-02T11:52:10.807Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2023-03-02T11:52:10.807Z" }, "min_self_delegation": "string" } } ``` --- ### `/cosmos/staking/v1beta1/historical_info/{height}` > Retrieves the historical info for a given height. #### Parameters
* `height` (string; int64; path; required): the height at which to query the historical data. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/historical_info/{height} ``` #### Response example ```json { "hist": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2023-03-02T11:55:21.837Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "valset": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2023-03-02T11:55:21.837Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2023-03-02T11:55:21.837Z" }, "min_self_delegation": "string" } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/secret-network/query-p3/ title: Secret Network — Query (3/3) source: docs/rpc-service/chains/chains-api/secret-network/query-p3.mdx --- # Secret Network — Query (3/3) > API reference for [Secret Network](/rpc-service/chains/chains-api/secret-network/). [All methods ->](/rpc-service/chains/chains-api/secret-network/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/secret-network/query/) · [2](/rpc-service/chains/chains-api/secret-network/query-p2/) · 3 ## Query ### `/cosmos/staking/v1beta1/params` > Retrieves the staking parameters. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/params ``` #### Response example ```json { "params": { "unbonding_time": "string", "max_validators": 0, "max_entries": 0, "historical_entries": 0, "bond_denom": "string" } } ``` --- ### `/cosmos/staking/v1beta1/pool` > Retrieves the pool info. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/pool ``` #### Response example ```json { "pool": { "not_bonded_tokens": "string", "bonded_tokens": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators` > Retrieves all validators that match the given status. #### Parameters
* `status` (string; query): a status to query the validators for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/validators ``` #### Response example ```json { "validators": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2023-03-02T12:05:06.275Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2023-03-02T12:05:06.275Z" }, "min_self_delegation": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}` > Retrieves validator info for a given validator address. #### Parameters
* `validator_addr` (string; path; required): the validator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/validators/{validator_addr} ``` #### Response example ```json { "validator": { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2023-03-02T12:11:37.556Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2023-03-02T12:11:37.556Z" }, "min_self_delegation": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations` > Retrieves delegate info for a given validator. #### Parameters
* `validator_addr` (string; path; required): the validator address to query for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/validators/{validator_addr}/delegations ``` #### Response example ```json { "delegation_responses": [ { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}` > Retrieves delegate info for given validator delegator pair. #### Parameters
* `validator_addr` (string; path; required): the validator address to query for. * `delegator_addr` (string; path; required): the delegator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr} ``` #### Response example ```json { "delegation_response": { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation` > Retrieves unbonding info for given validator delegator pair. #### Parameters
* `validator_addr` (string; path; required): the validator address to query for. * `delegator_addr` (string; path; required): the delegator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation ``` #### Response example ```json { "unbond": { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2023-03-02T12:22:06.905Z", "initial_balance": "string", "balance": "string" } ] } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations` > Retrieves unbonding delegations of a given validator address. #### Parameters
* `validator_addr` (string; path; required): the validator address to query for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations ``` #### Response example ```json { "unbonding_responses": [ { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2023-03-02T12:23:51.870Z", "initial_balance": "string", "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/upgrade/v1beta1/applied_plan/{name}` > Retrieves a previously applied upgrade plan by its name. #### Parameters
* `name` (string; path; required): the name of the applied plan to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/upgrade/v1beta1/applied_plan/{name} ``` #### Response example ```json { "height": "string" } ``` --- ### `/cosmos/upgrade/v1beta1/current_plan` > Retrieves the current upgrade plan. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/upgrade/v1beta1/current_plan ``` #### Response example ```json { "plan": { "name": "string", "time": "2023-03-02T12:29:52.518Z", "height": "string", "info": "string", "upgraded_client_state": { "type_url": "string", "value": "string" } } } ``` --- ### `/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}` > Retrieves the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain. `UpgradedConsensusState` RPC not supported with legacy querier. #### Parameters
* `last_height` (string; int64; path; required): the last height of the current chain must be sent in request as this is the height under which the next consensus state is stored. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height} ``` #### Response example ```json { "upgraded_consensus_state": "string" } ``` --- ### `/cosmos/authz/v1beta1/grants` > Retrieves the list of `Authorization`, granted to the grantee by the granter. #### Parameters
* `granter` (string; query): a granter. * `grantee` (string; query): a grantee. * `msg_type_url` (string; query): define to retrieve the grants matching a given message type. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/authz/v1beta1/grants ``` #### Response example ```json { "grants": [ { "authorization": { "type_url": "string", "value": "string" }, "expiration": "2023-03-02T12:52:34.325Z" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}` > Retrieves the fee granted to the grantee by the granter. #### Parameters
* `granter` (string; query): a granter. * `grantee` (string; query): a grantee. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee} ``` #### Response example ```json { "allowance": { "granter": "string", "grantee": "string", "allowance": { "type_url": "string", "value": "string" } } } ``` --- ### `/cosmos/feegrant/v1beta1/allowances/{grantee}` > Retrieves all the grants for an address. #### Parameters
* `grantee` (string; query): a grantee. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/feegrant/v1beta1/allowances/{grantee} ``` #### Response example ```json { "allowances": [ { "granter": "string", "grantee": "string", "allowance": { "type_url": "string", "value": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/secret-network/query/ title: Secret Network — Query (1/3) source: docs/rpc-service/chains/chains-api/secret-network/query.mdx --- # Secret Network — Query (1/3) > API reference for [Secret Network](/rpc-service/chains/chains-api/secret-network/). [All methods ->](/rpc-service/chains/chains-api/secret-network/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/secret-network/query-p2/) · [3](/rpc-service/chains/chains-api/secret-network/query-p3/) ## Query ### `/cosmos/auth/v1beta1/accounts` > Retrieves all the existing accounts. #### Parameters
* `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/auth/v1beta1/accounts ``` #### Response example ```json { "accounts": [ { "type_url": "string", "value": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/auth/v1beta1/accounts/{address}` > Retrieves account details based on address. #### Parameters
* `address` (string; path; required): the address of account to retrieve details for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/auth/v1beta1/accounts/{address} ``` #### Response example ```json { "account": { "type_url": "string", "value": "string" } } ``` --- ### `/cosmos/auth/v1beta1/params` > Retrieves all parameters. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/auth/v1beta1/params ``` #### Request example ```json { "params": { "max_memo_characters": "string", "tx_sig_limit": "string", "tx_size_cost_per_byte": "string", "sig_verify_cost_ed25519": "string", "sig_verify_cost_secp256k1": "string" } } ``` --- ### `/cosmos/bank/v1beta1/balances/{address}` > Retrieves the balance of all coins for a single account. #### Parameters
* `address` (string; path; required): the address to query balances for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/bank/v1beta1/balances/{address} ``` #### Response example ```json { "balances": [ { "denom": "string", "amount": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/bank/v1beta1/balances/{address}/{denom}` > Retrieves the balance of a single coin for a single account. #### Parameters
* `address` (string; path; required): the address to query balances for. * `denom` (string; path; required): the coin denom to query balances for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/bank/v1beta1/balances/{address}/{denom} ``` #### Response example ```json { "balance": { "denom": "string", "amount": "string" } } ``` --- ### `/cosmos/bank/v1beta1/denoms_metadata` > Retrieves the client metadata for all registered coin denominations. #### Parameters
* `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default - unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/bank/v1beta1/denoms_metadata ``` #### Response example ```json { "metadatas": [ { "description": "string", "denom_units": [ { "denom": "string", "exponent": 0, "aliases": [ "string" ] } ], "base": "string", "display": "string", "name": "string", "symbol": "string", "uri": "string", "uri_hash": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/bank/v1beta1/denoms_metadata/{denom}` > Retrieves the client metadata of a given coin denomination. #### Parameters
* `denom` (string; path; required): the coin denomination to query the metadata for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/bank/v1beta1/denoms_metadata/{denom} ``` #### Response example ```json { "metadata": { "description": "string", "denom_units": [ { "denom": "string", "exponent": 0, "aliases": [ "string" ] } ], "base": "string", "display": "string", "name": "string", "symbol": "string", "uri": "string", "uri_hash": "string" } } ``` --- ### `/cosmos/bank/v1beta1/params` > Retrieves the parameters of x/bank module. #### Parameter None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/bank/v1beta1/params ``` #### Response example ```json { "params": { "send_enabled": [ { "denom": "string", "enabled": true } ], "default_send_enabled": true } } ``` --- ### `/cosmos/bank/v1beta1/supply` > Retrieves the total supply of all coins. #### Parameters
* `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Code responses: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/bank/v1beta1/supply ``` #### Response example ```json { "supply": [ { "denom": "string", "amount": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/distribution/v1beta1/community_pool` > Retrieves the community pool coins. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/distribution/v1beta1/community_pool ``` #### Response example ```json { "pool": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards` > Retrieves the total rewards accrued by each validator. #### Parameters
* `delegator_address` (string; path; required): the delegator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards ``` #### Response example ```json { "rewards": [ { "validator_address": "string", "reward": [ { "denom": "string", "amount": "string" } ] } ], "total": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}` > Retrieves the total rewards accrued by a delegation. #### Parameters
* `delegator_address` (string; path; required): the delegator address to query for. * `validator_address` (string; path; required): the validator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address} ``` #### Response example ```json { "rewards": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators` > Retrieves the validators of a delegator. #### Parameters
* `delegator_address` (string; path; required): the delegator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators ``` #### Response example ```json { "validators": [ "string" ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address` > Retrieves a withdrawal address of a delegator. #### Parameters
* `delegator_address` (string; path; required): the delegator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address ``` #### Response example ```json { "withdraw_address": "string" } ``` --- ### `/cosmos/distribution/v1beta1/params` > Retrieves parameters of the distribution module. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/distribution/v1beta1/params ``` #### Response example ```json { "params": { "community_tax": "string", "base_proposer_reward": "string", "bonus_proposer_reward": "string", "withdraw_addr_enabled": true } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/commission` > Retrieves accumulated commission for a validator. #### Parameters
* `validator_address` (string; path; required): the validator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/distribution/v1beta1/validators/{validator_address}/commission ``` #### Response example ```json { "commission": { "commission": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards` > Retrieves the rewards of a validator address. #### Parameters
* `validator_address` (string; path; required): the validator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards ``` #### Response example ```json { "rewards": { "rewards": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/slashes` > Retrieves slash events of a validator. #### Parameters
* `validator_address` (string; path; required): the validator address to query for. * `starting_height` (uint64; query): the optional starting height to query the slashes. * `ending_height` (uint64; query): the optional ending height to query the slashes. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/distribution/v1beta1/validators/{validator_address}/slashes ``` #### Response example ```json { "slashes": [ { "validator_period": "string", "fraction": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/evidence/v1beta1/evidence` > Retrieves all evidence. #### Parameters
* `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/evidence/v1beta1/evidence ``` #### Response example ```json { "evidence": [ { "type_url": "string", "value": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/evidence/v1beta1/evidence/{evidence_hash}` > Retrieves evidence based on evidence hash. #### Parameters
* `evidence_hash` (string; byte; path; required): the hash of the evidence to retrieve. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/evidence/v1beta1/evidence/{evidence_hash} ``` #### Response example ```json { "evidence": { "type_url": "string", "value": "string" } } ``` --- ### `/cosmos/gov/v1beta1/params/{params_type}` > Retrieves all parameters of the gov module. #### Parameters
* `params_type` (string; path; required): defines which parameters to query for, can be one of "voting", "tallying", or "deposit". #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/gov/v1beta1/params/{params_type} ``` #### Response example ```json { "voting_params": { "voting_period": "string" }, "deposit_params": { "min_deposit": [ { "denom": "string", "amount": "string" } ], "max_deposit_period": "string" }, "tally_params": { "quorum": "string", "threshold": "string", "veto_threshold": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals` > Retrieves all proposals based on given status. #### Parameters
* `proposal_status` (string; query): defines the status of the proposals; the following statuses are available: * `PROPOSAL_STATUS_UNSPECIFIED`: a default proposal status. * `PROPOSAL_STATUS_DEPOSIT_PERIOD`: a proposal status during the deposit period. * `PROPOSAL_STATUS_VOTING_PERIOD`: a proposal status during the voting period. * `PROPOSAL_STATUS_PASSED`: a proposal status of a proposal that has passed. * `PROPOSAL_STATUS_REJECTED`: a proposal status of a proposal that has been rejected. * `PROPOSAL_STATUS_FAILED`: a proposal status of a proposal that has failed. * `voter` (string; query): * `depositor` (string; query): * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/gov/v1beta1/proposals ``` #### Response example ```json { "proposals": [ { "proposal_id": "string", "content": { "type_url": "string", "value": "string" }, "status": "PROPOSAL_STATUS_UNSPECIFIED", "final_tally_result": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" }, "submit_time": "2023-03-02T10:55:55.465Z", "deposit_end_time": "2023-03-02T10:55:55.465Z", "total_deposit": [ { "denom": "string", "amount": "string" } ], "voting_start_time": "2023-03-02T10:55:55.465Z", "voting_end_time": "2023-03-02T10:55:55.465Z" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/secret-network/services/ title: Secret Network — Services source: docs/rpc-service/chains/chains-api/secret-network/services.mdx --- # Secret Network — Services > API reference for [Secret Network](/rpc-service/chains/chains-api/secret-network/). [All methods ->](/rpc-service/chains/chains-api/secret-network/#methods) ## Services ### `/cosmos/base/tendermint/v1beta1/blocks/latest` > Retrieves the latest block. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/base/tendermint/v1beta1/blocks/latest ``` #### Response example ```json { "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "block": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2023-03-02T13:02:59.747Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "data": { "txs": [ "string" ] }, "evidence": { "evidence": [ { "duplicate_vote_evidence": { "vote_a": { "type": "SIGNED_MSG_TYPE_UNKNOWN", "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "timestamp": "2023-03-02T13:02:59.747Z", "validator_address": "string", "validator_index": 0, "signature": "string" }, "vote_b": { "type": "SIGNED_MSG_TYPE_UNKNOWN", "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "timestamp": "2023-03-02T13:02:59.747Z", "validator_address": "string", "validator_index": 0, "signature": "string" }, "total_voting_power": "string", "validator_power": "string", "timestamp": "2023-03-02T13:02:59.747Z" }, "light_client_attack_evidence": { "conflicting_block": { "signed_header": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2023-03-02T13:02:59.747Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "commit": { "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "signatures": [ { "block_id_flag": "BLOCK_ID_FLAG_UNKNOWN", "validator_address": "string", "timestamp": "2023-03-02T13:02:59.747Z", "signature": "string" } ] } }, "validator_set": { "validators": [ { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "proposer": { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" }, "total_voting_power": "string" } }, "common_height": "string", "byzantine_validators": [ { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "total_voting_power": "string", "timestamp": "2023-03-02T13:02:59.747Z" } } ] }, "last_commit": { "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "signatures": [ { "block_id_flag": "BLOCK_ID_FLAG_UNKNOWN", "validator_address": "string", "timestamp": "2023-03-02T13:02:59.747Z", "signature": "string" } ] } } } ``` --- ### `/cosmos/base/tendermint/v1beta1/blocks/{height}` > Retrieves the block for a given height. #### Parameters
* `height` (string; int64; path; required): a height to query the block at. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/base/tendermint/v1beta1/blocks/{height} ``` #### Response example ```json { "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "block": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2023-03-02T13:04:50.862Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "data": { "txs": [ "string" ] }, "evidence": { "evidence": [ { "duplicate_vote_evidence": { "vote_a": { "type": "SIGNED_MSG_TYPE_UNKNOWN", "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "timestamp": "2023-03-02T13:04:50.862Z", "validator_address": "string", "validator_index": 0, "signature": "string" }, "vote_b": { "type": "SIGNED_MSG_TYPE_UNKNOWN", "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "timestamp": "2023-03-02T13:04:50.862Z", "validator_address": "string", "validator_index": 0, "signature": "string" }, "total_voting_power": "string", "validator_power": "string", "timestamp": "2023-03-02T13:04:50.862Z" }, "light_client_attack_evidence": { "conflicting_block": { "signed_header": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2023-03-02T13:04:50.862Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "commit": { "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "signatures": [ { "block_id_flag": "BLOCK_ID_FLAG_UNKNOWN", "validator_address": "string", "timestamp": "2023-03-02T13:04:50.862Z", "signature": "string" } ] } }, "validator_set": { "validators": [ { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "proposer": { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" }, "total_voting_power": "string" } }, "common_height": "string", "byzantine_validators": [ { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "total_voting_power": "string", "timestamp": "2023-03-02T13:04:50.862Z" } } ] }, "last_commit": { "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "signatures": [ { "block_id_flag": "BLOCK_ID_FLAG_UNKNOWN", "validator_address": "string", "timestamp": "2023-03-02T13:04:50.862Z", "signature": "string" } ] } } } ``` ### `/cosmos/base/tendermint/v1beta1/validatorsets/latest` > Retrieves the latest validator-set. #### Parameters
* `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/base/tendermint/v1beta1/validatorsets/latest ``` #### Response example ```json { "block_height": "string", "validators": [ { "address": "string", "pub_key": { "type_url": "string", "value": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/base/tendermint/v1beta1/validatorsets/{height}` > Retrieves the validator-set at a given height. #### Parameters
* `height` (string; int64; path; required): the height to retrieve the validator-set at. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/base/tendermint/v1beta1/validatorsets/{height} ``` #### Response example ```json { "block_height": "string", "validators": [ { "address": "string", "pub_key": { "type_url": "string", "value": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/tx/v1beta1/simulate` > Simulates executing a transaction to estimate gas usage. #### Parameters
* `` (object; required): ```json { "tx": { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] }, "tx_bytes": "string" } ``` #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/scrt_cosmos/cosmos/tx/v1beta1/simulate ``` #### Response example ```json { "gas_info": { "gas_wanted": "string", "gas_used": "string" }, "result": { "data": "string", "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string", "index": true } ] } ] } } ``` --- ### `/cosmos/tx/v1beta1/txs` > Retrieves transactions by event. #### Parameters
* `events` (array[string]; query): the list of transaction event type. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. * `order_by` (string; query): the following values are available: * `ORDER_BY_UNSPECIFIED` (default): specifies an unknown sorting order. OrderBy defaults to ASC in this case. * `ORDER_BY_ASC`: defines ascending order. * `ORDER_BY_DESC`: defines descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/tx/v1beta1/txs ``` #### Response example ```json { "txs": [ { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] } ], "tx_responses": [ { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/tx/v1beta1/txs` > Broadcasts a transaction. #### Parameters
* `` (object; required): ```json { "tx_bytes": "string", "mode": "BROADCAST_MODE_UNSPECIFIED" } ``` #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/scrt_cosmos/cosmos/tx/v1beta1/txs ``` #### Response example ```json { "tx_response": { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } } ``` --- ### `/cosmos/tx/v1beta1/txs/{hash}` > Retrieves a transaction by hash. #### Parameters
* `` (string; path; required): the transaction hash to query, encoded as a hex string. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/tx/v1beta1/txs/{hash} ``` #### Response example ```json { "tx": { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] }, "tx_response": { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/ title: Sei description: Sei is a general purpose, open-source Layer 1 blockchain specialized for the exchange of digital assets. 21 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/sei/index.mdx --- # Sei
> Sei API is available on [Web3 API platform](https://www.ankr.com/rpc/sei). Sei is a general purpose, open-source Layer 1 blockchain specialized for the exchange of digital assets. Sei has only one value prop: exchange apps — whether it’s an NFT marketplace or gaming economy — Sei offers the best user experience to build upon. We support the following networks and protocols for Sei: * [EVM JSON-RPC API](/rpc-service/chains/chains-api/sei/#evm-json-rpc-methods) * [Tendermint JSON-RPC/REST API](/rpc-service/chains/chains-api/sei/#tendermint-json-rpcrest-methods) * [Cosmos REST API](/rpc-service/chains/chains-api/sei/#cosmos-rest-methods) * Cosmos gRPC Currently, we provide two interfaces to query Sei API — [JSON-RPC](https://www.jsonrpc.org/specification) and REST. Responses for both of them come in [JSON format](https://www.json.org/json-en.html). Here is the request/response structure to use for querying: ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/block?height=1 ``` ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/base/tendermint/v1beta1/blocks/{height} ``` ```json { "id": 0, "jsonrpc": "2.0", "result": { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } } ``` --- ## EVM JSON-RPC methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/sei/methods/#web3_clientversion) — returns the current client version. * [`net_version`](/rpc-service/chains/chains-api/sei/methods/#net_version) — returns the current network ID. * [`eth_gasPrice`](/rpc-service/chains/chains-api/sei/methods/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/sei/methods/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/sei/methods/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/sei/methods/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/sei/methods/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/sei/methods/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/sei/methods/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/sei/methods/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/sei/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/sei/methods/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/sei/methods/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/sei/methods/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/sei/methods/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/sei/methods/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getLogs`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_getlogs) — returns logs matching the parameters specified. --- ## Tendermint JSON-RPC/REST methods **Info — node information**: * [`status`](/rpc-service/chains/chains-api/sei/information/#net_info) — retrieves Tendermint status including node info, pubkey, latest block hash, app hash, block height and time. * [`net_info`](/rpc-service/chains/chains-api/sei/information/#net_info) — retrieves network info. * [`blockchain`](/rpc-service/chains/chains-api/sei/information/#blockchain) — retrieves block headers (max: 20) for `minHeight <= height <= maxHeight`. * [`block`](/rpc-service/chains/chains-api/sei/information/#block) — retrieves a block at a specified height. * [`block_by_hash`](/rpc-service/chains/chains-api/sei/information/#block_by_hash) — retrieves a block by hash. * [`block_results`](/rpc-service/chains/chains-api/sei/information/#block_results) — retrieves block results at a specified height. * [`commit`](/rpc-service/chains/chains-api/sei/information/#commit) — retrieves commit results at a specified height. * [`validators`](/rpc-service/chains/chains-api/sei/information/#validators) — retrieves a validator set at a specified height. * [`genesis_chunked`](/rpc-service/chains/chains-api/sei/information/#genesis_chunked) — retrieves the Genesis in multiple chunks. * [`dump_consensus_state`](/rpc-service/chains/chains-api/sei/information/#dump_consensus_state) — retrieves consensus state. * [`consensus_state`](/rpc-service/chains/chains-api/sei/information-p2/#consensus_state) — retrieves consensus state. * [`consensus_params`](/rpc-service/chains/chains-api/sei/information-p2/#consensus_params) — retrieves consensus parameters. * [`unconfirmed_txs`](/rpc-service/chains/chains-api/sei/information-p2/#unconfirmed_txs) — retrieves the list of unconfirmed transactions. * [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/sei/information-p2/#num_unconfirmed_txs) — retrieves data about unconfirmed transactions. * [`tx_search`](/rpc-service/chains/chains-api/sei/information-p2/#tx_search) — searches for transactions. * [`block_search`](/rpc-service/chains/chains-api/sei/information-p2/#block_search) — searches for blocks by `BeginBlock` and `EndBlock` events. * [`tx`](/rpc-service/chains/chains-api/sei/information-p2/#tx) — retrieves transactions by hash. **Tx — transactions broadcast information**: * [`broadcast_tx_sync`](/rpc-service/chains/chains-api/sei/information-p2/#broadcast_tx_sync) — returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. * [`broadcast_tx_async`](/rpc-service/chains/chains-api/sei/information-p2/#broadcast_tx_async) — returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. * [`broadcast_tx_commit`](/rpc-service/chains/chains-api/sei/information-p2/#broadcast_tx_commit) — returns with the responses from `CheckTx` and `DeliverTx`. * [`check_tx`](/rpc-service/chains/chains-api/sei/information-p2/#check_tx) — checks the transaction without executing it. **ABCI — ABCI info**: * [`abci_info`](/rpc-service/chains/chains-api/sei/information-p2/#abci_info) — retrieves info about the application. * [`abci_query`](/rpc-service/chains/chains-api/sei/information-p2/#abci_query) — queries the application for some information. --- ## Cosmos REST methods **Gaia REST**: * [`/node_info`](/rpc-service/chains/chains-api/sei/information-p2/#node_info) — retrieves the properties of the connected node. **Transactions**: * [`/txs`](/rpc-service/chains/chains-api/sei/information-p2/#txs) — broadcasts a signed transaction to a full node. **Staking**: * [`/staking/delegators/{delegatorAddr}/delegations`](/rpc-service/chains/chains-api/sei/information-p3/#stakingdelegatorsdelegatoraddrdelegations) — submits a delegation. * [`/staking/delegators/{delegatorAddr}/unbonding_delegations`](/rpc-service/chains/chains-api/sei/information-p3/#stakingdelegatorsdelegatoraddrunbonding_delegations) — submits an unbonding delegation. **Query**: * [`/cosmos/auth/v1beta1/accounts`](/rpc-service/chains/chains-api/sei/information-p3/#cosmosauthv1beta1accounts) — retrieves all the existing accounts. * [`/cosmos/auth/v1beta1/accounts/{address}`](/rpc-service/chains/chains-api/sei/information-p3/#cosmosauthv1beta1accountsaddress) — retrieves account details based on address. * [`/cosmos/auth/v1beta1/params`](/rpc-service/chains/chains-api/sei/information-p3/#cosmosauthv1beta1params) — retrieves all parameters. * [`/cosmos/bank/v1beta1/balances/{address}`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1balancesaddress) — retrieves the balance of all coins for a single account. * [`/cosmos/bank/v1beta1/balances/{address}/{denom}`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1balancesaddressdenom) — retrieves the balance of a single coin for a single account. * [`/cosmos/bank/v1beta1/denoms_metadata`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1denoms_metadata) — retrieves the client metadata for all registered coin denominations. * [`/cosmos/bank/v1beta1/denoms_metadata/{denom}`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1denoms_metadatadenom) — retrieves the client metadata of a given coin denomination. * [`/cosmos/bank/v1beta1/params`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1params) — retrieves the parameters of x/bank module. * [`/cosmos/bank/v1beta1/supply`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1supply) — retrieves the total supply of all coins. * [`/cosmos/bank/v1beta1/supply/{denom}`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1supplydenom) — retrieves the supply of a single coin. * [`/cosmos/distribution/v1beta1/community_pool`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1community_pool) — retrieves the community pool coins. * [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1delegatorsdelegator_addressrewards) — retrieves the total rewards accrued by each validator. * [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1delegatorsdelegator_addressrewardsvalidator_address) — retrieves the total rewards accrued by a delegation. * [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1delegatorsdelegator_addressvalidators) — retrieves the validators of a delegator. * [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1delegatorsdelegator_addresswithdraw_address) — retrieves a withdrawal address of a delegator. * [`/cosmos/distribution/v1beta1/params`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1params) — retrieves parameters of the distribution module. * [`/cosmos/distribution/v1beta1/validators/{validator_address}/commission`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1validatorsvalidator_addresscommission) — retrieves accumulated commission for a validator. * [`/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1validatorsvalidator_addressoutstanding_rewards) — retrieves rewards of a validator address. * [`/cosmos/distribution/v1beta1/validators/{validator_address}/slashes`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1validatorsvalidator_addressslashes) — retrieves slash events of a validator. * [`/cosmos/evidence/v1beta1/evidence`](/rpc-service/chains/chains-api/sei/query/#cosmosevidencev1beta1evidence) — retrieves all evidence. * [`/cosmos/evidence/v1beta1/evidence/{evidence_hash}`](/rpc-service/chains/chains-api/sei/query/#cosmosevidencev1beta1evidenceevidence_hash) — retrieves evidence based on evidence hash. * [`/cosmos/gov/v1beta1/params/{params_type}`](/rpc-service/chains/chains-api/sei/query/#cosmosgovv1beta1paramsparams_type) — retrieves all parameters of the gov module. * [`/cosmos/gov/v1beta1/proposals`](/rpc-service/chains/chains-api/sei/query/#cosmosgovv1beta1proposals) — retrieves all proposals based on given status. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_id) — retrieves proposal details based on proposal ID. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_iddeposits) — retrieves all deposits of a single proposal. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_iddepositsdepositor) — retrieves single deposit information based on proposal ID and deposit address. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}/tally`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_idtally) — retrieves the tally of a proposal vote. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_idvotes) — retrieves votes of a given proposal. * [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_idvotesvoter) — retrieves voted information based on proposal ID and voter address. * [`/cosmos/mint/v1beta1/annual_provisions`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosmintv1beta1annual_provisions) — retrieves the current minting annual provisions value. * [`/cosmos/mint/v1beta1/inflation`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosmintv1beta1inflation) — retrieves the current minting inflation value. * [`/cosmos/mint/v1beta1/params`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosmintv1beta1params) — retrieves the total set of minting parameters. * [`/cosmos/params/v1beta1/params`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosparamsv1beta1params) — retrieves a specific parameter of a module, given its subspace and key. * [`/cosmos/slashing/v1beta1/params`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosslashingv1beta1params) — retrieves the parameters of a slashing module. * [`/cosmos/slashing/v1beta1/signing_infos`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosslashingv1beta1signing_infos) — retrieves signing info of all validators. * [`/cosmos/slashing/v1beta1/signing_infos/{cons_address}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosslashingv1beta1signing_infoscons_address) — retrieves the signing info of given cons address. * [`/cosmos/staking/v1beta1/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosstakingv1beta1delegationsdelegator_addr) — retrieves all delegations of a given delegator address. * [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrredelegations) — retrieves redelegations of a given address. * [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrunbonding_delegations) — retrieves all unbonding delegations of a given delegator address. * [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidators) — retrieves all validators info for a given delegator address. * [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidatorsvalidator_addr) — retrieves validator info by given delegator validator pair. * [`/cosmos/staking/v1beta1/historical_info/{height}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1historical_infoheight) — retrieves the historical info for a given height. * [`/cosmos/staking/v1beta1/params`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1params) — retrieves the staking parameters. * [`/cosmos/staking/v1beta1/pool`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1pool) — retrieves the pool info. * [`/cosmos/staking/v1beta1/validators`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validators) — retrieves all validators that match the given status. * [`/cosmos/staking/v1beta1/validators/{validator_addr}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validatorsvalidator_addr) — retrieves validator info for a given validator address. * [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegations) — retrieves delegate info for a given validator. * [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addr) — retrieves delegate info for given validator delegator pair. * [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addrunbonding_delegation) — retrieves unbonding info for given validator delegator pair. * [`/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrunbonding_delegations) — retrieves unbonding delegations of a given validator address. * [`/cosmos/upgrade/v1beta1/applied_plan/{name}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosupgradev1beta1applied_planname) — retrieves a previously applied upgrade plan by its name. * [`/cosmos/upgrade/v1beta1/current_plan`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosupgradev1beta1current_plan) — retrieves the current upgrade plan. * [`/cosmos/upgrade/v1beta1/module_versions`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosupgradev1beta1module_versions) — retrieves the list of module versions from state. * [`/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosupgradev1beta1upgraded_consensus_statelast_height) — retrieves the consensus state that will serve as a trusted kernel for the next version of this chain. * [`/cosmos/authz/v1beta1/grants`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosauthzv1beta1grants) — retrieves the list of `Authorization`, granted to the grantee by the granter. * [`/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosfeegrantv1beta1allowancegrantergrantee) — retrieves the fee granted to the grantee by the granter. * [`/cosmos/feegrant/v1beta1/allowances/{grantee}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosfeegrantv1beta1allowancesgrantee) — retrieves all the grants for an address. **Services**: * [`/cosmos/base/tendermint/v1beta1/blocks/latest`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1blockslatest) — retrieves the latest block. * [`/cosmos/base/tendermint/v1beta1/blocks/{height}`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1blocksheight) — retrieves the block for a given height. * [`/cosmos/base/tendermint/v1beta1/node_info`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1node_info) — retrieves the current node info. * [`/cosmos/base/tendermint/v1beta1/syncing`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1syncing) — retrieves a node syncing state. * [`/cosmos/base/tendermint/v1beta1/validatorsets/latest`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1validatorsetslatest) — retrieves the latest validator-set. * [`/cosmos/base/tendermint/v1beta1/validatorsets/{height}`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1validatorsetsheight) — retrieves the validator-set at a given height. * [`/cosmos/tx/v1beta1/simulate`](/rpc-service/chains/chains-api/sei/services/#cosmostxv1beta1simulate) — simulates executing a transaction to estimate gas usage. * [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/sei/services/#cosmostxv1beta1txs) — retrieves transactions by event. * [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/sei/services/#cosmostxv1beta1txs-1) — broadcasts a transaction. * [`/cosmos/tx/v1beta1/txs/{hash}`](/rpc-service/chains/chains-api/sei/services/#cosmostxv1beta1txshash) — retrieves a transaction by hash. --- ## Methods ### Methods, Information - [`web3_clientVersion`](/rpc-service/chains/chains-api/sei/methods/#web3_clientversion) - [`net_version`](/rpc-service/chains/chains-api/sei/methods/#net_version) - [`eth_gasPrice`](/rpc-service/chains/chains-api/sei/methods/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/sei/methods/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/sei/methods/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/sei/methods/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/sei/methods/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/sei/methods/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/sei/methods/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/sei/methods/#eth_getblocktransactioncountbynumber) - [`eth_getCode`](/rpc-service/chains/chains-api/sei/methods/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/sei/methods/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/sei/methods/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/sei/methods/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/sei/methods/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_gettransactionreceipt) - [`eth_getLogs`](/rpc-service/chains/chains-api/sei/methods-p2/#eth_getlogs) - [`status`](/rpc-service/chains/chains-api/sei/methods-p3/#status) ### Information, Transactions, ABCI, Gaia REST, Staking, Query - [`net_info`](/rpc-service/chains/chains-api/sei/information/#net_info) - [`blockchain`](/rpc-service/chains/chains-api/sei/information/#blockchain) - [`block`](/rpc-service/chains/chains-api/sei/information/#block) - [`block_by_hash`](/rpc-service/chains/chains-api/sei/information/#block_by_hash) - [`block_results`](/rpc-service/chains/chains-api/sei/information/#block_results) - [`commit`](/rpc-service/chains/chains-api/sei/information/#commit) - [`validators`](/rpc-service/chains/chains-api/sei/information/#validators) - [`genesis_chunked`](/rpc-service/chains/chains-api/sei/information/#genesis_chunked) - [`dump_consensus_state`](/rpc-service/chains/chains-api/sei/information/#dump_consensus_state) - [`consensus_state`](/rpc-service/chains/chains-api/sei/information-p2/#consensus_state) - [`consensus_params`](/rpc-service/chains/chains-api/sei/information-p2/#consensus_params) - [`unconfirmed_txs`](/rpc-service/chains/chains-api/sei/information-p2/#unconfirmed_txs) - [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/sei/information-p2/#num_unconfirmed_txs) - [`tx_search`](/rpc-service/chains/chains-api/sei/information-p2/#tx_search) - [`block_search`](/rpc-service/chains/chains-api/sei/information-p2/#block_search) - [`tx`](/rpc-service/chains/chains-api/sei/information-p2/#tx) - [`broadcast_tx_sync`](/rpc-service/chains/chains-api/sei/information-p2/#broadcast_tx_sync) - [`Parameters`](/rpc-service/chains/chains-api/sei/methods/#parameters) - [`broadcast_tx_async`](/rpc-service/chains/chains-api/sei/information-p2/#broadcast_tx_async) - [`broadcast_tx_commit`](/rpc-service/chains/chains-api/sei/information-p2/#broadcast_tx_commit) - [`check_tx`](/rpc-service/chains/chains-api/sei/information-p2/#check_tx) - [`abci_info`](/rpc-service/chains/chains-api/sei/information-p2/#abci_info) - [`abci_query`](/rpc-service/chains/chains-api/sei/information-p2/#abci_query) - [`/node_info`](/rpc-service/chains/chains-api/sei/information-p2/#node_info) - [`/txs`](/rpc-service/chains/chains-api/sei/information-p2/#txs) - [`/staking/delegators/{delegatorAddr}/delegations`](/rpc-service/chains/chains-api/sei/information-p3/#stakingdelegatorsdelegatoraddrdelegations) - [`/staking/delegators/{delegatorAddr}/unbonding_delegations`](/rpc-service/chains/chains-api/sei/information-p3/#stakingdelegatorsdelegatoraddrunbonding_delegations) - [`/cosmos/auth/v1beta1/accounts`](/rpc-service/chains/chains-api/sei/information-p3/#cosmosauthv1beta1accounts) - [`/cosmos/auth/v1beta1/accounts/{address}`](/rpc-service/chains/chains-api/sei/information-p3/#cosmosauthv1beta1accountsaddress) - [`/cosmos/auth/v1beta1/params`](/rpc-service/chains/chains-api/sei/information-p3/#cosmosauthv1beta1params) ### Query - [`/cosmos/bank/v1beta1/balances/{address}`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1balancesaddress) - [`/cosmos/bank/v1beta1/balances/{address}/{denom}`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1balancesaddressdenom) - [`/cosmos/bank/v1beta1/denom_owners/{denom}`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1denom_ownersdenom) - [`/cosmos/bank/v1beta1/denoms_metadata`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1denoms_metadata) - [`/cosmos/bank/v1beta1/denoms_metadata/{denom}`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1denoms_metadatadenom) - [`/cosmos/bank/v1beta1/params`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1params) - [`/cosmos/bank/v1beta1/supply`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1supply) - [`/cosmos/bank/v1beta1/supply/{denom}`](/rpc-service/chains/chains-api/sei/query/#cosmosbankv1beta1supplydenom) - [`/cosmos/distribution/v1beta1/community_pool`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1community_pool) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1delegatorsdelegator_addressrewards) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1delegatorsdelegator_addressrewardsvalidator_address) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1delegatorsdelegator_addressvalidators) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1delegatorsdelegator_addresswithdraw_address) - [`/cosmos/distribution/v1beta1/params`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1params) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/commission`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1validatorsvalidator_addresscommission) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1validatorsvalidator_addressoutstanding_rewards) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/slashes`](/rpc-service/chains/chains-api/sei/query/#cosmosdistributionv1beta1validatorsvalidator_addressslashes) - [`/cosmos/evidence/v1beta1/evidence`](/rpc-service/chains/chains-api/sei/query/#cosmosevidencev1beta1evidence) - [`/cosmos/evidence/v1beta1/evidence/{evidence_hash}`](/rpc-service/chains/chains-api/sei/query/#cosmosevidencev1beta1evidenceevidence_hash) - [`/cosmos/gov/v1beta1/params/{params_type}`](/rpc-service/chains/chains-api/sei/query/#cosmosgovv1beta1paramsparams_type) - [`/cosmos/gov/v1beta1/proposals`](/rpc-service/chains/chains-api/sei/query/#cosmosgovv1beta1proposals) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_id) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_iddeposits) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_iddepositsdepositor) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/tally`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_idtally) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_idvotes) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosgovv1beta1proposalsproposal_idvotesvoter) - [`/cosmos/mint/v1beta1/annual_provisions`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosmintv1beta1annual_provisions) - [`Response example`](/rpc-service/chains/chains-api/sei/methods/#response-example) - [`/cosmos/mint/v1beta1/inflation`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosmintv1beta1inflation) - [`/cosmos/mint/v1beta1/params`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosmintv1beta1params) - [`/cosmos/params/v1beta1/params`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosparamsv1beta1params) - [`/cosmos/slashing/v1beta1/params`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosslashingv1beta1params) - [`/cosmos/slashing/v1beta1/signing_infos`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosslashingv1beta1signing_infos) - [`/cosmos/slashing/v1beta1/signing_infos/{cons_address}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosslashingv1beta1signing_infoscons_address) - [`/cosmos/staking/v1beta1/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosstakingv1beta1delegationsdelegator_addr) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrredelegations) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrunbonding_delegations) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidators) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}`](/rpc-service/chains/chains-api/sei/query-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidatorsvalidator_addr) - [`/cosmos/staking/v1beta1/historical_info/{height}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1historical_infoheight) - [`/cosmos/staking/v1beta1/params`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1params) - [`/cosmos/staking/v1beta1/pool`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1pool) - [`/cosmos/staking/v1beta1/validators`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validators) - [`/cosmos/staking/v1beta1/validators/{validator_addr}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validatorsvalidator_addr) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegations) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addr) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addrunbonding_delegation) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosstakingv1beta1validatorsvalidator_addrunbonding_delegations) - [`/cosmos/upgrade/v1beta1/applied_plan/{name}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosupgradev1beta1applied_planname) - [`/cosmos/upgrade/v1beta1/current_plan`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosupgradev1beta1current_plan) - [`/cosmos/upgrade/v1beta1/module_versions`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosupgradev1beta1module_versions) - [`/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosupgradev1beta1upgraded_consensus_statelast_height) - [`/cosmos/authz/v1beta1/grants`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosauthzv1beta1grants) - [`/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosfeegrantv1beta1allowancegrantergrantee) - [`/cosmos/feegrant/v1beta1/allowances/{grantee}`](/rpc-service/chains/chains-api/sei/query-p3/#cosmosfeegrantv1beta1allowancesgrantee) ### Services - [`/cosmos/base/tendermint/v1beta1/blocks/latest`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1blockslatest) - [`/cosmos/base/tendermint/v1beta1/blocks/{height}`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1blocksheight) - [`/cosmos/base/tendermint/v1beta1/node_info`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1node_info) - [`/cosmos/base/tendermint/v1beta1/syncing`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1syncing) - [`/cosmos/base/tendermint/v1beta1/validatorsets/latest`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1validatorsetslatest) - [`/cosmos/base/tendermint/v1beta1/validatorsets/{height}`](/rpc-service/chains/chains-api/sei/services/#cosmosbasetendermintv1beta1validatorsetsheight) - [`/cosmos/tx/v1beta1/simulate`](/rpc-service/chains/chains-api/sei/services/#cosmostxv1beta1simulate) - [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/sei/services/#cosmostxv1beta1txs-1) - [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/sei/services/#cosmostxv1beta1txs-1) - [`/cosmos/tx/v1beta1/txs/{hash}`](/rpc-service/chains/chains-api/sei/services/#cosmostxv1beta1txshash) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/information-p2/ title: Sei — Information, Transactions, ABCI, Gaia REST, Staking, Query (2/3) source: docs/rpc-service/chains/chains-api/sei/information-p2.mdx --- # Sei — Information, Transactions, ABCI, Gaia REST, Staking, Query (2/3) > API reference for [Sei](/rpc-service/chains/chains-api/sei/). [All methods ->](/rpc-service/chains/chains-api/sei/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/sei/information/) · 2 · [3](/rpc-service/chains/chains-api/sei/information-p3/) ### `consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns Consensus state results. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/consensus_state ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "round_state": { "height/round/step": "1262197/0/8", "start_time": "2019-08-01T11:52:38.962730289Z", "proposal_block_hash": "634ADAF1F402663BEC2ABC340ECE8B4B45AA906FA603272ACC5F5EED3097E009", "locked_block_hash": "634ADAF1F402663BEC2ABC340ECE8B4B45AA906FA603272ACC5F5EED3097E009", "valid_block_hash": "634ADAF1F402663BEC2ABC340ECE8B4B45AA906FA603272ACC5F5EED3097E009", "height_vote_set": [ { "round": 0, "prevotes": [ "Vote{0:000001E443FD 1262197/00/1(Prevote) 634ADAF1F402 7BB974E1BA40 @ 2019-08-01T11:52:35.513572509Z}", "nil-Vote" ], "prevotes_bit_array": "BA{100:xxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} 169753436/170151262 = 1.00", "precommits": [ "Vote{5:18C78D135C9D 1262197/00/2(Precommit) 634ADAF1F402 8B5EFFFEABCD @ 2019-08-01T11:52:36.25600005Z}", "nil-Vote" ], "precommits_bit_array": "BA{100:xxxxxx_xxxxx_xxxx_x_xxx_xx_xx_xx__x_x_x__xxxxxxxxxxxxxx_xxxx_xx_xxxxxx_xxxxxxxx_xxxx_xxx_x_xxxx__xxx} 118726247/170151262 = 0.70" } ], "proposer": { "address": "D540AB022088612AC74B287D076DBFBC4A377A2E", "index": 0 } } } } ``` --- ### `consensus_params` > Retrieves consensus parameters. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be returned. #### Returns Consensus parameters results. #### Request parameters ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_params", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/consensus_params?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "block_height": "1", "consensus_params": { "block": { "max_bytes": "22020096", "max_gas": "1000", "time_iota_ms": "1000" }, "evidence": { "max_age": "100000" }, "validator": { "pub_key_types": [ "ed25519" ] } } } } ``` --- ### `unconfirmed_txs` > Retrieves the list of unconfirmed transactions. #### Parameters
* `limit` (integer; default: 30; max: 100): the maximum number of unconfirmed transactions to return. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unconfirmed_txs", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/unconfirmed_txs?limit=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "n_txs": "82", "total": "82", "total_bytes": "19974", "txs": [ "gAPwYl3uCjCMTXENChSMnIkb5ZpYHBKIZqecFEV2tuZr7xIUA75/FmYq9WymsOBJ0XSJ8yV8zmQKMIxNcQ0KFIyciRvlmlgcEohmp5wURXa25mvvEhQbrvwbvlNiT+Yjr86G+YQNx7kRVgowjE1xDQoUjJyJG+WaWBwSiGannBRFdrbma+8SFK2m+1oxgILuQLO55n8mWfnbIzyPCjCMTXENChSMnIkb5ZpYHBKIZqecFEV2tuZr7xIUQNGfkmhTNMis4j+dyMDIWXdIPiYKMIxNcQ0KFIyciRvlmlgcEohmp5wURXa25mvvEhS8sL0D0wwgGCItQwVowak5YB38KRIUCg4KBXVhdG9tEgUxMDA1NBDoxRgaagom61rphyECn8x7emhhKdRCB2io7aS/6Cpuq5NbVqbODmqOT3jWw6kSQKUresk+d+Gw0BhjiggTsu8+1voW+VlDCQ1GRYnMaFOHXhyFv7BCLhFWxLxHSAYT8a5XqoMayosZf9mANKdXArA=" ] } } ``` --- ### `num_unconfirmed_txs` > Retrieves data on unconfirmed transactions. #### Parameters
None. #### Returns The status of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "num_unconfirmed_txs", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/num_unconfirmed_txs ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "n_txs": "31", "total": "82", "total_bytes": "19974" } } ``` --- ### `tx_search` > Searches for transactions with their results. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height and txhash. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx_search", "params": ["4D2000", true, "1", "30", "asc"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/tx_search?query=tx.height%4D2000&prove=true&page=1&per_page=30&order_by=asc ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "txs": [ { "hash": "D70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED", "height": "1000", "index": 0, "tx_result": { "log": "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]", "gas_wanted": "200000", "gas_used": "28596", "tags": { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } }, "tx": "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=", "proof": { "RootHash": "72FE6BF6D4109105357AECE0A82E99D0F6288854D16D8767C5E72C57F876A14D", "Data": "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=", "Proof": { "total": "2", "index": "0", "leaf_hash": "eoJxKCzF3m72Xiwb/Q43vJ37/2Sx8sfNS9JKJohlsYI=", "aunts": [ "eWb+HG/eMmukrQj4vNGyFYb3nKQncAWacq4HF5eFzDY=" ] } } } ], "total_count": "2" } } ``` --- ### `block_search` > Searches for blocks by `BeginBlock` and `EndBlock` events. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height. #### Returns The list of paginated blocks matching the search criteria. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_search", "params": ["4D2000", "1", "30", "asc"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/block_search?query=block.height%4D2000&page=1&per_page=30&order_by=asc ``` #### Response example ```json No example available ``` --- ### `tx` > Retrieves a transaction by hash. #### Parameters
* `hash` (string; required): a hash of a transaction to retrieve. * `prove` (boolean; default: false): adds proofs of the transaction's inclusion in the block. #### Returns Transaction info. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx", "params": ["0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/tx?hash=0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED&prove=true ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "hash": "D70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED", "height": "1000", "index": 0, "tx_result": { "log": "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]", "gas_wanted": "200000", "gas_used": "28596", "tags": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] }, "tx": "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=" } } ``` --- ## Transactions ### `broadcast_tx_sync` > Returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSONRPC via a websocket. See https://docs.tendermint.com/v0.34/app-dev/subscribing-to-events-via-websocket.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. ### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_sync", "params": ["456"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/broadcast_tx_sync?tx=456 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "code": "0", "data": "", "log": "", "codespace": "ibc", "hash": "0D33F2F03A5234F38706E43004489E061AC40A2E" }, "error": "" } ``` --- ### `broadcast_tx_async` > Returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSONRPC via a websocket. See https://docs.tendermint.com/v0.34/app-dev/subscribing-to-events-via-websocket.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). 3. A node is offline. Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_async", "params": ["123"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/broadcast_tx_async?tx=123 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "code": "0", "data": "", "log": "", "codespace": "ibc", "hash": "0D33F2F03A5234F38706E43004489E061AC40A2E" }, "error": "" } ``` --- ### `broadcast_tx_commit` > Returns with the responses from `CheckTx` and `DeliverTx`. :::warning Use only for testing and development. In production, use `BroadcastTxSync` or `BroadcastTxAsync`. You can subscribe for the transaction result using JSONRPC via a websocket (see [Tendermint docs](https://docs.tendermint.com/v0.34/app-dev/subscribing-to-events-via-websocket.html)). ::: :::tip CONTRACT: only returns error if `mempool.CheckTx()` errs or if we timeout waiting for tx to commit. If `CheckTx` or `DeliverTx` fails, no error will be returned, but the result will contain a non-OK ABCI code. Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. ::: #### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_commit", "params": ["785"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/broadcast_tx_commit?tx=785 ``` #### Response example ```json { "error": "", "result": { "height": "26682", "hash": "75CA0F856A4DA078FC4911580360E70CEFB2EBEE", "deliver_tx": { "log": "", "data": "", "code": "0" }, "check_tx": { "log": "", "data": "", "code": "0" } }, "id": 0, "jsonrpc": "2.0" } ``` --- ### `check_tx` > Checks the transaction without executing it. The transaction won't be added to the mempool. Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "check_tx", "params": ["785"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/check_tx?tx=785 ``` #### Response example ```json { "error": "", "result": { "code": "0", "data": "", "log": "", "info": "", "gas_wanted": "1", "gas_used": "0", "events": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "codespace": "bank" }, "id": 0, "jsonrpc": "2.0" } ``` --- ## ABCI ### `abci_info` > Retrieves application info. #### Parameters
None. #### Returns Application info. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_info", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/abci_info ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "response": { "data": "secret", "version": "1.6.1", "last_block_height": "7690381", "last_block_app_hash": "J1tJC9R3q3cNzkDcI7ipyi9NuZ8XUVbMyy7B42TPWuc=" } } } ``` --- ### `abci_query` > Queries the application for particular information. #### Parameters
* `path` (string; required): a path to the data ("/a/b/c"). * `data` (string; required): the data. * `height` (integer; default: 0): the height (0 means latest). * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. #### Returns Particular info according to the query submitted. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_query", "params": ["a/b/c", "the_data", "1", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/blockchain?path=%2Fa%2Fb%2Fc&data=the_data&height=1&prove=true ``` #### Response example ```json { "error": "", "result": { "response": { "log": "exists", "height": "0", "proof": "010114FED0DAD959F36091AD761C922ABA3CBF1D8349990101020103011406AA2262E2F448242DF2C2607C3CDC705313EE3B0001149D16177BC71E445476174622EA559715C293740C", "value": "61626364", "key": "61626364", "index": "-1", "code": "0" } }, "id": 0, "jsonrpc": "2.0" } ``` --- ## Gaia REST ### `/node_info` > Retrieves the properties of the connected node. #### Parameters None. #### Returns Node status. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/node_info ``` #### Response example ```json { "application_version": { "build_tags": "string", "client_name": "string", "commit": "string", "go": "string", "name": "string", "server_name": "string", "version": "string" }, "node_info": { "id": "string", "moniker": "validator-name", "protocol_version": { "p2p": 7, "block": 10, "app": 0 }, "network": "gaia-2", "channels": "string", "listen_addr": "192.168.56.1:26656", "version": "0.15.0", "other": { "tx_index": "on", "rpc_address": "tcp://0.0.0.0:26657" } } } ``` --- ## Transactions ### `/txs` > Broadcasts a signed transaction to a full node. #### Parameters * `txBroadcast` (object; required): the transaction must be a signed StdTx. The supported broadcast modes include `block` (returns after tx commit), `sync` (returns after CheckTx) and `async` (returns right away). ```json { "tx": { "msg": [ "string" ], "fee": { "gas": "string", "amount": [ { "denom": "stake", "amount": "50" } ] }, "memo": "string", "signature": { "signature": "MEUCIQD02fsDPra8MtbRsyB1w7bqTM55Wu138zQbFcWx4+CFyAIge5WNPfKIuvzBZ69MyqHsqD8S1IwiEp+iUb6VSdtlpgY=", "pub_key": { "type": "tendermint/PubKeySecp256k1", "value": "Avz04VhtKJh8ACCVzlI8aTosGy0ikFXKIVHQ3jKMrosH" }, "account_number": "0", "sequence": "0" } }, "mode": "block" } ``` #### Returns Tx broadcasting result. #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/sei_cosmos/YOUR_ANKR_API_KEY/txs ``` #### Response example ```json { "check_tx": { "code": 0, "data": "data", "log": "log", "gas_used": 5000, "gas_wanted": 10000, "info": "info", "tags": [ "", "" ] }, "deliver_tx": { "code": 5, "data": "data", "log": "log", "gas_used": 5000, "gas_wanted": 10000, "info": "info", "tags": [ "", "" ] }, "hash": "EE5F3404034C524501629B56E0DDC38FAD651F04", "height": 0 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/information-p3/ title: Sei — Information, Transactions, ABCI, Gaia REST, Staking, Query (3/3) source: docs/rpc-service/chains/chains-api/sei/information-p3.mdx --- # Sei — Information, Transactions, ABCI, Gaia REST, Staking, Query (3/3) > API reference for [Sei](/rpc-service/chains/chains-api/sei/). [All methods ->](/rpc-service/chains/chains-api/sei/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/sei/information/) · [2](/rpc-service/chains/chains-api/sei/information-p2/) · 3 ## Staking ### `/staking/delegators/{delegatorAddr}/delegations` > Submits a delegation. #### Parameters * `delegation` (body): delegates an amount of liquid coins to a validator. ```json { "base_req": { "from": "cosmos1g9ahr6xhht5rmqven628nklxluzyv8z9jqjcmc", "memo": "Sent via Cosmos Voyager", "chain_id": "Cosmos-Hub", "account_number": "0", "sequence": "1", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "stake", "amount": "50" } ], "simulate": false }, "delegator_address": "cosmos1depk54cuajgkzea6zpgkq36tnjwdzv4afc3d27", "validator_address": "cosmosvaloper16xyempempp92x9hyzz9wrgf94r6j9h5f2w4n2l", "amount": { "denom": "stake", "amount": "50" } } ``` * `delegatorAddr` (string; required): a Bech32 AccAddress of a delegator. #### Returns Submission result codes: * 200 — OK. * 400 — Invalid delegator address or delegation request body. * 401 — Key password is wrong. * 500 — Internal Server Error. #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/sei_cosmos/YOUR_ANKR_API_KEY/staking/delegators/{delegatorAddr}/delegations ``` #### Response example ```json { "msg": [ "string" ], "fee": { "gas": "string", "amount": [ { "denom": "stake", "amount": "50" } ] }, "memo": "string", "signature": { "signature": "MEUCIQD02fsDPra8MtbRsyB1w7bqTM55Wu138zQbFcWx4+CFyAIge5WNPfKIuvzBZ69MyqHsqD8S1IwiEp+iUb6VSdtlpgY=", "pub_key": { "type": "tendermint/PubKeySecp256k1", "value": "Avz04VhtKJh8ACCVzlI8aTosGy0ikFXKIVHQ3jKMrosH" }, "account_number": "0", "sequence": "0" } } ``` --- ### `/staking/delegators/{delegatorAddr}/unbonding_delegations` > Submits an unbonding delegation. #### Parameters * `delegation` (body): unbonds an amount of bonded shares from a validator. ```json { "base_req": { "from": "cosmos1g9ahr6xhht5rmqven628nklxluzyv8z9jqjcmc", "memo": "Sent via Cosmos Voyager", "chain_id": "Cosmos-Hub", "account_number": "0", "sequence": "1", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "stake", "amount": "50" } ], "simulate": false }, "delegator_address": "cosmos1depk54cuajgkzea6zpgkq36tnjwdzv4afc3d27", "validator_address": "cosmosvaloper16xyempempp92x9hyzz9wrgf94r6j9h5f2w4n2l", "amount": { "denom": "stake", "amount": "50" } } ``` * `delegatorAddr` (string; required): a Bech32 AccAddress of a delegator. ``` cosmos16xyempempp92x9hyzz9wrgf94r6j9h5f06pxxv ``` #### Returns Result codes: * 200 — OK. * 400 — Invalid delegator address or unbonding delegation request body. * 401 — Key password is wrong. * 500 — Internal Server Error. #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/sei_cosmos/YOUR_ANKR_API_KEY/staking/delegators/{delegatorAddr}/unbonding_delegations ``` #### Response example ```json { "msg": [ "string" ], "fee": { "gas": "string", "amount": [ { "denom": "stake", "amount": "50" } ] }, "memo": "string", "signature": { "signature": "MEUCIQD02fsDPra8MtbRsyB1w7bqTM55Wu138zQbFcWx4+CFyAIge5WNPfKIuvzBZ69MyqHsqD8S1IwiEp+iUb6VSdtlpgY=", "pub_key": { "type": "tendermint/PubKeySecp256k1", "value": "Avz04VhtKJh8ACCVzlI8aTosGy0ikFXKIVHQ3jKMrosH" }, "account_number": "0", "sequence": "0" } } ``` --- ## Query ### `/cosmos/auth/v1beta1/accounts` > Retrieves all the existing accounts. #### Parameters * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/auth/v1beta1/accounts ``` #### Response example ```json { "accounts": [ { "type_url": "string", "value": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/auth/v1beta1/accounts/{address}` > Retrieves account details based on address. #### Parameters * `address` (string; path; required): the address of account to retrieve details for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/auth/v1beta1/accounts/{address} ``` #### Response example ```json { "account": { "type_url": "string", "value": "string" } } ``` --- ### `/cosmos/auth/v1beta1/params` > Retrieves all parameters. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/auth/v1beta1/params ``` #### Request example ```json { "params": { "max_memo_characters": "string", "tx_sig_limit": "string", "tx_size_cost_per_byte": "string", "sig_verify_cost_ed25519": "string", "sig_verify_cost_secp256k1": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/information/ title: Sei — Information, Transactions, ABCI, Gaia REST, Staking, Query (1/3) source: docs/rpc-service/chains/chains-api/sei/information.mdx --- # Sei — Information, Transactions, ABCI, Gaia REST, Staking, Query (1/3) > API reference for [Sei](/rpc-service/chains/chains-api/sei/). [All methods ->](/rpc-service/chains/chains-api/sei/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/sei/information-p2/) · [3](/rpc-service/chains/chains-api/sei/information-p3/) ### `net_info` > Retrieves network info. #### Parameters None. #### Returns Network info. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_info", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/net_info ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "listening": true, "listeners": [ "Listener(@)" ], "n_peers": "1", "peers": [ { "node_info": { "protocol_version": { "p2p": "7", "block": "10", "app": "0" }, "id": "5576458aef205977e18fd50b274e9b5d9014525a", "listen_addr": "tcp:0.0.0.0:26656", "network": "cosmoshub-2", "version": "0.32.1", "channels": "4020212223303800", "moniker": "moniker-node", "other": { "tx_index": "on", "rpc_address": "tcp:0.0.0.0:26657" } }, "is_outbound": true, "connection_status": { "Duration": "168901057956119", "SendMonitor": { "Active": true, "Start": "2019-07-31T14:31:28.66Z", "Duration": "168901060000000", "Idle": "168901040000000", "Bytes": "5", "Samples": "1", "InstRate": "0", "CurRate": "0", "AvgRate": "0", "PeakRate": "0", "BytesRem": "0", "TimeRem": "0", "Progress": 0 }, "RecvMonitor": { "Active": true, "Start": "2019-07-31T14:31:28.66Z", "Duration": "168901060000000", "Idle": "168901040000000", "Bytes": "5", "Samples": "1", "InstRate": "0", "CurRate": "0", "AvgRate": "0", "PeakRate": "0", "BytesRem": "0", "TimeRem": "0", "Progress": 0 }, "Channels": [ { "ID": 48, "SendQueueCapacity": "1", "SendQueueSize": "0", "Priority": "5", "RecentlySent": "0" } ] }, "remote_ip": "95.179.155.35" } ] } } ``` --- ### `blockchain` > Retrieves block headers for `minHeight <= height <= maxHeight`. At most 20 items will return for the `minHeight` or `maxHeight` parameters specified. If `maxHeight` does not yet exist, the blocks up to the current height will return. If `minHeight` does not exist (pruning), the earliest existing height will be used. #### Parameters
* `minHeight` (integer): the minimum block height to return. * `maxHeight` (integer): the maximum block height to return. #### Returns Block headers, in descending order (highest first). #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "blockchain", "params": ["1", "2"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/blockchain?minHeight=1&maxHeight=2 ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "last_height": "1276718", "block_metas": [ { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block_size": 1000000, "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "num_txs": "54" } ] } } ``` --- ### `block` > Retrieves a block at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block is to be fetched. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/blockchain?height=1 ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } } ``` --- ### `block_by_hash` > Retrieves a block by hash. #### Parameters
* `hash` (string; required): a block hash. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_by_hash", "params": ["0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/block_by_hash?hash=0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } } ``` --- ### `block_results` > Retrieves block results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block info is to be fetched. #### Returns Block results. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_results", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/block_results?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "height": "12", "txs_results": [ { "code": "0", "data": "", "log": "not enough gas", "info": "", "gas_wanted": "100", "gas_used": "100", "events": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "codespace": "ibc" } ], "begin_block_events": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "end_block": [ { "type": "app", "attributes": [ { "key": "YWN0aW9u", "value": "c2VuZA==", "index": false } ] } ], "validator_updates": [ { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "power": "300" } ], "consensus_params_updates": { "block": { "max_bytes": "22020096", "max_gas": "1000", "time_iota_ms": "1000" }, "evidence": { "max_age": "100000" }, "validator": { "pub_key_types": [ "ed25519" ] } } } } ``` --- ### `commit` > Retrieves commit results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be fetched. #### Returns Commit results. Canonical switches from false to true for block H once block H+1 has been committed, until then it's subjective and only reflects what this node has seen so far. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "commit", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/commit?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "signed_header": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "commit": { "height": "1311801", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "timestamp": "2019-04-22T17:01:58.376629719Z", "signature": "14jaTQXYRt8kbLKEhdHq7AXycrFImiLuZx50uOjs2+Zv+2i7RTG/jnObD07Jo2ubZ8xd7bNBJMqkgtkd0oQHAw==" } ] } }, "canonical": true } } ``` --- ### `validators` > Retrieves a validator set at a specified height. Validators are sorted by voting power. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the validator set corresponding to the latest block is to be fetched. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30; max: 100): a number of entries per page. #### Returns Commit results. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "validators", "params": ["1","1","30"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/validators?height=1&page=2&per_page=30 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "block_height": "55", "validators": [ { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } ], "count": "1", "total": "25" } } ``` --- ### `genesis_chunked` > Retrieves Genesis in multiple chunks. Gets genesis document in multiple chunks to make it easier to iterate through larger genesis structures. Each chunk is produced by converting the genesis document to JSON and then splitting the resulting payload into 16MB blocks, and then Base64-encoding each block. #### Parameters
* `chunk` (integer; default: 0): a sequence number of the chunk to download. #### Returns A Genesis chunk response. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "genesis_chunked", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/genesis_chunked?chunk=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "chunk": 0, "total": 1, "data": "Z2VuZXNpcwo=" } } ``` --- ### `dump_consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns A complete consensus state. See the [Vote string description](https://pkg.go.dev/github.com/tendermint/tendermint/types?tab=doc#Vote.String). #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "dump_consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/dump_consensus_state ``` #### Response example ```json { "jsonrpc": "2.0", "id": 0, "result": { "round_state": { "height": "1311801", "round": 0, "step": 3, "start_time": "2019-08-05T11:28:49.064658805Z", "commit_time": "2019-08-05T11:28:44.064658805Z", "validators": { "validators": [ { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } ], "proposer": { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } }, "locked_round": -1, "valid_round": "-1", "votes": [ { "round": "0", "prevotes": [ "nil-Vote", "Vote{19:46A3F8B8393B 1311801/00/1(Prevote) 000000000000 64CE682305CB @ 2019-08-05T11:28:47.374703444Z}" ], "prevotes_bit_array": "BA{100:___________________x________________________________________________________________________________} 209706/170220253 = 0.00", "precommits": [ "nil-Vote" ], "precommits_bit_array": "BA{100:____________________________________________________________________________________________________} 0/170220253 = 0.00" } ], "commit_round": -1, "last_commit": { "votes": [ "Vote{0:000001E443FD 1311800/00/2(Precommit) 3071ADB27D1A 77EE1B6B6847 @ 2019-08-05T11:28:43.810128139Z}" ], "votes_bit_array": "BA{100:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} 170220253/170220253 = 1.00", "peer_maj_23s": {} }, "last_validators": { "validators": [ { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } ], "proposer": { "address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM=" }, "voting_power": "239727", "proposer_priority": "-11896414" } }, "triggered_timeout_precommit": false }, "peers": [ { "node_address": "357f6a6c1d27414579a8185060aa8adf9815c43c@68.183.41.207:26656", "peer_state": { "round_state": { "height": "1311801", "round": "0", "step": 3, "start_time": "2019-08-05T11:28:49.21730864Z", "proposal": false, "proposal_block_parts_header": { "total": 0, "hash": "" }, "proposal_pol_round": -1, "proposal_pol": "____________________________________________________________________________________________________", "prevotes": "___________________x________________________________________________________________________________", "precommits": "____________________________________________________________________________________________________", "last_commit_round": 0, "last_commit": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "catchup_commit_round": -1, "catchup_commit": "____________________________________________________________________________________________________" }, "stats": { "votes": "1159558", "block_parts": "4786" } } } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/methods-p2/ title: Sei — Methods, Information (2/3) source: docs/rpc-service/chains/chains-api/sei/methods-p2.mdx --- # Sei — Methods, Information (2/3) > API reference for [Sei](/rpc-service/chains/chains-api/sei/). [All methods ->](/rpc-service/chains/chains-api/sei/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/sei/methods/) · 2 · [3](/rpc-service/chains/chains-api/sei/methods-p3/) ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3b9aca00", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x989680", "gasUsed": "0x1ea6d", "hash": "0x80ae223fe56c21e6b0205cdbc4b9638c5c40949f3348ae6a036f723d41a98cde", "logsBloom": "0x00000001000000000000000000004000000000080000000000000000000000000000000000000080000800000000000040800000000000000000000200000000000000000000004000000000000000000000000000000000000000000000000000000000000004000000008000000000004000100000000000000000000000000008000000010000000000000000000000000000000000000000104001000000000000000000000000000000000010000000000000000000000000000000000000002000004000000000000000000000000002000000000000000000000000000000000000000000008000000000000010000000000000000000000000000000", "miner": "0x24f70e6cfae07f57fe58f8f6101ecb66e42c96bb", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x90a7c72", "parentHash": "0x72ac0c8a8957fc20ea138267f746e5c4d298c895e4fc59c814037a086bb8a641", "receiptsRoot": "0xd7c8b59286eec930c11ed2722fb21f5f6efb2fe6a61bddab0356afa122f8231e", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x5c1e", "stateRoot": "0x32d369aa6bfddb7d93ad186d2724c020d4b1d81c902318f97b00c285fa3e34b0", "timestamp": "0x68496555", "transactions": [ "0x10fa45dd5254a96f971e2c7d5e35e84cc6ae0b4fede2f9f62e4b16854da96d21", "0x69d1dabd7569b245f795310c9bdf5bf013ac0ac602bb24ebc2bbacc571714054", "0xb810dbb3bda727f855b7beefba540c7f7b84d81a38a28dc41f229097cd743284", "0xf4682ede98bc8fa47127ebdb609898ab655a8bd6287f15114d0d08093d84a2dc" ], "transactionsRoot": "0xba837260450051322b08b890f5656f9134d8c15d8e86f5cd69d3041a2b853abb", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xd24cd4f7017a4bdf4eab7df25ca6e0d8f60fefd274d27b7dbd17fabca486e924"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x4e868a53bb420962c05389dcd2bf97a1b14bac2b3c28210337a7b4650d10706b", "blockNumber": "0x90a7d49", "from": "0xb1fecdfbe72c9fbe55c96807d564f8a692b6f9b9", "gas": "0x5208", "gasPrice": "0x4190ab00", "maxFeePerGas": "0x4190ab00", "maxPriorityFeePerGas": "0x4190ab00", "hash": "0xd24cd4f7017a4bdf4eab7df25ca6e0d8f60fefd274d27b7dbd17fabca486e924", "input": "0x", "nonce": "0x4e", "to": "0x59b95b521de773b101d3cd297ea54906bda69ae5", "transactionIndex": "0x8", "value": "0x2386f26fc10000", "type": "0x2", "accessList": [], "chainId": "0x531", "v": "0x0", "r": "0x1b67ab84d842daeeb739a41bd7e7acdf241a29059491dd9740b55bc1e538a0ed", "s": "0x37a5fd5256e27e3fcec7668b7d6f9ea18f718514d3ccb4c59d23e412c020dcdd", "yParity": "0x0" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0x01D3CB71E5AFC2F74191233E44143516FEF6AD1C587FACE6E4640B724C704750", "0x0" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x01d3cb71e5afc2f74191233e44143516fef6ad1c587face6e4640b724c704750", "blockNumber": "0x90a8041", "from": "0x6bb7272fb2d6949a2e75b3d9029d7da02f390206", "gas": "0x52e4", "gasPrice": "0x4190ab00", "hash": "0x3a60664c2457e9035d5d705741ae8e3e3604257a39fa7641241ee292f45ec08d", "input": "0x", "nonce": "0x0", "to": "0x85bc29178bac07468b76078998f550861239c469", "transactionIndex": "0x0", "value": "0x1e3160ccdd5b400", "type": "0x0", "chainId": "0x531", "v": "0xa85", "r": "0xc803000a29980491476b0e2ce68252795f0694e79d00f3c8d26455f9eee45ac0", "s": "0x71e9c36efe774008b5a17071243e341ac98107779995549251ddd9c62f7e626f" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x90A8041", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x01d3cb71e5afc2f74191233e44143516fef6ad1c587face6e4640b724c704750", "blockNumber": "0x90a8041", "from": "0x6bb7272fb2d6949a2e75b3d9029d7da02f390206", "gas": "0x52e4", "gasPrice": "0x4190ab00", "hash": "0x3a60664c2457e9035d5d705741ae8e3e3604257a39fa7641241ee292f45ec08d", "input": "0x", "nonce": "0x0", "to": "0x85bc29178bac07468b76078998f550861239c469", "transactionIndex": "0x0", "value": "0x1e3160ccdd5b400", "type": "0x0", "chainId": "0x531", "v": "0xa85", "r": "0xc803000a29980491476b0e2ce68252795f0694e79d00f3c8d26455f9eee45ac0", "s": "0x71e9c36efe774008b5a17071243e341ac98107779995549251ddd9c62f7e626f" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x3a60664c2457e9035d5d705741ae8e3e3604257a39fa7641241ee292f45ec08d"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x01d3cb71e5afc2f74191233e44143516fef6ad1c587face6e4640b724c704750", "blockNumber": "0x90a8041", "contractAddress": null, "cumulativeGasUsed": "0x0", "effectiveGasPrice": "0x4190ab00", "from": "0x6bb7272fb2d6949a2e75b3d9029d7da02f390206", "gasUsed": "0x523f", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x85bc29178bac07468b76078998f550861239c469", "transactionHash": "0x3a60664c2457e9035d5d705741ae8e3e3604257a39fa7641241ee292f45ec08d", "transactionIndex": "0x0", "type": "0x0" } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "fromBlock": "0x90A8041", "toBlock": "0x90A8042" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0x2deecf2a05f735890eb3ea085d55cec8f1a93895", "topics": [ "0xb5d3a20278dcec496e4b0d565c9b0189c3900d13410e23b2b22ee83016a3fcf8", "0x00000000000000000000000038eaae5673c5061c9e452a7bc337e770925dabd9" ], "data": "0x000000000000000000000000000000000000000000000000000000006849672f", "blockNumber": "0x90a8042", "transactionHash": "0x208979c07c17e8ea3c772586a9d56ebee293b7ed00834c96bfdc3ca3bdba744d", "transactionIndex": "0x1", "blockHash": "0xec4d15994a67e6424de009edee520228d79872478d564ff35280afa8b47546b7", "logIndex": "0x0", "removed": false }, { "address": "0x2deecf2a05f735890eb3ea085d55cec8f1a93895", "topics": [ "0xb5d3a20278dcec496e4b0d565c9b0189c3900d13410e23b2b22ee83016a3fcf8", "0x00000000000000000000000024724ceb10d29176625466628bb6d3f9e4904892" ], "data": "0x000000000000000000000000000000000000000000000000000000006849672f", "blockNumber": "0x90a8042", "transactionHash": "0x52c74b64954b01c3283f9506f6b176dfa8e40343270437bc9f0a9c4cf95f50ed", "transactionIndex": "0x2", "blockHash": "0xec4d15994a67e6424de009edee520228d79872478d564ff35280afa8b47546b7", "logIndex": "0x1", "removed": false } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/methods-p3/ title: Sei — Methods, Information (3/3) source: docs/rpc-service/chains/chains-api/sei/methods-p3.mdx --- # Sei — Methods, Information (3/3) > API reference for [Sei](/rpc-service/chains/chains-api/sei/). [All methods ->](/rpc-service/chains/chains-api/sei/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/sei/methods/) · [2](/rpc-service/chains/chains-api/sei/methods-p2/) · 3 ## Information ### `status` > Retrieves Tendermint status including node info, pubkey, latest block hash, app hash, block height and time. #### Parameters None. #### Returns Status of the node. #### Request example ```shell curl -X POST https://rpc.ankr.com/sei/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "status", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/YOUR_ANKR_API_KEY/status ``` #### Response example ```json { "node_info": { "protocol_version": { "p2p": "8", "block": "11", "app": "0" }, "id": "f7628f970a504f59954f073d65671001a408b5da", "listen_addr": "45.250.253.81:29210", "network": "pacific-1", "version": "0.35.0-unreleased", "channels": "40202122233038606162630070717273", "moniker": "Ankr", "other": { "tx_index": "off", "rpc_address": "tcp://127.0.0.1:29211" } }, "application_info": { "version": "8" }, "sync_info": { "latest_block_hash": "567CCF80A233999FBB6CF97B0AA4F8D4FD44A5EDE1AE3C228511D8C98AC62CF2", "latest_app_hash": "70FFC418FC9780E1075B115AB22441DADB45F1BE67F769642F205D4B6ED67092", "latest_block_height": "30191943", "latest_block_time": "2023-10-05T13:18:58.805856021Z", "earliest_block_hash": "914496D8EAD67328E544949B4C508AB691837901DB676652F89AD60025AEFC06", "earliest_app_hash": "861D037323EA61AF6AB403C126F6892826B9C44F59ED5FB1568910D6923B67BD", "earliest_block_height": "29574999", "earliest_block_time": "2023-10-02T18:51:50.626034842Z", "max_peer_block_height": "30191926", "catching_up": false, "total_synced_time": "0", "remaining_time": "0", "total_snapshots": "0", "chunk_process_avg_time": "0", "snapshot_height": "0", "snapshot_chunks_count": "0", "snapshot_chunks_total": "0", "backfilled_blocks": "0", "backfill_blocks_total": "0" }, "validator_info": { "address": "2602B589666DD6F3D0FB9DD4414ED39C0FEEE385", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "qvHCe2sqN9VJRl/cDAF36LnNXbktLVR1zqnj0d7zt1I=" }, "voting_power": "0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/methods/ title: Sei — Methods, Information (1/3) source: docs/rpc-service/chains/chains-api/sei/methods.mdx --- # Sei — Methods, Information (1/3) > API reference for [Sei](/rpc-service/chains/chains-api/sei/). [All methods ->](/rpc-service/chains/chains-api/sei/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/sei/methods-p2/) · [3](/rpc-service/chains/chains-api/sei/methods-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "Geth/linux-amd64/go1.21.4" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1329" } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4190ab00" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x90a756c" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x929549B12bA3BA6E71e6331A116dDCf56A5CA39c", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2a423e3700" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xcFec3A482909e1f9D8d631d99c7DE18960E969E7", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x85BC29178BAC07468b76078998f550861239c469", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xe231d859f407ad98f4052346cf59ae03abf39b5203e3fdfb2994b8763c87bf13"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x85BC29178BAC07468b76078998f550861239c469", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x60806040526004361061012c575f3560e01c80637e8adbf0116100a45780639852099c1161006b5780639852099c14610340578063c5f956af14610355578063d611965814610374578063ddf8d65114610393578063e8433ddf146103b2578063f2fde38b146103d157005b80637e8adbf01461029a578063812ef32f146102cc57806382ac5a65146102e05780638da5cb5b146102ff578063974a8fd01461032157005b806341275358116100f357806341275358146101f1578063558a7297146102105780635c975abb1461022f5780636348b87814610246578063665fc91614610273578063715018a61461028657005b80630930907b1461013557806..." } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/sei/methods-p2/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_tx_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0xcFec3A482909e1f9D8d631d99c7DE18960E969E7", "data": "0x70a08231000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf9" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0xcFec3A482909e1f9D8d631d99c7DE18960E969E7", "to": "0x85BC29178BAC07468b76078998f550861239c469", "data": "0xa9059cbb000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf90000000000000000000000000000000000000000000000000000000000000064" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x55cc" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/sei_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xf6d810bd899f629b726fbf31e4d8814bb674d8020e4062db9f4fdca79f4183c0", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x3b9aca00", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x989680", "gasUsed": "0x20904", "hash": "0xf6d810bd899f629b726fbf31e4d8814bb674d8020e4062db9f4fdca79f4183c0", "logsBloom": "0x00000000000000000000040000000001000000000000800000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000800000000000008000000000004000000000020000000000000000000000000000000000000108800000000000000000000000000000000000000000000040000000000000000000000000000000000000000000020000000000000000004000000000400000000010010000000000000000400000000000000000000000040000000000000000000000000000000000000000000000000000004000000000000000000000", "miner": "0x7a657eabde32b51e460f1893cd3c753a802aaf46", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x90a777c", "parentHash": "0xe231d859f407ad98f4052346cf59ae03abf39b5203e3fdfb2994b8763c87bf13", "receiptsRoot": "0xbd0238dd118e07dd75671e917743ffe3b5443e7003cb4cdfcc4d6190cc2427ff", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x61f8", "stateRoot": "0x0070ea9266525bd4e43488ae3e8ee6b22db7d47ca2c908ad2eb37501088a9be5", "timestamp": "0x684962df", "transactions": [ "0x005e603d865a60e8de131cd13a96cd091e273750c349358118af8f9323a2127d", "0x48a63bc2246eb55112c1ead293391be8a29af1215a28139f8e934b8ba7670ddd", "0xbc3ab2be01190669ce3f4cd98d369c79da23d67aa97e72155ef8a875d38de966", "0xcd9e9c788bb06408781524e9dc6617928fdee2873148b0f4266c78354cdfc5df", "0x66032d610529326de5ade949086c37a7a7745ae639f86d4b6e3de91f97d3ad4e", "0x76dacc2e7a22eece91a574428878ae1f090dc01caed267044a240997e452fac5" ], "transactionsRoot": "0x0a85eb71ff0009e17542e64cbfefff15039982f3e26e312074fa715328d1a2ef", "uncles": [] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/query-p2/ title: Sei — Query (2/3) source: docs/rpc-service/chains/chains-api/sei/query-p2.mdx --- # Sei — Query (2/3) > API reference for [Sei](/rpc-service/chains/chains-api/sei/). [All methods ->](/rpc-service/chains/chains-api/sei/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/sei/query/) · 2 · [3](/rpc-service/chains/chains-api/sei/query-p3/) ### `/cosmos/gov/v1beta1/proposals/{proposal_id}` > Retrieves proposal details based on proposal ID. #### Parameters * `proposal_id` (string; uint64; path; required): the unique ID of the proposal. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/gov/v1beta1/proposals/{proposal_id} ``` #### Response example ```json { "proposal": { "proposal_id": "string", "content": { "type_url": "string", "value": "string" }, "status": "PROPOSAL_STATUS_UNSPECIFIED", "final_tally_result": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" }, "submit_time": "2023-03-02T11:08:57.204Z", "deposit_end_time": "2023-03-02T11:08:57.204Z", "total_deposit": [ { "denom": "string", "amount": "string" } ], "voting_start_time": "2023-03-02T11:08:57.204Z", "voting_end_time": "2023-03-02T11:08:57.204Z" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` > Retrieves all deposits of a single proposal. #### Parameters * `proposal_id` (string; uint64; path; required): the unique ID of the proposal. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits ``` #### Response example ```json { "deposits": [ { "proposal_id": "string", "depositor": "string", "amount": [ { "denom": "string", "amount": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}` > Retrieves single deposit information based on proposal ID and deposit address. #### Parameters * `proposal_id` (string; uint64; path; required): the unique ID of the proposal. * `depositor` (string; path; required): the deposit addresses from the proposals. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor} ``` #### Response example ```json { "deposit": { "proposal_id": "string", "depositor": "string", "amount": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/tally` > Retrieves the tally of a proposal vote. #### Parameters * `proposal_id` (string; uint64; path; required): the unique ID of the proposal. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/gov/v1beta1/proposals/{proposal_id}/tally ``` #### Response example ```json { "tally": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/votes` > Retrieves the votes of a given proposal. #### Parameters * `proposal_id` (string; uint64; path; required): the unique ID of the proposal. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/gov/v1beta1/proposals/{proposal_id}/votes ``` #### Response example ```json { "votes": [ { "proposal_id": "string", "voter": "string", "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_UNSPECIFIED", "weight": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}` > Retrieves voted information based on proposal ID and voter address. #### Parameters * `proposal_id` (string; uint64; path; required): the unique ID of the proposal. * `voter` (string; path; required): the voter address for the proposal. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter} ``` #### Response example ```json { "vote": { "proposal_id": "string", "voter": "string", "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_UNSPECIFIED", "weight": "string" } ] } } ``` --- ### `/cosmos/mint/v1beta1/annual_provisions` > Retrieves the current minting annual provisions value. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/mint/v1beta1/annual_provisions ``` ### Response example ```json { "annual_provisions": "string" } ``` --- ### `/cosmos/mint/v1beta1/inflation` > Retrieves the current minting inflation value. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/mint/v1beta1/inflation ``` #### Response example ```json { "inflation": "string" } ``` --- ### `/cosmos/mint/v1beta1/params` > Retrieves the total set of minting parameters. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/mint/v1beta1/params ``` #### Response example ```json { "params": { "mint_denom": "string", "inflation_rate_change": "string", "inflation_max": "string", "inflation_min": "string", "goal_bonded": "string", "blocks_per_year": "string" } } ``` --- ### `/cosmos/params/v1beta1/params` > Retrieves the total set of minting parameters. #### Parameters * `subspace` (string; query): defines the module to query the parameter for. * `key` (string; query): defines the key of the parameter in the subspace. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/params/v1beta1/params ``` #### Response example ```json { "param": { "subspace": "string", "key": "string", "value": "string" } } ``` --- ### `/cosmos/slashing/v1beta1/params` > Retrieves the parameters of a slashing module. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/slashing/v1beta1/params ``` #### Response example ```json { "params": { "signed_blocks_window": "string", "min_signed_per_window": "string", "downtime_jail_duration": "string", "slash_fraction_double_sign": "string", "slash_fraction_downtime": "string" } } ``` --- ### `/cosmos/slashing/v1beta1/signing_infos` > Retrieves signing info of all validators. #### Parameters * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/slashing/v1beta1/signing_infos ``` #### Response example ```json { "info": [ { "address": "string", "start_height": "string", "index_offset": "string", "jailed_until": "2023-03-02T11:34:53.641Z", "tombstoned": true, "missed_blocks_counter": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/slashing/v1beta1/signing_infos/{cons_address}` > Retrieves the signing info of given cons address. #### Parameters * `cons_address` (string; path; required): the address to query signing info from. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/slashing/v1beta1/signing_infos/{cons_address} ``` #### Response example ```json { "val_signing_info": { "address": "string", "start_height": "string", "index_offset": "string", "jailed_until": "2023-03-02T11:37:10.986Z", "tombstoned": true, "missed_blocks_counter": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegations/{delegator_addr}` > Retrieves all delegations of a given delegator address. #### Parameters * `delegator_addr` (string; path; required): the address of the delegator to query for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/delegations/{delegator_addr} ``` #### Response example ```json { "delegation_responses": [ { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations` > Retrieves redelegations of a given address. #### Parameters * `delegator_addr` (string; path; required): the address of the delegator to query for. * `src_validator_addr` (string; query): the validator address to redelegate from. * `dst_validator_addr` (string; query): the validator address to redelegate to. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations ``` #### Response example ```json { "redelegation_responses": [ { "redelegation": { "delegator_address": "string", "validator_src_address": "string", "validator_dst_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2023-03-02T11:44:00.360Z", "initial_balance": "string", "shares_dst": "string" } ] }, "entries": [ { "redelegation_entry": { "creation_height": "string", "completion_time": "2023-03-02T11:44:00.360Z", "initial_balance": "string", "shares_dst": "string" }, "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations` > Retrieves all unbonding delegations of a given delegator address. #### Parameters * `delegator_addr` (string; path; required): the address of the delegator to query for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations ``` #### Reponse example ```json { "unbonding_responses": [ { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2023-03-02T11:47:55.798Z", "initial_balance": "string", "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators` > Retrieves all validators info for a given delegator address. #### Parameters * `delegator_addr` (string; path; required): the address of the delegator to query for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators ``` #### Response example ```json { "validators": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2023-03-02T11:50:03.594Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2023-03-02T11:50:03.594Z" }, "min_self_delegation": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}` > Retrieves validator info by given delegator validator pair. #### Parameters * `delegator_addr` (string; path; required): the delegator address to query for. * `validator_addr` (string; path; required): the validator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr} ``` #### Response example ```json { "validator": { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2023-03-02T11:52:10.807Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2023-03-02T11:52:10.807Z" }, "min_self_delegation": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/query-p3/ title: Sei — Query (3/3) source: docs/rpc-service/chains/chains-api/sei/query-p3.mdx --- # Sei — Query (3/3) > API reference for [Sei](/rpc-service/chains/chains-api/sei/). [All methods ->](/rpc-service/chains/chains-api/sei/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/sei/query/) · [2](/rpc-service/chains/chains-api/sei/query-p2/) · 3 ### `/cosmos/staking/v1beta1/historical_info/{height}` > Retrieves the historical info for a given height. #### Parameters * `height` (string; int64; path; required): the height at which to query the historical data. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/historical_info/{height} ``` #### Response example ```json { "hist": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2023-03-02T11:55:21.837Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "valset": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2023-03-02T11:55:21.837Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2023-03-02T11:55:21.837Z" }, "min_self_delegation": "string" } ] } } ``` --- ### `/cosmos/staking/v1beta1/params` > Retrieves the staking parameters. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/params ``` #### Response example ```json { "params": { "unbonding_time": "string", "max_validators": 0, "max_entries": 0, "historical_entries": 0, "bond_denom": "string" } } ``` --- ### `/cosmos/staking/v1beta1/pool` > Retrieves the pool info. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/pool ``` #### Response example ```json { "pool": { "not_bonded_tokens": "string", "bonded_tokens": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators` > Retrieves all validators that match the given status. #### Parameters * `status` (string; query): a status to query the validators for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/validators ``` #### Response example ```json { "validators": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2023-03-02T12:05:06.275Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2023-03-02T12:05:06.275Z" }, "min_self_delegation": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}` > Retrieves validator info for a given validator address. #### Parameters * `validator_addr` (string; path; required): the validator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/validators/{validator_addr} ``` #### Response example ```json { "validator": { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2023-03-02T12:11:37.556Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2023-03-02T12:11:37.556Z" }, "min_self_delegation": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations` > Retrieves delegate info for a given validator. #### Parameters * `validator_addr` (string; path; required): the validator address to query for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/validators/{validator_addr}/delegations ``` #### Response example ```json { "delegation_responses": [ { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}` > Retrieves delegate info for given validator delegator pair. #### Parameters * `validator_addr` (string; path; required): the validator address to query for. * `delegator_addr` (string; path; required): the delegator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr} ``` #### Response example ```json { "delegation_response": { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation` > Retrieves unbonding info for given validator delegator pair. #### Parameters * `validator_addr` (string; path; required): the validator address to query for. * `delegator_addr` (string; path; required): the delegator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation ``` #### Response example ```json { "unbond": { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2023-03-02T12:22:06.905Z", "initial_balance": "string", "balance": "string" } ] } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations` > Retrieves unbonding delegations of a given validator address. #### Parameters * `validator_addr` (string; path; required): the validator address to query for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations ``` #### Response example ```json { "unbonding_responses": [ { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2023-03-02T12:23:51.870Z", "initial_balance": "string", "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/upgrade/v1beta1/applied_plan/{name}` > Retrieves a previously applied upgrade plan by its name. #### Parameters * `name` (string; path; required): the name of the applied plan to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/upgrade/v1beta1/applied_plan/{name} ``` #### Response example ```json { "height": "string" } ``` --- ### `/cosmos/upgrade/v1beta1/current_plan` > Retrieves the current upgrade plan. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/upgrade/v1beta1/current_plan ``` #### Response example ```json { "plan": { "name": "string", "time": "2023-03-02T12:29:52.518Z", "height": "string", "info": "string", "upgraded_client_state": { "type_url": "string", "value": "string" } } } ``` --- ### `/cosmos/upgrade/v1beta1/module_versions` > Retrieves the list of module versions from state. #### Parameters * `module_name` (string; query): a field to query a specific module consensus version from state. Leaving this empty will fetch the full list of module versions from state. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/upgrade/v1beta1/module_versions ``` #### Response example ```json { "module_versions": [ { "name": "string", "version": "string" } ] } ``` --- ### `/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}` > Retrieves the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain. `UpgradedConsensusState` RPC not supported with legacy querier. #### Parameters * `last_height` (string; int64; path; required): the last height of the current chain must be sent in request as this is the height under which the next consensus state is stored. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height} ``` #### Response example ```json { "upgraded_consensus_state": "string" } ``` --- ### `/cosmos/authz/v1beta1/grants` > Retrieves the list of `Authorization`, granted to the grantee by the granter. #### Parameters * `granter` (string; query): a granter. * `grantee` (string; query): a grantee. * `msg_type_url` (string; query): define to retrieve the grants matching a given message type. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/authz/v1beta1/grants ``` #### Response example ```json { "grants": [ { "authorization": { "type_url": "string", "value": "string" }, "expiration": "2023-03-02T12:52:34.325Z" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}` > Retrieves the fee granted to the grantee by the granter. #### Parameters * `granter` (string; query): a granter. * `grantee` (string; query): a grantee. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee} ``` #### Response example ```json { "allowance": { "granter": "string", "grantee": "string", "allowance": { "type_url": "string", "value": "string" } } } ``` --- ### `/cosmos/feegrant/v1beta1/allowances/{grantee}` > Retrieves all the grants for an address. #### Parameters * `grantee` (string; query): a grantee. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/feegrant/v1beta1/allowances/{grantee} ``` #### Response example ```json { "allowances": [ { "granter": "string", "grantee": "string", "allowance": { "type_url": "string", "value": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/query/ title: Sei — Query (1/3) source: docs/rpc-service/chains/chains-api/sei/query.mdx --- # Sei — Query (1/3) > API reference for [Sei](/rpc-service/chains/chains-api/sei/). [All methods ->](/rpc-service/chains/chains-api/sei/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/sei/query-p2/) · [3](/rpc-service/chains/chains-api/sei/query-p3/) ### `/cosmos/bank/v1beta1/balances/{address}` > Retrieves the balance of all coins for a single account. #### Parameters * `address` (string; path; required): the address to query balances for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/bank/v1beta1/balances/{address} ``` #### Response example ```json { "balances": [ { "denom": "string", "amount": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/bank/v1beta1/balances/{address}/{denom}` > Retrieves the balance of a single coin for a single account. #### Parameters * `address` (string; path; required): the address to query balances for. * `denom` (string; path; required): the coin denom to query balances for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/bank/v1beta1/balances/{address}/{denom} ``` #### Response example ```json { "balance": { "denom": "string", "amount": "string" } } ``` --- ### `/cosmos/bank/v1beta1/denom_owners/{denom}` > Retrieves all account addresses that own a particular token denomination. #### Parameters * `denom` (string; path; required): defines the coin denomination to query all account holders for. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/bank/v1beta1/denom_owners/{denom} ``` #### Response example ```json { "denom_owners": [ { "address": "string", "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/bank/v1beta1/denoms_metadata` > Retrieves the client metadata for all registered coin denominations. #### Parameters * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/bank/v1beta1/denoms_metadata ``` #### Response example ```json { "metadatas": [ { "description": "string", "denom_units": [ { "denom": "string", "exponent": 0, "aliases": [ "string" ] } ], "base": "string", "display": "string", "name": "string", "symbol": "string", "uri": "string", "uri_hash": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/bank/v1beta1/denoms_metadata/{denom}` > Retrieves the client metadata of a given coin denomination. #### Parameters * `denom` (string; path; required): the coin denomination to query the metadata for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/bank/v1beta1/denoms_metadata/{denom} ``` #### Response example ```json { "metadata": { "description": "string", "denom_units": [ { "denom": "string", "exponent": 0, "aliases": [ "string" ] } ], "base": "string", "display": "string", "name": "string", "symbol": "string", "uri": "string", "uri_hash": "string" } } ``` --- ### `/cosmos/bank/v1beta1/params` > Retrieves the parameters of x/bank module. #### Parameter None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY//cosmos/bank/v1beta1/params ``` #### Response example ```json { "params": { "send_enabled": [ { "denom": "string", "enabled": true } ], "default_send_enabled": true } } ``` --- ### `/cosmos/bank/v1beta1/supply` > Retrieves the total supply of all coins. #### Parameters * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Code responses: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/bank/v1beta1/supply ``` #### Response example ```json { "supply": [ { "denom": "string", "amount": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/bank/v1beta1/supply/{denom}` > Retrieves the supply of a single coin. #### Parameters * `denom` (string; path; required): the coin denom to query balances for. #### Returns Code responses: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/bank/v1beta1/supply/{denom} ``` #### Response example ```json { "amount": { "denom": "string", "amount": "string" } } ``` --- ### `/cosmos/distribution/v1beta1/community_pool` > Retrieves the community pool coins. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/distribution/v1beta1/community_pool ``` #### Response example ```json { "pool": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards` > Retrieves the total rewards accrued by each validator. #### Parameters * `delegator_address` (string; path; required): the delegator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards ``` #### Response example ```json { "rewards": [ { "validator_address": "string", "reward": [ { "denom": "string", "amount": "string" } ] } ], "total": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}` > Retrieves the total rewards accrued by a delegation. #### Parameters * `delegator_address` (string; path; required): the delegator address to query for. * `validator_address` (string; path; required): the validator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address} ``` #### Response example ```json { "rewards": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators` > Retrieves the validators of a delegator. #### Parameters * `delegator_address` (string; path; required): the delegator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators ``` #### Response example ```json { "validators": [ "string" ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address` > Retrieves a withdrawal address of a delegator. #### Parameters * `delegator_address` (string; path; required): the delegator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address ``` #### Response example ```json { "withdraw_address": "string" } ``` --- ### `/cosmos/distribution/v1beta1/params` > Retrieves parameters of the distribution module. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/distribution/v1beta1/params ``` #### Response example ```json { "params": { "community_tax": "string", "base_proposer_reward": "string", "bonus_proposer_reward": "string", "withdraw_addr_enabled": true } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/commission` > Retrieves accumulated commission for a validator. #### Parameters * `validator_address` (string; path; required): the validator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/distribution/v1beta1/validators/{validator_address}/commission ``` #### Response example ```json { "commission": { "commission": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards` > Retrieves the rewards of a validator address. #### Parameters * `validator_address` (string; path; required): the validator address to query for. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards ``` #### Response example ```json { "rewards": { "rewards": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/slashes` > Retrieves slash events of a validator. #### Parameters * `validator_address` (string; path; required): the validator address to query for. * `starting_height` (uint64; query): the optional starting height to query the slashes. * `ending_height` (uint64; query): the optional ending height to query the slashes. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/distribution/v1beta1/validators/{validator_address}/slashes ``` #### Response example ```json { "slashes": [ { "validator_period": "string", "fraction": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/evidence/v1beta1/evidence` > Retrieves all evidence. #### Parameters * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/evidence/v1beta1/evidence ``` #### Response example ```json { "evidence": [ { "type_url": "string", "value": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/evidence/v1beta1/evidence/{evidence_hash}` > Retrieves evidence based on evidence hash. #### Parameters * `evidence_hash` (string; byte; path; required): the hash of the evidence to retrieve. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/evidence/v1beta1/evidence/{evidence_hash} ``` #### Response example ```json { "evidence": { "type_url": "string", "value": "string" } } ``` --- ### `/cosmos/gov/v1beta1/params/{params_type}` > Retrieves all parameters of the gov module. #### Parameters * `params_type` (string; path; required): defines which parameters to query for, can be one of "voting", "tallying", or "deposit". #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/gov/v1beta1/params/{params_type} ``` #### Response example ```json { "voting_params": { "voting_period": "string" }, "deposit_params": { "min_deposit": [ { "denom": "string", "amount": "string" } ], "max_deposit_period": "string" }, "tally_params": { "quorum": "string", "threshold": "string", "veto_threshold": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals` > Retrieves all proposals based on given status. #### Parameters * `proposal_status` (string; query): defines the status of the proposals; the following statuses are available: * `PROPOSAL_STATUS_UNSPECIFIED`: a default proposal status. * `PROPOSAL_STATUS_DEPOSIT_PERIOD`: a proposal status during the deposit period. * `PROPOSAL_STATUS_VOTING_PERIOD`: a proposal status during the voting period. * `PROPOSAL_STATUS_PASSED`: a proposal status of a proposal that has passed. * `PROPOSAL_STATUS_REJECTED`: a proposal status of a proposal that has been rejected. * `PROPOSAL_STATUS_FAILED`: a proposal status of a proposal that has failed. * `voter` (string; query): * `depositor` (string; query): * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/gov/v1beta1/proposals ``` #### Response example ```json { "proposals": [ { "proposal_id": "string", "content": { "type_url": "string", "value": "string" }, "status": "PROPOSAL_STATUS_UNSPECIFIED", "final_tally_result": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" }, "submit_time": "2023-03-02T10:55:55.465Z", "deposit_end_time": "2023-03-02T10:55:55.465Z", "total_deposit": [ { "denom": "string", "amount": "string" } ], "voting_start_time": "2023-03-02T10:55:55.465Z", "voting_end_time": "2023-03-02T10:55:55.465Z" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sei/services/ title: Sei — Services source: docs/rpc-service/chains/chains-api/sei/services.mdx --- # Sei — Services > API reference for [Sei](/rpc-service/chains/chains-api/sei/). [All methods ->](/rpc-service/chains/chains-api/sei/#methods) ## Services ### `/cosmos/base/tendermint/v1beta1/blocks/latest` > Retrieves the latest block. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/base/tendermint/v1beta1/blocks/latest ``` #### Response example ```json { "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "block": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2023-03-02T13:02:59.747Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "data": { "txs": [ "string" ] }, "evidence": { "evidence": [ { "duplicate_vote_evidence": { "vote_a": { "type": "SIGNED_MSG_TYPE_UNKNOWN", "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "timestamp": "2023-03-02T13:02:59.747Z", "validator_address": "string", "validator_index": 0, "signature": "string" }, "vote_b": { "type": "SIGNED_MSG_TYPE_UNKNOWN", "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "timestamp": "2023-03-02T13:02:59.747Z", "validator_address": "string", "validator_index": 0, "signature": "string" }, "total_voting_power": "string", "validator_power": "string", "timestamp": "2023-03-02T13:02:59.747Z" }, "light_client_attack_evidence": { "conflicting_block": { "signed_header": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2023-03-02T13:02:59.747Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "commit": { "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "signatures": [ { "block_id_flag": "BLOCK_ID_FLAG_UNKNOWN", "validator_address": "string", "timestamp": "2023-03-02T13:02:59.747Z", "signature": "string" } ] } }, "validator_set": { "validators": [ { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "proposer": { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" }, "total_voting_power": "string" } }, "common_height": "string", "byzantine_validators": [ { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "total_voting_power": "string", "timestamp": "2023-03-02T13:02:59.747Z" } } ] }, "last_commit": { "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "signatures": [ { "block_id_flag": "BLOCK_ID_FLAG_UNKNOWN", "validator_address": "string", "timestamp": "2023-03-02T13:02:59.747Z", "signature": "string" } ] } } } ``` --- ### `/cosmos/base/tendermint/v1beta1/blocks/{height}` > Retrieves the block for a given height. #### Parameters * `height` (string; int64; path; required): a height to query the block at. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/base/tendermint/v1beta1/blocks/{height} ``` #### Response example ```json { "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "block": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2023-03-02T13:04:50.862Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "data": { "txs": [ "string" ] }, "evidence": { "evidence": [ { "duplicate_vote_evidence": { "vote_a": { "type": "SIGNED_MSG_TYPE_UNKNOWN", "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "timestamp": "2023-03-02T13:04:50.862Z", "validator_address": "string", "validator_index": 0, "signature": "string" }, "vote_b": { "type": "SIGNED_MSG_TYPE_UNKNOWN", "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "timestamp": "2023-03-02T13:04:50.862Z", "validator_address": "string", "validator_index": 0, "signature": "string" }, "total_voting_power": "string", "validator_power": "string", "timestamp": "2023-03-02T13:04:50.862Z" }, "light_client_attack_evidence": { "conflicting_block": { "signed_header": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2023-03-02T13:04:50.862Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "commit": { "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "signatures": [ { "block_id_flag": "BLOCK_ID_FLAG_UNKNOWN", "validator_address": "string", "timestamp": "2023-03-02T13:04:50.862Z", "signature": "string" } ] } }, "validator_set": { "validators": [ { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "proposer": { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" }, "total_voting_power": "string" } }, "common_height": "string", "byzantine_validators": [ { "address": "string", "pub_key": { "ed25519": "string", "secp256k1": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "total_voting_power": "string", "timestamp": "2023-03-02T13:04:50.862Z" } } ] }, "last_commit": { "height": "string", "round": 0, "block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "signatures": [ { "block_id_flag": "BLOCK_ID_FLAG_UNKNOWN", "validator_address": "string", "timestamp": "2023-03-02T13:04:50.862Z", "signature": "string" } ] } } } ``` --- ### `/cosmos/base/tendermint/v1beta1/node_info` > Retrieves the current node info. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/base/tendermint/v1beta1/node_info ``` #### Response example ```json { "default_node_info": { "protocol_version": { "p2p": "string", "block": "string", "app": "string" }, "default_node_id": "string", "listen_addr": "string", "network": "string", "version": "string", "channels": "string", "moniker": "string", "other": { "tx_index": "string", "rpc_address": "string" } }, "application_version": { "name": "string", "app_name": "string", "version": "string", "git_commit": "string", "build_tags": "string", "go_version": "string", "build_deps": [ { "path": "string", "version": "string", "sum": "string" } ], "cosmos_sdk_version": "string" } } ``` --- ### `/cosmos/base/tendermint/v1beta1/syncing` > Retrieves node syncing state. #### Parameters None. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/base/tendermint/v1beta1/syncing ``` #### Response example ```json { "syncing": true } ``` --- ### `/cosmos/base/tendermint/v1beta1/validatorsets/latest` > Retrieves the latest validator-set. #### Parameters * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/base/tendermint/v1beta1/validatorsets/latest ``` #### Response example ```json { "block_height": "string", "validators": [ { "address": "string", "pub_key": { "type_url": "string", "value": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/base/tendermint/v1beta1/validatorsets/{height}` > Retrieves the validator-set at a given height. #### Parameters * `height` (string; int64; path; required): the height to retrieve the validator-set at. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/base/tendermint/v1beta1/validatorsets/{height} ``` #### Response example ```json { "block_height": "string", "validators": [ { "address": "string", "pub_key": { "type_url": "string", "value": "string" }, "voting_power": "string", "proposer_priority": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/tx/v1beta1/simulate` > Simulates executing a transaction to estimate gas usage. #### Parameters * `` (object; required): ```json { "tx": { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] }, "tx_bytes": "string" } ``` #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/tx/v1beta1/simulate ``` #### Response example ```json { "gas_info": { "gas_wanted": "string", "gas_used": "string" }, "result": { "data": "string", "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string", "index": true } ] } ] } } ``` --- ### `/cosmos/tx/v1beta1/txs` > Retrieves transactions by event. #### Parameters * `events` (array[string]; query): the list of transaction event type. * `pagination.key` (string; byte; query): key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.offset` (string; uint64; query): offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of the pagination parameters should be set — `pagination.key` or `pagination.offset`. * `pagination.limit` (string; uint64; query): limit is the total number of results to be returned in the result page. If left empty, it will default to a value to be set by each app. * `pagination.count_total` (boolean; query): count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. * `pagination.reverse` (boolean; query): reverse is set to true if results are to be returned in the descending order. * `order_by` (string; query): the following values are available: * `ORDER_BY_UNSPECIFIED` (default): specifies an unknown sorting order. OrderBy defaults to ASC in this case. * `ORDER_BY_ASC`: defines ascending order. * `ORDER_BY_DESC`: defines descending order. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/tx/v1beta1/txs ``` #### Response example ```json { "txs": [ { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] } ], "tx_responses": [ { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/tx/v1beta1/txs` > Broadcasts a transaction. #### Parameters * `` (object; required): ```json { "tx_bytes": "string", "mode": "BROADCAST_MODE_UNSPECIFIED" } ``` #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl -X POST https://rpc.ankr.com/premium/YOUR_ANKR_API_KEY-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/tx/v1beta1/txs ``` #### Response example ```json { "tx_response": { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } } ``` --- ### `/cosmos/tx/v1beta1/txs/{hash}` > Retrieves a transaction by hash. #### Parameters * `` (string; path; required): the transaction hash to query, encoded as a hex string. #### Returns Response codes: * 200 — success. * default — unexpected error. #### Request example ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/YOUR_ANKR_API_KEY/cosmos/tx/v1beta1/txs/{hash} ``` #### Response example ```json { "tx": { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] }, "tx_response": { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/solana/ title: Solana description: Solana is a decentralized blockchain built to enable scalable, user-friendly apps for the world. 50 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/solana/index.mdx --- # Solana
> Solana API is available on [Web3 API platform](https://www.ankr.com/rpc/solana). *Solana* is a decentralized blockchain built to enable scalable, user-friendly apps for the world. In order for your Web3 application to interact with the Solana blockchain — either by reading blockchain data or sending transactions to the network — it must connect to a Solana node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, lightweight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message-passing environments. It uses JSON (RFC 4627) as data format. :::info **Transaction history window.** Ankr Solana RPC nodes are configured with a ledger size of ~100M, which retains approximately the last **16 hours** of transaction history. Requests via `getTransaction`, `getBlock`, `getSignaturesForAddress`, etc. for slots older than this window will return `null` or an error. For deeper historical lookups, use a Solana archive provider or a block explorer API. ::: ## Methods
* [`getAccountInfo`](/rpc-service/chains/chains-api/solana/methods/#getaccountinfo) — returns all information associated with the account of provided Pubkey. * [`getBalance`](/rpc-service/chains/chains-api/solana/methods/#getbalance) — returns the balance of the account of provided Pubkey. * [`getBlock`](/rpc-service/chains/chains-api/solana/methods/#getblock) — returns identity and transaction information about a confirmed block in the ledger. * [`getBlockHeight`](/rpc-service/chains/chains-api/solana/methods-p2/#getblockheight) — returns the current block height of the node. * [`getBlockProduction`](/rpc-service/chains/chains-api/solana/methods-p2/#getblockproduction) — returns recent block production information from the current or previous epoch. * [`getBlockCommitment`](/rpc-service/chains/chains-api/solana/methods-p2/#getblockcommitment) — returns the commitment for particular block. * [`getBlocks`](/rpc-service/chains/chains-api/solana/methods-p2/#getblocks) — returns a list of confirmed blocks between two slots. * [`getBlocksWithLimit`](/rpc-service/chains/chains-api/solana/methods-p2/#getblockswithlimit) — returns a list of confirmed blocks starting at the given slot. * [`getBlockTime`](/rpc-service/chains/chains-api/solana/methods-p2/#getblocktime) — returns the estimated production time of a block. * [`getClusterNodes`](/rpc-service/chains/chains-api/solana/methods-p2/#getclusternodes) — returns information about all the nodes participating in the cluster. * [`getEpochInfo`](/rpc-service/chains/chains-api/solana/methods-p2/#getepochinfo) — returns information about the current epoch. * [`getEpochSchedule`](/rpc-service/chains/chains-api/solana/methods-p2/#getepochschedule) — returns epoch schedule information from this cluster's genesis config. * [`getFeeForMessage`](/rpc-service/chains/chains-api/solana/methods-p2/#getfeeformessage) — returns the fee the network will charge for a particular message. * [`getFirstAvailableBlock`](/rpc-service/chains/chains-api/solana/methods-p3/#getfirstavailableblock) — returns the slot of the lowest confirmed block that has not been purged from the ledger. * [`getGenesisHash`](/rpc-service/chains/chains-api/solana/methods-p3/#getgenesishash) — returns the genesis hash. * [`getHealth`](/rpc-service/chains/chains-api/solana/methods-p3/#gethealth) — returns the current health of the node. * [`getHighestSnapshotSlot`](/rpc-service/chains/chains-api/solana/methods-p3/#gethighestsnapshotslot) — returns the highest slot information that the node has snapshots for. * [`getIdentity`](/rpc-service/chains/chains-api/solana/methods-p3/#getidentity) — returns the identity pubkey for the current node. * [`getInflationGovernor`](/rpc-service/chains/chains-api/solana/methods-p3/#getinflationgovernor) — returns the current inflation governor. * [`getInflationRate`](/rpc-service/chains/chains-api/solana/methods-p3/#getinflationrate) — returns the specific inflation values for the current epoch. * [`getInflationReward`](/rpc-service/chains/chains-api/solana/methods-p3/#getinflationreward) — returns the inflation / staking reward for a list of addresses for an epoch. * [`getLargestAccounts`](/rpc-service/chains/chains-api/solana/methods-p3/#getlargestaccounts) — returns the 20 largest accounts, by lamport balance. * [`getLatestBlockhash`](/rpc-service/chains/chains-api/solana/methods-p3/#getlatestblockhash) — returns the latest blockhash. * [`getLeaderSchedule`](/rpc-service/chains/chains-api/solana/methods-p3/#getleaderschedule) — returns the leader schedule for an epoch. * [`getMaxRetransmitSlot`](/rpc-service/chains/chains-api/solana/methods-p3/#getmaxretransmitslot) — returns the max slot seen from retransmit stage. * [`getMaxShredInsertSlot`](/rpc-service/chains/chains-api/solana/methods-p4/#getmaxshredinsertslot) — returns the max slot seen from after shred insert. * [`getMinimumBalanceForRentExemption`](/rpc-service/chains/chains-api/solana/methods-p4/#getminimumbalanceforrentexemption) — returns minimum balance required to make account rent exempt. * [`getMultipleAccounts`](/rpc-service/chains/chains-api/solana/methods-2/#getmultipleaccounts) — returns the account information for a list of Pubkeys. * [`getProgramAccounts`](/rpc-service/chains/chains-api/solana/methods-2/#getprogramaccounts) — returns all accounts owned by the provided program Pubkey. * [`getRecentPerformanceSamples`](/rpc-service/chains/chains-api/solana/methods-2/#getrecentperformancesamples) — returns the list of recent performance samples. * [`getSignaturesForAddress`](/rpc-service/chains/chains-api/solana/methods-2/#getsignaturesforaddress) — returns signatures for confirmed transactions that include the given address in their `accountKeys` list. * [`getSignatureStatuses`](/rpc-service/chains/chains-api/solana/methods-2/#getsignaturestatuses) — returns the statuses of a list of signatures. * [`getSlot`](/rpc-service/chains/chains-api/solana/methods-2-p2/#getslot) — returns the slot that has reached the given or default commitment level. * [`getSlotLeader`](/rpc-service/chains/chains-api/solana/methods-2-p2/#getslotleader) — returns the current slot leader. * [`getSlotLeaders`](/rpc-service/chains/chains-api/solana/methods-2-p2/#getslotleaders) — returns the slot leaders for a given slot range. * [`getSupply`](/rpc-service/chains/chains-api/solana/methods-2-p2/#getsupply) — returns information about the current supply. * [`getTokenAccountBalance`](/rpc-service/chains/chains-api/solana/methods-2-p2/#gettokenaccountbalance) — returns the token balance of an SPL Token account. * [`getTokenAccountsByDelegate`](/rpc-service/chains/chains-api/solana/methods-2-p2/#gettokenaccountsbydelegate) — returns all SPL Token accounts by approved delegate. * [`getTokenAccountsByOwner`](/rpc-service/chains/chains-api/solana/methods-2-p2/#gettokenaccountsbyowner) — returns all SPL Token accounts by token owner. * [`getTokenLargestAccounts`](/rpc-service/chains/chains-api/solana/methods-2-p3/#gettokenlargestaccounts) — returns the 20 largest accounts of a particular SPL Token type. * [`getTokenSupply`](/rpc-service/chains/chains-api/solana/methods-2-p3/#gettokensupply) — returns the total supply of an SPL Token type. * [`getTransaction`](/rpc-service/chains/chains-api/solana/methods-2-p3/#gettransaction) — returns transaction details for a confirmed transaction. * [`getTransactionCount`](/rpc-service/chains/chains-api/solana/methods-2-p4/#gettransactioncount) — returns the current Transaction count from the ledger. * [`getVersion`](/rpc-service/chains/chains-api/solana/methods-2-p4/#getversion) — returns the current solana versions running on the node. * [`getVoteAccounts`](/rpc-service/chains/chains-api/solana/methods-3/#getvoteaccounts) — returns the account info and associated stake for all the voting accounts in the current bank. * [`isBlockhashValid`](/rpc-service/chains/chains-api/solana/methods-3/#isblockhashvalid) — returns whether a blockhash is still valid or not. * [`minimumLedgerSlot`](/rpc-service/chains/chains-api/solana/methods-3/#minimumledgerslot) — returns the lowest slot that the node has information about in its ledger. * [`requestAirdrop`](/rpc-service/chains/chains-api/solana/methods-3/#requestairdrop) — requests an airdrop of lamports to a Pubkey. * [`sendTransaction`](/rpc-service/chains/chains-api/solana/methods-3/#sendtransaction) — submits a signed transaction to the cluster for processing. * [`simulateTransaction`](/rpc-service/chains/chains-api/solana/methods-3/#simulatetransaction) — simulates sending a transaction. --- ## Methods ### Methods - [`getAccountInfo`](/rpc-service/chains/chains-api/solana/methods/#getaccountinfo) - [`getBalance`](/rpc-service/chains/chains-api/solana/methods/#getbalance) - [`getBlock`](/rpc-service/chains/chains-api/solana/methods/#getblock) - [`getBlockHeight`](/rpc-service/chains/chains-api/solana/methods-p2/#getblockheight) - [`getBlockProduction`](/rpc-service/chains/chains-api/solana/methods-p2/#getblockproduction) - [`getBlockCommitment`](/rpc-service/chains/chains-api/solana/methods-p2/#getblockcommitment) - [`getBlocks`](/rpc-service/chains/chains-api/solana/methods-p2/#getblocks) - [`getBlocksWithLimit`](/rpc-service/chains/chains-api/solana/methods-p2/#getblockswithlimit) - [`getBlockTime`](/rpc-service/chains/chains-api/solana/methods-p2/#getblocktime) - [`getClusterNodes`](/rpc-service/chains/chains-api/solana/methods-p2/#getclusternodes) - [`getEpochInfo`](/rpc-service/chains/chains-api/solana/methods-p2/#getepochinfo) - [`getEpochSchedule`](/rpc-service/chains/chains-api/solana/methods-p2/#getepochschedule) - [`getFeeForMessage`](/rpc-service/chains/chains-api/solana/methods-p2/#getfeeformessage) - [`getFirstAvailableBlock`](/rpc-service/chains/chains-api/solana/methods-p3/#getfirstavailableblock) - [`getGenesisHash`](/rpc-service/chains/chains-api/solana/methods-p3/#getgenesishash) - [`getHealth`](/rpc-service/chains/chains-api/solana/methods-p3/#gethealth) - [`getHighestSnapshotSlot`](/rpc-service/chains/chains-api/solana/methods-p3/#gethighestsnapshotslot) - [`getIdentity`](/rpc-service/chains/chains-api/solana/methods-p3/#getidentity) - [`getInflationGovernor`](/rpc-service/chains/chains-api/solana/methods-p3/#getinflationgovernor) - [`getInflationRate`](/rpc-service/chains/chains-api/solana/methods-p3/#getinflationrate) - [`getInflationReward`](/rpc-service/chains/chains-api/solana/methods-p3/#getinflationreward) - [`getLargestAccounts`](/rpc-service/chains/chains-api/solana/methods-p3/#getlargestaccounts) - [`getLatestBlockhash`](/rpc-service/chains/chains-api/solana/methods-p3/#getlatestblockhash) - [`getLeaderSchedule`](/rpc-service/chains/chains-api/solana/methods-p3/#getleaderschedule) - [`getMaxRetransmitSlot`](/rpc-service/chains/chains-api/solana/methods-p3/#getmaxretransmitslot) - [`getMaxShredInsertSlot`](/rpc-service/chains/chains-api/solana/methods-p4/#getmaxshredinsertslot) - [`getMinimumBalanceForRentExemption`](/rpc-service/chains/chains-api/solana/methods-p4/#getminimumbalanceforrentexemption) ### Methods - [`getMultipleAccounts`](/rpc-service/chains/chains-api/solana/methods-2/#getmultipleaccounts) - [`getProgramAccounts`](/rpc-service/chains/chains-api/solana/methods-2/#getprogramaccounts) - [`getRecentPerformanceSamples`](/rpc-service/chains/chains-api/solana/methods-2/#getrecentperformancesamples) - [`getSignaturesForAddress`](/rpc-service/chains/chains-api/solana/methods-2/#getsignaturesforaddress) - [`getSignatureStatuses`](/rpc-service/chains/chains-api/solana/methods-2/#getsignaturestatuses) - [`getSlot`](/rpc-service/chains/chains-api/solana/methods-2-p2/#getslot) - [`getSlotLeader`](/rpc-service/chains/chains-api/solana/methods-2-p2/#getslotleader) - [`getSlotLeaders`](/rpc-service/chains/chains-api/solana/methods-2-p2/#getslotleaders) - [`getSupply`](/rpc-service/chains/chains-api/solana/methods-2-p2/#getsupply) - [`getTokenAccountBalance`](/rpc-service/chains/chains-api/solana/methods-2-p2/#gettokenaccountbalance) - [`getTokenAccountsByDelegate`](/rpc-service/chains/chains-api/solana/methods-2-p2/#gettokenaccountsbydelegate) - [`getTokenAccountsByOwner`](/rpc-service/chains/chains-api/solana/methods-2-p2/#gettokenaccountsbyowner) - [`getTokenLargestAccounts`](/rpc-service/chains/chains-api/solana/methods-2-p3/#gettokenlargestaccounts) - [`getTokenSupply`](/rpc-service/chains/chains-api/solana/methods-2-p3/#gettokensupply) - [`getTransaction`](/rpc-service/chains/chains-api/solana/methods-2-p3/#gettransaction) - [`getTransactionCount`](/rpc-service/chains/chains-api/solana/methods-2-p4/#gettransactioncount) - [`getVersion`](/rpc-service/chains/chains-api/solana/methods-2-p4/#getversion) ### Methods - [`getVoteAccounts`](/rpc-service/chains/chains-api/solana/methods-3/#getvoteaccounts) - [`isBlockhashValid`](/rpc-service/chains/chains-api/solana/methods-3/#isblockhashvalid) - [`minimumLedgerSlot`](/rpc-service/chains/chains-api/solana/methods-3/#minimumledgerslot) - [`requestAirdrop`](/rpc-service/chains/chains-api/solana/methods-3/#requestairdrop) - [`sendTransaction`](/rpc-service/chains/chains-api/solana/methods-3/#sendtransaction) - [`simulateTransaction`](/rpc-service/chains/chains-api/solana/methods-3/#simulatetransaction) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/solana/methods-2-p2/ title: Solana — Methods (2/4) source: docs/rpc-service/chains/chains-api/solana/methods-2-p2.mdx --- # Solana — Methods (2/4) > API reference for [Solana](/rpc-service/chains/chains-api/solana/). [All methods ->](/rpc-service/chains/chains-api/solana/#methods) > > Part 2 of 4: [1](/rpc-service/chains/chains-api/solana/methods-2/) · 2 · [3](/rpc-service/chains/chains-api/solana/methods-2-p3/) · [4](/rpc-service/chains/chains-api/solana/methods-2-p4/) ## `getSlot` > **Returns the slot that has reached the given (finalized/confirmed/processed) or default (finalized) commitment level.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional): the configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns
* ``: the current slot. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getSlot" }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": 374449197, "id": 1 } ``` --- ## `getSlotLeader` > **Returns the current slot leader.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns
* ``: the node identity Pubkey as base-58 encoded string. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getSlotLeader" }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS", "id": 1 } ``` --- ## `getSlotLeaders` > **Returns the slot leaders for a given slot range.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the start slot, as u64 integer. * ``: the limit, as a u64 integer (between 1 and 5,000). ### Returns
* ``: the node identity public keys as base-58 encoded strings. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getSlotLeaders", "params": [374449190, 10] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB", "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB", "dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS", "dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS", "dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS", "dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS", "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB", "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB", "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB", "dv4ACNkpYPcE3aKmYDqZm9G5EB3J4MRoeE7WNDRBVJB" ] } ``` --- ## `getSupply` > **Returns information about the current supply.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `excludeNonCirculatingAccountsList` (boolean): set to `true` to exclude non-circulating accounts list from response. ### Returns The result contains the `value` object with the following fields: * `total` (u64): the total supply in lamports. * `circulating` (u64): the circulating supply in lamports. * `nonCirculating` (u64): the non-circulating supply in lamports. * `nonCirculatingAccounts` (array): an array of account addresses of non-circulating accounts, as strings. If `excludeNonCirculatingAccountsList` is enabled, the returned array will be empty. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getSupply" }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374451103 }, "value": { "circulating": 968499669854531580, "nonCirculating": 315864946596719089, "nonCirculatingAccounts": [ "AsrYX4FeLXnZcrjcZmrASY2Eq1jvEeQfwxtNTxS5zojA", "CY7X5o3Wi2eQhTocLmUS6JSWyx1NinBfW7AXRrkRCpi8", "CHmdL15akDcJgBkY6BP3hzs98Dqr6wbdDC5p8odvtSbq", "3fV2GaDKa3pZxyDcpMh5Vrh2FVAMUiWUKbYmnBFv8As3", "9xbcBZoGYFnfJZe81EDuDYKUm8xGkjzW8z4EgnVhNvsv", "3vSVZC7LfnnyGuacykWoWrbzrmTyFVSXxCbKJUFbJcKS", "CuatS6njAcfkFHnvai7zXCs7syA9bykXWsDCJEWfhjHG", "APnSR52EC1eH676m7qTBHUJ1nrGpHYpV7XKPxgRDD8gX", "9NFMpkv65d2G7UMMFYHeXrBAaB6rVD3BgQ95bKiwr448", "4U9iUGSHj1kJa7AefG4UdEPd1xVvMyK3suDhngnvazyf", "6Uz9bTkdAtmzsDWk3Jso9YzzfYiNpEShBZbxUsvMnRbJ", "8MrstTxNJpwXSFxn5FGwvre2uCcCaRPs94f2FcknVUyr" ], "total": 1284364616451250669 } }, "id": 1 } ``` --- ## `getTokenAccountBalance` > **Returns the token balance of an SPL Token account.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the pubkey of Token account to query, as base-58 encoded string. * `` (optional): the configuration object containing the following field: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. ### Returns The result contains the `value` object with the following fields: * `amount` (string): the raw balance without decimals, a string representation of u64. * `decimals` (u8): the number of base 10 digits to the right of the decimal place. * `uiAmount` (number|null): the balance, using mint-prescribed decimals [DEPRECATED]. * `uiAmountString` (string): the balance as a string, using mint-prescribed decimals. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTokenAccountBalance", "params": ["7nxXxpEEsAFf5CSqapwjBjt65xnQUBAdug2pXS89YzmY"] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374621302 }, "value": { "amount": "828545484", "decimals": 6, "uiAmount": 828.545484, "uiAmountString": "828.545484" } } } ``` --- ## `getTokenAccountsByDelegate` > **Returns all SPL Token accounts by approved Delegate.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the pubkey of account delegate to query, as base-58 encoded string. * `` (required): either: * `mint` (string): the pubkey of the specific token Mint to limit accounts to, as base-58 encoded string; or * `programId` (string): the pubkey of the Token program that owns the accounts, as base-58 encoded string. * `` (optional): the configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `encoding` (string): encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using [Zstandard](https://facebook.github.io/zstd/) and base64-encodes the result. ["jsonParsed" encoding](https://docs.solana.com/developing/clients/jsonrpc-api#parsed-responses) attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when the `data` field is type `string`. * `dataSlice` (object; optional): limits the returned account data using the provided `offset: ` and `length: ` fields; only available for "base58", "base64" or "base64+zstd" encodings. * `minContextSlot` (number; optional): sets the minimum slot that the request can be evaluated at. ### Returns The result contains the `value` object with the following fields: * `pubkey` (string): the account Pubkey as base-58 encoded string. * `account` (object): a JSON object, with the following subfields: * `lamports` (u64): the number of lamports assigned to this account, as a u64. * `owner` (string): the base-58 encoded Pubkey of the program this account has been assigned to. * `data` (object): the Token state data associated with the account, either as encoded binary data or in JSON format `{: }`. * `executable` (boolean): a boolean indicating if the account contains a program (and is strictly read-only). * `rentEpoch` (u64): the epoch at which this account will next owe rent, as u64. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTokenAccountsByDelegate", "params": [ "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T", { "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }, { "encoding": "jsonParsed" } ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "context": { "slot": 1114 }, "value": [ { "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 }, "pubkey": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp" } ] }, "id": 1 } ``` --- ## `getTokenAccountsByOwner` > **Returns all SPL Token accounts by token owner.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the pubkey of account owner to query, as base-58 encoded string. * `` (required): either: * `mint` (string): the pubkey of the specific token Mint to limit accounts to, as base-58 encoded string; or * `programId` (string): the pubkey of the Token program that owns the accounts, as base-58 encoded string. * `` (optional): the configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `encoding` (string): encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using [Zstandard](https://facebook.github.io/zstd/) and base64-encodes the result. ["jsonParsed" encoding](https://docs.solana.com/developing/clients/jsonrpc-api#parsed-responses) attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when the `data` field is type `string`. * `dataSlice` (object): limits he returned account data using the provided `offset: ` and `length: ` fields; only available for "base58", "base64" or "base64+zstd" encodings. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns The result contains the `value` object with the following fields: * `pubkey` (string): the account Pubkey as base-58 encoded string. * `account` (object): a JSON object, with the following subfields: * `lamports` (u64): the number of lamports assigned to this account, as a u64. * `owner` (string): the base-58 encoded Pubkey of the program this account has been assigned to. * `data` (object): the Token state data associated with the account, either as encoded binary data or in JSON format `{: }`. * `executable` (boolean): a boolean indicating if the account contains a program (and is strictly read-only). * `rentEpoch` (u64): the epoch at which this account will next owe rent, as u64. ### Request parameters ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTokenAccountsByOwner", "params": [ "4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F", { "mint": "3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E" }, { "encoding": "jsonParsed" } ] }' ``` ### Response parameters ```json { "jsonrpc": "2.0", "result": { "context": { "slot": 1114 }, "value": [ { "account": { "data": { "program": "spl-token", "parsed": { "accountType": "account", "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": "4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F" }, "type": "account" }, "space": 165 }, "executable": false, "lamports": 1726080, "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "rentEpoch": 4 }, "pubkey": "C2gJg6tKpQs41PRS1nC8aw3ZKNZK3HQQZGVrDFDup5nx" } ] }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/solana/methods-2-p3/ title: Solana — Methods (3/4) source: docs/rpc-service/chains/chains-api/solana/methods-2-p3.mdx --- # Solana — Methods (3/4) > API reference for [Solana](/rpc-service/chains/chains-api/solana/). [All methods ->](/rpc-service/chains/chains-api/solana/#methods) > > Part 3 of 4: [1](/rpc-service/chains/chains-api/solana/methods-2/) · [2](/rpc-service/chains/chains-api/solana/methods-2-p2/) · 3 · [4](/rpc-service/chains/chains-api/solana/methods-2-p4/) ## `getTokenLargestAccounts` > **Returns the 20 largest accounts of a particular SPL Token type.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the Pubkey of token Mint to query, as base-58 encoded string. * `` (optional): the configuration object containing the following field: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. ### Returns The result contains the `value` object with the following fields: * `address` (string): the address of the token account. * `amount` (string): the raw token account balance without decimals, a string representation of u64. * `decimals` (u8): the number of base 10 digits to the right of the decimal place. * `uiAmount` (number|null): the token account balance, using mint-prescribed decimals [DEPRECATED]. * `uiAmountString` (string): the token account balance as a string, using mint-prescribed decimals. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTokenLargestAccounts", "params": ["So11111111111111111111111111111111111111112"] }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374624734 }, "value": [ { "address": "35akt5uJn73ZN9FkGgBKpRwbW5scoqV7M1N59cwb4TKV", "amount": "11109337918819635", "decimals": 9, "uiAmount": 11109337.918819636, "uiAmountString": "11109337.918819635" }, { "address": "2ceB4kejtRYjPi2tC6KP9pvmRfcEtrukPT18rWV4yejb", "amount": "1003836020391687", "decimals": 9, "uiAmount": 1003836.020391687, "uiAmountString": "1003836.020391687" } ] }, "id": 1 } ``` --- ## `getTokenSupply` > **Returns the total supply of an SPL Token type.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the Pubkey of token Mint to query, as base-58 encoded string. * `` (optional): the configuration object containing the following field: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. ### Returns The result contains the `value` object with the following fields: * `amount` (string): the raw total token supply without decimals, a string representation of u64. * `decimals` (u8): the number of base 10 digits to the right of the decimal place. * `uiAmount` (number|null): the total token supply, using mint-prescribed decimals [DEPRECATED]. * `uiAmountString` (string): the total token supply as a string, using mint-prescribed decimals. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTokenSupply", "params": ["So11111111111111111111111111111111111111112"] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374624888 }, "value": { "amount": "0", "decimals": 9, "uiAmount": 0.0, "uiAmountString": "0" } } } ``` --- ## `getTransaction` > **Returns transaction details for a confirmed transaction.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the transaction signature as base-58 encoded string. * `` (optional): the configuration object containing the following optional fields: * `encoding` (string): encoding for each returned Transaction, either "json", "jsonParsed", "base58" (slow), "base64". If parameter not provided, the default encoding is "json". ["jsonParsed" encoding](https://docs.solana.com/developing/clients/jsonrpc-api#parsed-responses) attempts to use program-specific instruction parsers to return more human-readable and explicit data in the `transaction.message.instructions` list. If "jsonParsed" is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (`accounts`, `data`, and `programIdIndex` fields). * `commitment` (string; default: "finalized"): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `maxSupportedTransactionVersion` (number): sets the max transaction version to return in responses. If the requested transaction is a higher version, an error will be returned. If this parameter is omitted, only legacy transactions will be returned, and any versioned transaction will prompt the error. ### Returns
* `null`: if transaction is not found or not confirmed. * ``: if transaction is confirmed, an object with the following fields: * `slot` (u64): the slot this transaction was processed in. * `transaction` (object|[string,encoding]): a [transaction](https://docs.solana.com/developing/clients/jsonrpc-api#transaction-structure) object, either in JSON format or encoded binary data, depending on encoding parameter. * `blockTime` (i64|null): the estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available. * `meta` (object|null): the transaction status metadata object: * `err` (object|null): Error if transaction failed, null if transaction succeeded. See the [TransactionError](https://docs.rs/solana-sdk/1.14.11/solana_sdk/transaction/enum.TransactionError.html) definitions. * `fee` (u64): the fee this transaction was charged, as u64 integer. * `preBalances` (array): an array of u64 account balances from before the transaction was processed. * `postBalances` (array): an array of u64 account balances after the transaction was processed. * `innerInstructions` (array|null): the list of [inner instructions](https://docs.solana.com/developing/clients/jsonrpc-api#inner-instructions-structure) or `null` if inner instruction recording was not enabled during this transaction. * `preTokenBalances` (array|undefined): the list of [token balances](https://docs.solana.com/developing/clients/jsonrpc-api#token-balances-structure) from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction. * `postTokenBalances` (array|undefined): the list of [token balances](https://docs.solana.com/developing/clients/jsonrpc-api#token-balances-structure) from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction. * `logMessages` (array|null): an array of string log messages or null if log message recording was not enabled during this transaction. * [DEPRECATED] `status: `: the transaction status: * `"Ok": `: the transaction was successful. * `"Err": `: the transaction failed with TransactionError. * `rewards` (array|null): the transaction-level rewards, populated if rewards are requested; an array of JSON objects containing: * `pubkey` (string): the public key, as base-58 encoded string, of the account that received the reward. * `lamports` (i64): the number of reward lamports credited or debited by the account, as a i64. * `postBalance` (u64): the account balance in lamports after the reward was applied. * `rewardType` (string): the type of reward: currently only "rent", other types may be added in the future. * `commission` (u8|undefined): a vote account commission when the reward was credited, only present for voting and staking rewards. * `loadedAddresses` (object|undefined): the transaction addresses loaded from address lookup tables. Undefined if `maxSupportedTransactionVersion` is not set in request params. * `writable` (array[string]): the ordered list of base-58 encoded addresses for writable loaded accounts. * `readonly` (array[string]): the ordered list of base-58 encoded addresses for readonly loaded accounts. * `returnData` (object|undefined): the most-recent return data generated by an instruction in the transaction, with the following fields: * `programId` (string): the program that generated the return data, as base-58 encoded Pubkey. * `data` ([string, encoding]): the return data itself, as base-64 encoded binary data. * `computeUnitsConsumed` (u64|undefined): the number of [compute units](https://docs.solana.com/developing/programming-model/runtime#compute-budget) consumed by the transaction. * `version` ("legacy"|number|undefined): the transaction version. Undefined if `maxSupportedTransactionVersion` is not set in request params. ### Request example 1 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTransaction", "params": [ "jS5UBJWbrxL9DM86LoGznZtqg8q8rP3xPmMv77s7F7qdCwQFg7cchxWHdRSw5X7Bmuvy6dTaejMcgjv2XJQ9dfD", { "encoding": "json", "maxSupportedTransactionVersion": 0 } ] }' ``` ### Response example 1 ```json { "jsonrpc": "2.0", "result": { "blockTime": 1744798149, "meta": { "computeUnitsConsumed": 4726, "err": null, "fee": 5000, "innerInstructions": [], "loadedAddresses": { "readonly": [], "writable": [] }, "logMessages": [ "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]", "Program log: Instruction: Transfer", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4726 of 200000 compute units", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success" ], "postBalances": [ 35199803303, 2039280, 2039280, 934087680 ], "postTokenBalances": [ { "accountIndex": 1, "mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", "owner": "EkkpfzUdwwgeqWb25hWcSi2c5gquELLUB3Z2asr1Xroo", "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "uiTokenAmount": { "amount": "828545485", "decimals": 6, "uiAmount": 828.545485, "uiAmountString": "828.545485" } }, { "accountIndex": 2, "mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", "owner": "DjGkZ6k5hMkaxMAboqc9MUrL8zq59Q8aQUuF6Fmr6DUD", "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "uiTokenAmount": { "amount": "1109995438", "decimals": 6, "uiAmount": 1109.995438, "uiAmountString": "1109.995438" } } ], "preBalances": [ 35199808303, 2039280, 2039280, 934087680 ], "preTokenBalances": [ { "accountIndex": 1, "mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", "owner": "EkkpfzUdwwgeqWb25hWcSi2c5gquELLUB3Z2asr1Xroo", "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "uiTokenAmount": { "amount": "828545486", "decimals": 6, "uiAmount": 828.545486, "uiAmountString": "828.545486" } }, { "accountIndex": 2, "mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", "owner": "DjGkZ6k5hMkaxMAboqc9MUrL8zq59Q8aQUuF6Fmr6DUD", "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "uiTokenAmount": { "amount": "1109995437", "decimals": 6, "uiAmount": 1109.995437, "uiAmountString": "1109.995437" } } ], "rewards": [], "status": { "Ok": null } }, "slot": 374619973, "transaction": { "message": { "accountKeys": [ "EkkpfzUdwwgeqWb25hWcSi2c5gquELLUB3Z2asr1Xroo", "7nxXxpEEsAFf5CSqapwjBjt65xnQUBAdug2pXS89YzmY", "HdUKfS4QwKUQawoLXNyDdsut11mtoYRyntFrhhjdhgR1", "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" ], "addressTableLookups": [], "header": { "numReadonlySignedAccounts": 0, "numReadonlyUnsignedAccounts": 1, "numRequiredSignatures": 1 }, "instructions": [ { "accounts": [ 1, 2, 0, 0 ], "data": "3DdGGhkhJbjm", "programIdIndex": 3, "stackHeight": null } ], "recentBlockhash": "5jKHQZzdu7kazYmicjPgwANsDwAqJnjWCYR1yjEVDZBL" }, "signatures": [ "jS5UBJWbrxL9DM86LoGznZtqg8q8rP3xPmMv77s7F7qdCwQFg7cchxWHdRSw5X7Bmuvy6dTaejMcgjv2XJQ9dfD" ] }, "version": 0 }, "id": 1 } ``` ### Request example 2 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTransaction", "params": [ "jS5UBJWbrxL9DM86LoGznZtqg8q8rP3xPmMv77s7F7qdCwQFg7cchxWHdRSw5X7Bmuvy6dTaejMcgjv2XJQ9dfD", { "encoding": "base64", "maxSupportedTransactionVersion": 0 } ] }' ``` ### Response example 2 ```json { "jsonrpc": "2.0", "result": { "blockTime": 1744798149, "meta": { "computeUnitsConsumed": 4726, "err": null, "fee": 5000, "innerInstructions": [], "loadedAddresses": { "readonly": [], "writable": [] }, "logMessages": [ "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]", "Program log: Instruction: Transfer", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4726 of 200000 compute units", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success" ], "postBalances": [ 35199803303, 2039280, 2039280, 934087680 ], "postTokenBalances": [ { "accountIndex": 1, "mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", "owner": "EkkpfzUdwwgeqWb25hWcSi2c5gquELLUB3Z2asr1Xroo", "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "uiTokenAmount": { "amount": "828545485", "decimals": 6, "uiAmount": 828.545485, "uiAmountString": "828.545485" } }, { "accountIndex": 2, "mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", "owner": "DjGkZ6k5hMkaxMAboqc9MUrL8zq59Q8aQUuF6Fmr6DUD", "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "uiTokenAmount": { "amount": "1109995438", "decimals": 6, "uiAmount": 1109.995438, "uiAmountString": "1109.995438" } } ], "preBalances": [ 35199808303, 2039280, 2039280, 934087680 ], "preTokenBalances": [ { "accountIndex": 1, "mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", "owner": "EkkpfzUdwwgeqWb25hWcSi2c5gquELLUB3Z2asr1Xroo", "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "uiTokenAmount": { "amount": "828545486", "decimals": 6, "uiAmount": 828.545486, "uiAmountString": "828.545486" } }, { "accountIndex": 2, "mint": "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU", "owner": "DjGkZ6k5hMkaxMAboqc9MUrL8zq59Q8aQUuF6Fmr6DUD", "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "uiTokenAmount": { "amount": "1109995437", "decimals": 6, "uiAmount": 1109.995437, "uiAmountString": "1109.995437" } } ], "rewards": [], "status": { "Ok": null } }, "slot": 374619973, "transaction": [ "ASSXkS4gFdRPjAgYMtI83mxAdkQQxNnrNjVo0/8n3PuyIfJiogZfy+QQZYpG/KbPbARMNWYYkgyNQtgHSfk+AgiAAQABBMxddFcL+KHOvfWKqE5HeL1iR4V7zrweiMVtVjfN1B7OZOwM3pq0f7lZsDDur9i+ue/ujyUjQwUnXvJRe7/+3hP3EsrzEUsyPOtXf0utjSb34dXGwknd9iobwU0NFQ5NrAbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCpRkXQbtykq1Yx/ZUrutYrW1qb5/p2XC9uMes1kL5LbhcBAwQBAgAACQMBAAAAAAAAAAA=", "base64" ], "version": 0 }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/solana/methods-2-p4/ title: Solana — Methods (4/4) source: docs/rpc-service/chains/chains-api/solana/methods-2-p4.mdx --- # Solana — Methods (4/4) > API reference for [Solana](/rpc-service/chains/chains-api/solana/). [All methods ->](/rpc-service/chains/chains-api/solana/#methods) > > Part 4 of 4: [1](/rpc-service/chains/chains-api/solana/methods-2/) · [2](/rpc-service/chains/chains-api/solana/methods-2-p2/) · [3](/rpc-service/chains/chains-api/solana/methods-2-p3/) · 4 ## `getTransactionCount` > **Returns the current Transaction count from the ledger.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional): the configuration object containing the following fields: * commitment (string; optional): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns
* ``: the count. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTransactionCount" }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": 15541529698 } ``` --- ## `getVersion` > **Returns the current solana versions running on the node.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns The `result` object contains the following parameters: * `solana-core`: the software version of solana-core. * `feature-set`: a unique identifier of the current software's feature set. ### Request parameters ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getVersion" }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "feature-set": 3294202862, "solana-core": "2.2.3" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/solana/methods-2/ title: Solana — Methods (1/4) source: docs/rpc-service/chains/chains-api/solana/methods-2.mdx --- # Solana — Methods (1/4) > API reference for [Solana](/rpc-service/chains/chains-api/solana/). [All methods ->](/rpc-service/chains/chains-api/solana/#methods) > > Part 1 of 4: 1 · [2](/rpc-service/chains/chains-api/solana/methods-2-p2/) · [3](/rpc-service/chains/chains-api/solana/methods-2-p3/) · [4](/rpc-service/chains/chains-api/solana/methods-2-p4/) ## `getMultipleAccounts` > **Returns the account information for a list of pubkeys.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: an array of Pubkeys to query, as base-58 encoded strings (up to a maximum of 100). * `` (optional): the configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `encoding` (string): encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using [Zstandard](https://facebook.github.io/zstd/) and base64-encodes the result. ["jsonParsed" encoding](https://docs.solana.com/developing/clients/jsonrpc-api#parsed-responses) attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when the `data` field is type `string`. * `dataSlice` (object): limits the returned account data using the provided `offset: ` and `length: ` fields; only available for "base58", "base64" or "base64+zstd" encodings. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns The result will be a JSON object with value equal to an array of: * `null`: if the account at that Pubkey doesn't exist. * ``: otherwise, a JSON object containing: * `lamports` (u64): the number of lamports assigned to this account, as a u64. * `owner` (string): a base-58 encoded Pubkey of the program this account has been assigned to. * `data`([string, encoding]|object): data associated with the account, either as encoded binary data or JSON format `{: }`, depending on the encoding parameter. * `executable`(boolean): a boolean indicating if the account contains a program (and is strictly read-only). * `rentEpoch` (u64): the epoch at which this account will next owe rent, as u64. ### Request example 1 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getMultipleAccounts", "params": [ [ "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA" ], { "dataSlice": { "offset": 0, "length": 0 } } ] }' ``` ### Response example 1 ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374443766 }, "value": [ { "data": [ "", "base64" ], "executable": false, "lamports": 88860054690252, "owner": "11111111111111111111111111111111", "rentEpoch": 18446744073709551615, "space": 0 }, { "data": [ "", "base64" ], "executable": false, "lamports": 7998763451, "owner": "2WRuhE4GJFoE23DYzp2ij6ZnuQ8p9mJeU6gDgfsjR4or", "rentEpoch": 18446744073709551615, "space": 0 } ] } } ``` ### Request example 2 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getMultipleAccounts", "params": [ [ "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA" ], { "encoding": "base58" } ] }' ``` ### Response example 2 ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374443852 }, "value": [ { "data": [ "", "base58" ], "executable": false, "lamports": 88860054690252, "owner": "11111111111111111111111111111111", "rentEpoch": 18446744073709551615, "space": 0 }, { "data": [ "", "base58" ], "executable": false, "lamports": 7998763451, "owner": "2WRuhE4GJFoE23DYzp2ij6ZnuQ8p9mJeU6gDgfsjR4or", "rentEpoch": 18446744073709551615, "space": 0 } ] } } ``` --- ## `getProgramAccounts` > **Returns all accounts owned by the provided program Pubkey.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the Pubkey of a program, as base-58 encoded string. * `` (optional): the configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `encoding` (string): encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using [Zstandard](https://facebook.github.io/zstd/) and base64-encodes the result. ["jsonParsed" encoding](https://docs.solana.com/developing/clients/jsonrpc-api#parsed-responses) attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when the `data` field is type `string`. * `dataSlice` (object): limits the returned account data using the provided `offset: ` and `length: ` fields; only available for "base58", "base64" or "base64+zstd" encodings. * `filters` (array): filters the results using up to 4 filter objects; the account must meet all the filter criteria to be included in results: * `memcmp` (object): compares a provided series of bytes with program account data at a particular offset. Fields: * `offset` (usize): an offset into program account data to start comparison. * `bytes` (string): the data to match, as encoded string. * `encoding` (string): an encoding for the filter bytes data, either "base58" or "base64". Data is limited in size to 128 or fewer decoded bytes. NEW: This field, and base64 support generally, is only available in solana-core v1.14.0 or newer. Please omit when querying nodes on earlier versions. * `dataSize` (u64): compares the program account data length with the provided data size * `withContext` (boolean): wraps the result in a JSON object. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns By default, the result field will be an array of JSON objects. If `withContext` flag is set, the array will be wrapped in a JSON object. * `pubkey` (string): the account Pubkey as base-58 encoded string. * `account` (object): a JSON object, with the following subfields: * `lamports` (u64): the number of lamports assigned to this account, as a u64. * `owner` (string): the base-58 encoded Pubkey of the program this account has been assigned to. * `data` ([string,encoding]|object): the data associated with the account, either as encoded binary data or JSON format `{: }`, depending on encoding parameter. * `executable` (bool): a boolean indicating if the account contains a program (and is strictly read-only). * `rentEpoch` (u64): the epoch at which this account will next owe rent, as a u64. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getProgramAccounts", "params": [ "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8", { "encoding": "base64" } ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": [ { "account": { "data": [ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "base64" ], "executable": false, "lamports": 8017920, "owner": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8", "rentEpoch": 18446744073709551615, "space": 1024 }, "pubkey": "6uSF3nNb8ZZahnLEgDjXVFWTBeS9WVMh89BiRnJKhCT8" } ], "id": 1 } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `limit` (usize; optional): the number of samples to return (max: 720). ### Returns The `result` object containing the following parameters: * `slot` (u64): the slot in which sample was taken at. * `numTransactions` (u64): the number of transactions in a sample. * `numSlots` (u64): the number of slots in a sample. * `samplePeriodSecs` (u16): the number of seconds in a sample window. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getRecentPerformanceSamples", "params": [4] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ { "numNonVoteTransactions": 4059, "numSlots": 152, "numTransactions": 6339, "samplePeriodSecs": 60, "slot": 374448056 }, { "numNonVoteTransactions": 5343, "numSlots": 150, "numTransactions": 7592, "samplePeriodSecs": 60, "slot": 374447904 }, { "numNonVoteTransactions": 5971, "numSlots": 153, "numTransactions": 8250, "samplePeriodSecs": 60, "slot": 374447754 }, { "numNonVoteTransactions": 6379, "numSlots": 155, "numTransactions": 8719, "samplePeriodSecs": 60, "slot": 374447601 } ] } ``` --- ## `getSignaturesForAddress` > **Returns signatures for confirmed transactions that include the given address in their `accountKeys` list.** Returns signatures backwards in time from the provided signature or most recent confirmed block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the account address as a base-58 encoded string. * `` (optional): the configuration object containing the following fields: * `limit` (number): the maximum transaction signatures to return (between 1 and 1,000, default: 1,000). * `before` (string): starts searching backwards from this transaction signature. If not provided the search starts from the top of the highest max confirmed block. * `until` (string): searches until this transaction signature, if found before limit reached. * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns The `result` field is an array of transaction signature information, ordered from newest to oldest transaction: * `signature` (string): the transaction signature as base-58 encoded string. * `slot` (u64): the slot that contains the block with the transaction. * `err` (object|null): Error if transaction failed, null if transaction succeeded. See the [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13). * `memo` (string|null): the memo associated with the transaction, null if there is no memo. * `blockTime` (i64|null): estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available. * `confirmationStatus` (string|null): the transaction's cluster confirmation status; either processed, confirmed, or finalized. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getSignaturesForAddress", "params": [ "Vote111111111111111111111111111111111111111", { "limit": 1 } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ { "blockTime": 1744731098, "confirmationStatus": "finalized", "err": null, "memo": null, "signature": "3wG35yPiT69tZSJRQJ9VTsU9dNR6nd4sQkU7FSyK5cc9Fpt7DXrvYSwbLLBuEo4Sz7DNwSGmTc5bx5mf3MSjZcNN", "slot": 374448329 } ] } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: an array of transaction signatures to confirm, as base-58 encoded strings (up to a maximum of 256). * `` (optional): the object containing the following field: * `searchTransactionHistory` (boolean): if `true`, a Solana node will search its ledger cache for any signatures not found in the recent status cache. ### Returns
* `null`: an unknown transaction. * ``: a known transaction; contains the following parameters: * `slot` (u64): the slot the transaction was processed at. * `confirmations` (usize|null): the number of blocks since signature confirmation, null if rooted, as well as finalized by a supermajority of the cluster. * `err` (object|null): Error if transaction failed, null if transaction succeeded. See the [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13). * `confirmationStatus` (string|null): the transaction's cluster confirmation status; either `processed`, `confirmed`, or `finalized`. * [DEPRECATED] `status` (object): the transaction status: * `"Ok": `: the transaction was successful. * `"Err": `: the transaction failed with `TransactionError`. ### Request example 1 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getSignatureStatuses", "params": [ [ "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW", "5j7s6NiJS3JAkvgkoc18WVAsiSaci2pxB2A6ueCJP4tprA2TFg9wSyTLeYouxPBJEMzJinENTkpA52YStRW5Dia7" ] ] }' ``` ### Response example 1 ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374449074 }, "value": [ null, null ] } } ``` ### Request example 2 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getSignatureStatuses", "params": [ [ "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW" ], { "searchTransactionHistory": true } ] }' ``` ### Response example 2 ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374449161 }, "value": [ null ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/solana/methods-3/ title: Solana — Methods source: docs/rpc-service/chains/chains-api/solana/methods-3.mdx --- # Solana — Methods > API reference for [Solana](/rpc-service/chains/chains-api/solana/). [All methods ->](/rpc-service/chains/chains-api/solana/#methods) ## `getVoteAccounts` > **Returns the account info and associated stake for all the voting accounts in the current bank.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional): the configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `votePubkey` (string): only returns the results for this validator vote address (base-58 encoded). * `keepUnstakedDelinquents` (boolean): set to `true` to not filter out delinquent validators with no stake. * `delinquentSlotDistance` (u64): specify the number of slots behind the tip that a validator must fall to be considered delinquent. NOTE: For the sake of consistency between ecosystem products, it is not recommended that this argument be specified. ### Returns The result field will be a JSON object of `current` and `delinquent` accounts, each containing an array of JSON objects with the following subfields: * `votePubkey` (string): the vote account address, as base-58 encoded string. * `nodePubkey` (string): the validator identity, as base-58 encoded string. * `activatedStake` (u64): the stake, in lamports, delegated to this vote account and active in this epoch. * `epochVoteAccount` (boolean): `true` if the vote account is staked for this epoch, otherwise `false`. * `commission` (number): the percentage (0-100) of rewards payout owed to the vote account. * `lastVote` (u64): the most recent slot voted on by this vote account. * `epochCredits` (array): the history of how many credits earned by the end of each epoch, as an array of arrays containing: `[epoch, credits, previousCredits]`. ### Request example 1 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getVoteAccounts" }' ``` ### Response example 1 ```json { "jsonrpc": "2.0", "result": { "current": [ { "activatedStake": 2364534867609880, "commission": 100, "epochCredits": [ [ 863, 931848333, 924939069 ], [ 864, 938750237, 931848333 ], [ 865, 945661181, 938750237 ], [ 866, 952567578, 945661181 ], [ 867, 953877279, 952567578 ] ], "epochVoteAccount": true, "lastVote": 374626126, "nodePubkey": "Cw6X5R68muAyGRCb7W8ZSP2YbaRjwMs1t5sBEPkhdwbM", "rootSlot": 374626095, "votePubkey": "7AETLyAGJWjp6AWzZqZcP362yv5LQ3nLEdwnXNjdNwwF" } ] }, "id": 1 } ``` ### Request example 2 Restricts the results to a single validator vote account. ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getVoteAccounts", "params": [ { "votePubkey": "BZxzPVaLuAp2JUzR9gbtbrv47qYdSdRQfBWzatxPVjcD" } ] }' ``` ### Response example 2 ```json { "id": 1, "jsonrpc": "2.0", "result": { "current": [], "delinquent": [ { "activatedStake": 1997717120, "commission": 100, "epochCredits": [ [ 851, 13346414, 6438750 ], [ 852, 18873026, 13346414 ], [ 853, 23618152, 18873026 ], [ 854, 29813698, 23618152 ], [ 855, 33504018, 29813698 ] ], "epochVoteAccount": true, "lastVote": 369591011, "nodePubkey": "9AyV9DykRupCenmHzvFckXLa2Hg8kvG61c6yX215EZCm", "rootSlot": 369590980, "votePubkey": "BZxzPVaLuAp2JUzR9gbtbrv47qYdSdRQfBWzatxPVjcD" } ] } } ``` --- ## `isBlockhashValid` :::tip NEW: This method is only available in solana-core v1.9 or newer. Please use [`getFeeCalculatorForBlockhash`](/rpc-service/chains/chains-api/solana/#getfeecalculatorforblockhash-deprecated) for solana-core v1.8 ::: > **Returns whether a blockhash is still valid or not.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `blockhash` (string; required): the blockhash of this block, as base-58 encoded string. * `` (optional): the configuration object containing the following fields: * `commitment` (string): used for retrieving blockhash; the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns
* ``: returns `true` if the blockhash is still valid. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "id":45, "jsonrpc":"2.0", "method":"isBlockhashValid", "params":[ "Fv8Be2iVvuSbWr3M5krNf5UT4TwwwtyY14jHBZXiatdv", {"commitment": "processed"} ] }' ``` ### Response example ```json { "id": 45, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374626674 }, "value": false } } ``` --- ## `minimumLedgerSlot` > **Returns the lowest slot that the node has information about in its ledger.** This value may increase over time if the node is configured to purge older ledger data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the minimum ledger slot. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "id":45, "jsonrpc":"2.0", "method":"minimumLedgerSlot" }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": 370994242, "id": 45 } ``` --- ## `requestAirdrop` > **Requests an airdrop of lamports to a Pubkey.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the Pubkey of the account to receive lamports, as base-58 encoded string. * `integer` (required): lamports, as a u64. * `object` (optional): the configuration object containing the following field: * `commitment` (string): used for retrieving blockhash and verifying airdrop success; the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. ### Returns
* ``: the Transaction Signature of airdrop, as base-58 encoded string. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "requestAirdrop", "params": [ "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri", 1000000000 ] }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "4fv3RBynFREuU71Ajt9GyyiBJ7NKa9NmATmzdyKojdaGC111NfZBni1CJ5pb3AtnryqdjaVKWF9f1wp1d4gwoki5", "id": 1 } ``` --- ## `sendTransaction` > **Submits a signed transaction to the cluster for processing.** This method does not alter the transaction in any way; it relays the transaction created by clients to the node as-is. If the node's rpc service receives the transaction, this method immediately succeeds, without waiting for any confirmations. A successful response from this method does not guarantee the transaction is processed or confirmed by the cluster. While the rpc service will reasonably retry to submit it, the transaction could be rejected if transaction's `recent_blockhash` expires before it lands. Use [`getSignatureStatuses`](/rpc-service/chains/chains-api/solana/methods-2/#getsignaturestatuses) to ensure a transaction is processed and confirmed. Before submitting, the following preflight checks are performed: 1. The transaction signatures are verified. 2. The transaction is simulated against the bank slot specified by the preflight commitment. On failure an error will be returned. Preflight checks may be disabled if desired. It is recommended to specify the same commitment and preflight commitment to avoid confusing behavior. The returned signature is the first signature in the transaction, which is used to identify the transaction ([transaction id](https://docs.solana.com/terminology#transaction-id)). This identifier can be easily extracted from the transaction data before submission. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): a fully-signed Transaction, as encoded string. * `` (optional): the configuration object containing the following fields: * `skipPreflight` (boolean): if `true`, skip the preflight transaction checks (default: `false`). * `preflightCommitment` (string; default: "finalized"): a commitment level to use for preflight. The commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `encoding` (string; default: "base58"): the encoding used for the transaction data. Either "base58" (slow, DEPRECATED), or "base64". * `maxRetries` (usize): the maximum number of times for the RPC node to retry sending the transaction to the leader. If this parameter not provided, the RPC node will retry the transaction until it is finalized or until the blockhash expires. * `minContextSlot` (number): sets the minimum slot at which to perform preflight transaction checks. ### Returns
* ``: the first Transaction Signature embedded in the transaction, as base-58 encoded string ([transaction id](https://docs.solana.com/terminology#transaction-id)). ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sendTransaction", "params": ["4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFggS8w9snUts67BSh3EqKpXLUm5UMHfD7ZBe9GhARjbNQMLJ1QD3Spr6oMTBU6EhdB4RD8CP2xUxr2u3d6fos36PD98XS6oX8TQjLpsMwncs5DAMiD4nNnR8NBfyghGCWvCVifVwvA8B8TJxE1aiyiv2L429BCWfyzAme5sZW8rDb14NeCQHhZbtNqfXhcp2tAnaAT"] }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "2id3YC2jK9G5Wo2phDx4gJVAew8DcY5NAojnVuao8rkxwPYPe8cSwE5GzhEgJA2y8fVjDEo6iR6ykBvDxrTQrtpb", "id": 1 } ``` --- ## `simulateTransaction` > **Simulates sending a transaction.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the transaction, as an encoded string. The transaction must have a valid blockhash, but is not required to be signed. * `` (optional): the configuration object containing the following fields: * `sigVerify` (boolean): if `true` the transaction signatures will be verified (default: `false`, conflicts with `replaceRecentBlockhash`). * `commitment` (string; default: "finalized"): a commitment level to simulate the transaction at. The commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `encoding` (string; default: "base58"): the encoding used for the transaction data. Either "base58" (slow, DEPRECATED), or "base64". * `replaceRecentBlockhash` (boolean): if `true` the transaction recent blockhash will be replaced with the most recent blockhash. (default: `false`, conflicts with `sigVerify`). * `accounts` (object): the accounts configuration object containing the following fields: * `encoding` (string): encoding for returned Account data, either "base64" (default), "base64+zstd" or "jsonParsed". ["jsonParsed" encoding](https://docs.solana.com/developing/clients/jsonrpc-api#parsed-responses) attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to binary encoding, detectable when the `data` field is type ``. * `addresses` (array): an array of accounts to return, as base-58 encoded strings. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns The result will be a JSON object with the `value` containing the following fields: * `err` (object|string|null): Error if transaction failed, null if transaction succeeded. See the [TransactionError](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13) definitions. * `logs` (array|null): an array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure). * `accounts` (array|null): an array of accounts with the same length as the `accounts.addresses` array in the request: * ``: if the account doesn't exist or if `err` is not null. * ``: otherwise, a JSON object containing: * `lamports` (u64): the number of lamports assigned to this account, as a u64. * `owner` (string): the base-58 encoded Pubkey of the program this account has been assigned to. * `data` ([string, encoding]|object): the data associated with the account, either as encoded binary data or JSON format `{: }`, depending on encoding parameter. * `executable` (boolean): a boolean indicating if the account contains a program (and is strictly read-only). * `rentEpoch` (u64): the epoch at which this account will next owe rent, as u64. * `unitsConsumed` (u64|undefined): the number of compute budget units consumed during the processing of this transaction. * `returnData` (object|null): the most-recent return data generated by an instruction in the transaction, with the following fields: * `programId` (string): the program that generated the return data, as base-58 encoded Pubkey. * `data` ([string, encoding]): the return data itself, as base-64 encoded binary data. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "simulateTransaction", "params": ["AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=", { "encoding": "base64" } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374627777 }, "value": { "accounts": null, "err": "BlockhashNotFound", "innerInstructions": null, "logs": [], "replacementBlockhash": null, "returnData": null, "unitsConsumed": 0 } } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/solana/methods-p2/ title: Solana — Methods (2/4) source: docs/rpc-service/chains/chains-api/solana/methods-p2.mdx --- # Solana — Methods (2/4) > API reference for [Solana](/rpc-service/chains/chains-api/solana/). [All methods ->](/rpc-service/chains/chains-api/solana/#methods) > > Part 2 of 4: [1](/rpc-service/chains/chains-api/solana/methods/) · 2 · [3](/rpc-service/chains/chains-api/solana/methods-p3/) · [4](/rpc-service/chains/chains-api/solana/methods-p4/) ## `getBlockHeight` > **Returns the current block height of the node.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional): configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns
* ``: a current block height. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getBlockHeight", "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": 362409082, "id": 1 } ``` --- ## `getBlockProduction` > **Returns recent block production information from the current or previous epoch.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional): configuration object containing the following optional fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `range` (object): a slot range to return block production for. If parameter not provided, defaults to current epoch: * `firstSlot` (u64): the first slot to return block production information for (inclusive). * `lastSlot` (u64): the last slot to return block production information for (inclusive). If parameter not provided, defaults to the highest slot. * `identity` (string): only return results for this validator identity (base-58 encoded). ### Returns
* `value` (object): the value containing the following parameters: * `byIdentity` (object): a dictionary of validator identities, as base-58 encoded strings. Value is a two element array containing the number of leader slots and the number of blocks produced. * `range` (object): a block production slot range: * `firstSlot` (u64): the first slot of the block production information (inclusive). * `lastSlot` (u64): the last slot of block production information (inclusive). ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getBlockProduction", "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374432777 }, "value": { "byIdentity": { "3zvXem8vqvDYos6BKu66FV84tmDdQwgLxYSempy8tSrs": [ 984, 984 ], "4mdQGkbfrFvo5eG722xCXik4hn3xzu2EJD47g7Hd4HfH": [ 16, 16 ], "97YUjL2EK42M6jG5VA4fKuVxGXDfxsC5Zawd9haLQJGk": [ 200, 200 ] }, "range": { "firstSlot": 374112000, "lastSlot": 374432777 } } } } ``` --- ## `getBlockCommitment` > **Returns commitment for particular block.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (required): the block identified by slot. ### Returns
* `commitment`: a commitment, comprising either: * `null`: an unknown block. * ``: a commitment, 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` + 1. * `totalStake`: a total active stake, in lamports, of the current epoch. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getBlockCommitment", "params": [5], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "commitment": null, "totalStake": 157766894165168736 } } ``` --- ## `getBlocks` > **Returns a list of confirmed blocks between two slots.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: `start_slot`, as a u64 integer. * ``: `end_slot`, as u64 integer (must be no more than 500,000 blocks higher than the `start_slot`). * ``: a configuration object containing the following field: * `commitment` (string; default: "finalized"): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. ### Returns The result field will be an array of u64 integers listing confirmed blocks between `start_slot` and either `end_slot`, if provided, or latest confirmed block, inclusive. Max range allowed is 500,000 slots. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getBlocks", "params": [374434259, 374434262], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ 374434259, 374434260, 374434261, 374434262 ] } ``` --- ## `getBlocksWithLimit` > **Returns a list of confirmed blocks starting at the given slot.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: `start_slot`, as u64 integer. * ``: limit, as u64 integer (must be no more than 500,000 blocks higher than the `start_slot`). * `` (optional): a configuration object containing the following field: * `commitment` (string; default: "finalized"): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. ### Returns The result field will be an array of u64 integers listing confirmed blocks starting at `start_slot` for up to `limit` blocks, inclusive. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getBlocksWithLimit", "params": [370778924, 3], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ 370779536, 370779537, 370779538 ] } ``` --- ## `getBlockTime` > **Returns the estimated production time of a block.** Each validator reports their UTC time to the ledger on a regular interval by intermittently adding a timestamp to a Vote for a particular block. A requested block's time is calculated from the stake-weighted mean of the Vote timestamps in a set of recent blocks recorded on the ledger. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the block identified by slot. ### Returns
* ``: estimated production time, as Unix timestamp (seconds since the Unix epoch). * `null`: the timestamp is not available for this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getBlockTime", "params": [374436187], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": 1744726372, "id": 1 } ``` --- ## `getClusterNodes` > **Returns information about all the nodes participating in the cluster.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns The result field will be an array of JSON objects, each with the following subfields: * `pubkey` (string): the node public key, as base-58 encoded string. * `gossip` (string|null): a gossip network address for the node. * `tpu` (string|null): a TPU network address for the node. * `rpc` (string|null): a JSON RPC network address for the node, or null if the JSON RPC service is not enabled. * `version` (string|null): the software version of the node, or null if the version information is not available. * `featureSet` (u32|null): the unique identifier of the node's feature set. * `shredVersion` (u16|null): the shred version the node has been configured to use. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getClusterNodes", "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": [ { "featureSet": 3294202862, "gossip": "63.251.106.87:21810", "pubkey": "DiwJZxYKQbWBn59EhUhkiB3hM1TLWiQoGvD5mpUHJscu", "pubsub": "63.251.106.87:21812", "rpc": "63.251.106.87:21811", "serveRepair": "63.251.106.87:11812", "shredVersion": 2405, "tpu": "63.251.106.87:11803", "tpuForwards": "63.251.106.87:11804", "tpuForwardsQuic": "63.251.106.87:11810", "tpuQuic": "63.251.106.87:11809", "tpuVote": "63.251.106.87:11805", "tvu": "63.251.106.87:11801", "version": "2.2.3" } ], "id": 1 } ``` --- ## `getEpochInfo` > **Returns information about the current epoch.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional): configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns The result field will be an object with the following fields: * `absoluteSlot` (u64): the current slot. * `blockHeight` (u64): the current block height. * `epoch` (u64): the current epoch. * `slotIndex` (u64): the current slot relative to the start of the current epoch. * `slotsInEpoch` (u64): the number of slots in this epoch. * `transactionCount` (u64|null) total number of transactions processed without error since genesis. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getEpochInfo", "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "absoluteSlot": 374436745, "blockHeight": 362413120, "epoch": 866, "slotIndex": 324745, "slotsInEpoch": 432000, "transactionCount": 15534671467 } } ``` --- ## `getEpochSchedule` > **Returns epoch schedule information from this cluster's genesis config.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns The result is an object containing the following parameters: * `slotsPerEpoch` (u64): the maximum number of slots in each epoch. * `leaderScheduleSlotOffset` (u64): the number of slots before beginning of an epoch to calculate a leader schedule for that epoch. * `warmup` (boolean): whether epochs start short and grow. * `firstNormalEpoch` (u64): the first normal-length epoch, log2(slotsPerEpoch) - log2(MINIMUM_SLOTS_PER_EPOCH). * `firstNormalSlot` (u64): MINIMUM_SLOTS_PER_EPOCH * (2.pow(firstNormalEpoch) - 1). ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getEpochSchedule", "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "firstNormalEpoch": 0, "firstNormalSlot": 0, "leaderScheduleSlotOffset": 432000, "slotsPerEpoch": 432000, "warmup": false } } ``` --- ## `getFeeForMessage` > **Returns the fee the network will charge for a particular message.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `message` (string, required): a base-64 encoded message. * `` (optional): a configuration object containing the following optional fields: * `commitment` (string): used for retrieving blockhash; the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `minContextSlot` (number; optional): sets the minimum slot that the request can be evaluated at. ### Returns * ``: the fee corresponding to the message at the specified blockhash. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getFeeForMessage", "params":[ "AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA", { "commitment": "processed" } ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374437860 }, "value": null } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/solana/methods-p3/ title: Solana — Methods (3/4) source: docs/rpc-service/chains/chains-api/solana/methods-p3.mdx --- # Solana — Methods (3/4) > API reference for [Solana](/rpc-service/chains/chains-api/solana/). [All methods ->](/rpc-service/chains/chains-api/solana/#methods) > > Part 3 of 4: [1](/rpc-service/chains/chains-api/solana/methods/) · [2](/rpc-service/chains/chains-api/solana/methods-p2/) · 3 · [4](/rpc-service/chains/chains-api/solana/methods-p4/) ## `getFirstAvailableBlock` > **Returns the slot of the lowest confirmed block that has not been purged from the ledger.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: a slot. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getFirstAvailableBlock", "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": 370779475, "id": 1 } ``` --- ## `getGenesisHash` > **Returns the genesis hash.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the hash as base-58 encoded string. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getGenesisHash", "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG", "id": 1 } ``` --- ## `getHealth` > **Returns the current health of the node.** If one or more `--known-validator` arguments are provided to `solana-validator`, "ok" is returned when the node has within `HEALTH_CHECK_SLOT_DISTANCE` slots of the highest known validator, otherwise an error is returned. "ok" is always returned if no known validators are provided. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns If the node is healthy: "ok" If the node is unhealthy, a JSON RPC error response is returned. The specifics of the error response are UNSTABLE and may change in the future. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getHealth", "id": 1 }' ``` ### Response example (healthy) ```json { "jsonrpc": "2.0", "result": "ok", "id": 1 } ``` ### Response example (unhealthy) ```json { "jsonrpc": "2.0", "error": { "code": -32005, "message": "Node is unhealthy", "data": {} }, "id": 1 } ``` ### Response example (unhealthy; additional info) ```json { "jsonrpc": "2.0", "error": { "code": -32005, "message": "Node is behind by 42 slots", "data": { "numSlotsBehind": 42 } }, "id": 1 } ``` --- ## `getHighestSnapshotSlot` :::tip NEW: This method is only available in solana-core v1.9 or newer. Please use [`getSnapshotSlot`](/rpc-service/chains/chains-api/solana/#getsnapshotslot) for solana-core v1.8 ::: > **Returns the highest slot information that the node has snapshots 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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: * `full` (u64): the highest full snapshot slot. * `incremental` (u64|undefined): the highest incremental snapshot slot based on `full`. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getHighestSnapshotSlot", "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "full": 374423617, "incremental": 374438029 } } ``` ### Response example (no snapshot) ```json { "jsonrpc": "2.0", "error": { "code": -32008, "message": "No snapshot" }, "id": 1 } ``` --- ## `getIdentity` > **Returns the identity pubkey for the current node.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns The `result` parameter containing the following field: * `identity` (base-58 encoded string): the identity pubkey of the current node. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getIdentity", "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "identity": "6ZaNrpjNZMmtAaZ4Tjj7GhmgbqpRR9vnipoCgwqjCHR5" } } ``` --- ## `getInflationGovernor` > **Returns the current inflation governor.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional): the configuration object containing the following field: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. ### Returns
* `initial` (f64): the initial inflation percentage from time 0. * `terminal` (f64): the terminal inflation percentage. * `taper` (f64): the rate per year at which inflation is lowered. Rate reduction is derived using the target slot time in genesis config. * `foundation` (f64): the percentage of total inflation allocated to the foundation. * `foundationTerm` (f64): the duration of foundation pool inflation in years. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getInflationGovernor", "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "foundation": 0.0, "foundationTerm": 0.0, "initial": 0.08, "taper": 0.15, "terminal": 0.015 } } ``` --- ## `getInflationRate` > **Returns the specific inflation values for the current epoch.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `total` (f64): the total inflation. * `validator` (f64): the inflation allocated to validators. * `foundation` (f64): the inflation allocated to the foundation. * `epoch` (u64): the epoch for which these values are valid. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getInflationRate", "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "epoch": 866, "foundation": 0.0, "total": 0.03846001179398413, "validator": 0.03846001179398413 } } ``` --- ## `getInflationReward` > **Returns the inflation / staking reward for a list of addresses for an epoch.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: an array of addresses to query, as base-58 encoded strings: * `` (optional): the configuration object containing the following fields: * commitment (string; optional): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `epoch` (u64; optional): an epoch for which the reward occurs. If omitted, the previous epoch will be used. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns
* `epoch` (u64): the epoch for which reward occurred. * `effectiveSlot`(u64): the slot in which the rewards are effective * `amount` (u64): the reward amount in lamports. * `postBalance` (u64): the post balance of the account in lamports. * `commission` (u8|undefined): the vote account commission when the reward was credited. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getInflationReward", "params": [["vgcDar2pryHvMgPkKaZfh8pQy4BJxv7SpwUG7zinWjG"], {"epoch": 865}], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ { "amount": 62104278891217, "commission": 95, "effectiveSlot": 374112000, "epoch": 865, "postBalance": 10748380652807189 } ] } ``` --- ## `getLargestAccounts` > **Returns the 20 largest accounts, by lamport balance (results may be cached up to two hours).** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional): the configuration object containing the following optional fields: * commitment (string; optional): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `filter` (string; optional): filters results by account type; currently supported: `circulating`|`nonCirculating`. ### Returns The result will be a JSON object with value equal to an array of: * ``: a JSON object containing the following fields: * `address` (string): the base-58 encoded address of the account. * `lamports` (u64): the number of lamports in the account, as a u64. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getLargestAccounts", "params": [ { "filter": "nonCirculating" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": [ { "lamports": 999999990000000000, "address": "11111111111111111111111111111111" }, { "lamports": 854321560000000000, "address": "SysvarC1ock11111111111111111111111111111111" }, { "lamports": 732000000000000000, "address": "Stake11111111111111111111111111111111111111" }, { "lamports": 690000000000000000, "address": "Vote111111111111111111111111111111111111111" }, { "lamports": 540000000000000000, "address": "NativeLoader1111111111111111111111111111111" }, { "lamports": 500000000000000000, "address": "Config1111111111111111111111111111111111111" } ], "id": 1 } ``` --- ## `getLatestBlockhash` :::tip NEW: This method is only available in solana-core v1.9 or newer. Please use [`getRecentBlockhash`](/rpc-service/chains/chains-api/solana/#getrecentblockhash) for solana-core v1.8 ::: > **Returns the latest blockhash.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional): the configuration object containing the following fields: * `commitment` (string; optional): used for retrieving blockhash); the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `minContextSlot` (number; optional): sets the minimum slot that the request can be evaluated at. ### Returns
* ``: a JSON object with value field set to a JSON object including: * `blockhash` (string): a hash as base-58 encoded string. * `lastValidBlockHeight` (u64): the last block height at which the blockhash will be valid. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getLatestBlockhash", "params": [ { "commitment": "processed" } ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374442143 }, "value": { "blockhash": "5SVbJEwUwvS2PmGSMKcshCanrCnYcDBEpCp3aR7up6GV", "lastValidBlockHeight": 362418664 } } } ``` --- ## `getLeaderSchedule` > **Returns the leader schedule for an epoch.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (optional): fetches the leader schedule for the epoch that corresponds to the provided slot. If unspecified, fetches the leader schedule for the current epoch. * `` (optional): the configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `identity` (string): returns only the results for this validator identity (base-58 encoded). ### Returns
* `null`: if requested epoch is not found. * ``: otherwise, the result field will be a dictionary of validator identities, as base-58 encoded strings, and their corresponding leader slot indices as values (indices are relative to the first slot in the requested epoch). ### Request example 1 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getLeaderSchedule", "params": [374442395], "id": 1 }' ``` ### Response example 1 ```json { "jsonrpc": "2.0", "result": { "3zvXem8vqvDYos6BKu66FV84tmDdQwgLxYSempy8tSrs": [ 2576, 2577, 2578, 2579, 3448, 3449, 3450 ] }, "id": 1 } ``` ### Request example 2 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getLeaderSchedule", "params": [ null, { "identity": "dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS" } ], "id": 1 }' ``` ### Response example 2 ```json { "jsonrpc": "2.0", "result": { "dv3qDFk1DTF36Z62bNvrCXe9sKATA6xvVy6A798xxAS": [ 12, 13, 14, 15, 32, 33, 34, 35, 44, 45, 46, 47 ] }, "id": 1 } ``` --- ## `getMaxRetransmitSlot` > **Returns the max slot seen from retransmit stage.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the slot. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getMaxRetransmitSlot", "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": 374443337, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/solana/methods-p4/ title: Solana — Methods (4/4) source: docs/rpc-service/chains/chains-api/solana/methods-p4.mdx --- # Solana — Methods (4/4) > API reference for [Solana](/rpc-service/chains/chains-api/solana/). [All methods ->](/rpc-service/chains/chains-api/solana/#methods) > > Part 4 of 4: [1](/rpc-service/chains/chains-api/solana/methods/) · [2](/rpc-service/chains/chains-api/solana/methods-p2/) · [3](/rpc-service/chains/chains-api/solana/methods-p3/) · 4 ## `getMaxShredInsertSlot` Returns the max slot seen from after shred insert. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the slot. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getMaxShredInsertSlot", "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": 374443465, "id": 1 } ``` --- ## `getMinimumBalanceForRentExemption` > **Returns minimum balance required to make account rent exempt.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the account data length. * `` (optional): the configuration object containing the following field: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. ### Returns
* ``: the minimum lamports required in an account. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getMinimumBalanceForRentExemption", "params": [50], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": 1238880, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/solana/methods/ title: Solana — Methods (1/4) source: docs/rpc-service/chains/chains-api/solana/methods.mdx --- # Solana — Methods (1/4) > API reference for [Solana](/rpc-service/chains/chains-api/solana/). [All methods ->](/rpc-service/chains/chains-api/solana/#methods) > > Part 1 of 4: 1 · [2](/rpc-service/chains/chains-api/solana/methods-p2/) · [3](/rpc-service/chains/chains-api/solana/methods-p3/) · [4](/rpc-service/chains/chains-api/solana/methods-p4/) ## `getAccountInfo` > **Returns all information associated with the account of provided Pubkey.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: pubkey of account to query, as base-58 encoded string. * `` (optional): configuration object containing the following fields: * `commitment` (string): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `encoding` (string): encoding for Account data, either "base58" (slow), "base64", "base64+zstd", or "jsonParsed". "base58" is limited to Account data of less than 129 bytes. "base64" will return base64 encoded data for Account data of any size. "base64+zstd" compresses the Account data using [Zstandard](https://facebook.github.io/zstd/) and base64-encodes the result. ["jsonParsed" encoding](https://docs.solana.com/developing/clients/jsonrpc-api#parsed-responses) attempts to use program-specific state parsers to return more human-readable and explicit account state data. If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding, detectable when the `data` field is type `string`. * `dataSlice` (object): limit the returned account data using the provided `offset: ` and `length: ` fields; only available for "base58", "base64" or "base64+zstd" encodings. * `minContextSlot` (number): sets the minimum slot that the request can be evaluated at. ### Returns
* ``: if the requested account doesn't exist. * ``: otherwise a JSON object containing: * `lamports` (u64): number of lamports assigned to this account, as a u64. * `owner` (string): base-58 encoded Pubkey of the program this account has been assigned to. * `data` ([string, encoding]|object): data associated with the account, either as encoded binary data or JSON format `{: }`, depending on the encoding parameter. * `executable` (boolean): boolean indicating if the account contains a program (and is strictly read-only). * `rentEpoch` (u64): the epoch at which this account will next owe rent, as u64. ### Request example 1 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getAccountInfo", "params": [ "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", { "encoding": "base58" } ], "id": 1 }' ``` ### Response example 1 ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374431575 }, "value": { "data": [ "", "base58" ], "executable": false, "lamports": 88860054690252, "owner": "11111111111111111111111111111111", "rentEpoch": 18446744073709551615, "space": 0 } } } ``` ### Request example 2 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getAccountInfo", "params": [ "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA", { "encoding": "jsonParsed" } ], "id": 1 }' ``` ### Response example 2 ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374431699 }, "value": { "data": [ "", "base64" ], "executable": false, "lamports": 7998763451, "owner": "2WRuhE4GJFoE23DYzp2ij6ZnuQ8p9mJeU6gDgfsjR4or", "rentEpoch": 18446744073709551615, "space": 0 } } } ``` --- ## `getBalance` > **Returns the balance of the account of provided Pubkey.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: pubkey of account to query, as base-58 encoded string. * ``: configuration object containing the following fields: * `commitment` (string; optional): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `processed`: the node will query its most recent block. Note that the block may still be skipped by the cluster. * `minContextSlot` (number; optional): sets the minimum slot that the request can be evaluated at. ### Returns
* `value` (u64): an account balance. ### Request example ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getBalance", "params": [ "4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374431850 }, "value": 7998763451 } } ``` --- ## `getBlock` > **Returns identity and transaction information about a confirmed block in the ledger.** ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: slot, as a u64 integer. * `` (optional): configuration object containing the following optional fields: * `encoding` (string): encoding for each returned Transaction, either "json", "jsonParsed", "base58" (slow), "base64". If parameter not provided, the default encoding is "json". ["jsonParsed" encoding](https://docs.solana.com/developing/clients/jsonrpc-api#parsed-responses) attempts to use program-specific instruction parsers to return more human-readable and explicit data in the `transaction.message.instructions` list. If "jsonParsed" is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (`accounts`, `data`, and `programIdIndex` fields). * `transactionDetails` (string): level of transaction detail to return, either "full", "accounts", "signatures", or "none". If parameter not provided, the default detail level is "full". If "accounts" are requested, transaction details only include signatures and an annotated list of accounts in each transaction. Transaction metadata is limited to only: fee, err, pre_balances, post_balances, pre_token_balances, and post_token_balances. * `rewards` (boolean): whether to populate the `rewards` array. If parameter not provided, the default includes rewards. * `commitment` (string; default: "finalized"): the commitment describes how finalized a block is at that point in time. When querying the ledger state, it's recommended to use lower levels of commitment to report progress and higher levels to ensure the state will not be rolled back. For processing many dependent transactions in series, it's recommended to use "confirmed" commitment, which balances speed with rollback safety. For total safety, it's recommended to use "finalized" commitment: * `finalized`: the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized. * `confirmed`: the node will query the most recent block that has been voted on by supermajority of the cluster. * it incorporates votes from gossip and replay. * it does not count votes on descendants of a block, only direct votes on that block. * this confirmation level also upholds "optimistic confirmation" guarantees in release 1.3 and onwards. * `maxSupportedTransactionVersion` (number): sets the max transaction version to return in responses. 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 the error. ### Returns
* ``: if specified block is not confirmed. * ``: if block is confirmed, an object with the following fields: * `blockhash` (string): the blockhash of this block, as base-58 encoded string. * `previousBlockhash` (string): the blockhash of this block's parent, as base-58 encoded string; if the parent block is not available due to ledger cleanup, this field will return "11111111111111111111111111111111". * `parentSlot` (u64): the slot index of this block's parent. * `transactions` (array): to be included if "full" transaction details are requested; an array of JSON objects containing: * `transaction` (object|[string,encoding]): a [transaction object](https://docs.solana.com/developing/clients/jsonrpc-api#transaction-structure), either in JSON format or encoded binary data, depending on encoding parameter. * `meta` (object): a transaction status metadata object, containing `null` or: * `err` (object|null): an error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13). * `fee` (u64): a fee this transaction was charged with, as u64 integer. * `preBalances` (array): an array of u64 account balances from before the transaction was processed. * `postBalances` (array): an array of u64 account balances after the transaction was processed. * `innerInstructions` (array|null): the list of [inner instructions](https://docs.solana.com/developing/clients/jsonrpc-api#inner-instructions-structure) or null if inner instruction recording was not enabled during this transaction. * `preTokenBalances` (array|undefined): the list of [token balances](https://docs.solana.com/developing/clients/jsonrpc-api#token-balances-structure) from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction. * `postTokenBalances` (array|undefined): the list of [token balances](https://docs.solana.com/developing/clients/jsonrpc-api#token-balances-structure) from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction. * `logMessages` (array|null): an array of string log messages or `null` if log message recording was not enabled during this transaction. * `rewards` (array|null): transaction-level rewards, populated if rewards are requested; an array of JSON objects containing: * `pubkey` (string): the public key, as base-58 encoded string, of the account that received the reward. * `lamports` (i64): the number of reward lamports credited or debited by the account, as an i64. * `postBalance` (u64): an account balance in lamports after the reward was applied. * `rewardType` (string|undefined): the type of reward: "fee", "rent", "voting", "staking". * `commission` (u8|undefined): a vote account commission when the reward was credited, only present for voting and staking rewards. * [DEPRECATED] `status` (object): a transaction status: * `"Ok": `: a transaction was successful. * `"Err": `: a transaction failed with TransactionError. * `loadedAddresses` (object|undefined): transaction addresses loaded from address lookup tables. Undefined if `maxSupportedTransactionVersion` is not set in request params: * `writable` (array[string]): an ordered list of base-58 encoded addresses for writable loaded accounts. * `readonly` (array[string]): an ordered list of base-58 encoded addresses for readonly loaded accounts. * `returnData` (object|undefined): the most-recent return data generated by an instruction in the transaction, with the following fields: * `programId` (string): the program that generated the return data, as base-58 encoded Pubkey. * `data` (string, encoding): the return data itself, as base-64 encoded binary data. * `computeUnitsConsumed` (u64|undefined): the number of [compute units](https://docs.solana.com/developing/programming-model/runtime#compute-budget) consumed by the transaction. * `version` ("legacy"|number|undefined): a transaction version; undefined if `maxSupportedTransactionVersion` is not set in request params. * `signatures` (array): to be included if "signatures" are requested for transaction details; an array of signatures strings, corresponding to the transaction order in the block. * `rewards` (array|undefined): block-level rewards, present if rewards are requested; an array of JSON objects containing: * `pubkey` (string): the public key, as base-58 encoded string, of the account that received the reward. * `lamports` (i64): the number of reward lamports credited or debited by the account, as an i64. * `postBalance` (u64): an account balance in lamports after the reward was applied. * `rewardType` (string|undefined): the type of reward: "fee", "rent", "voting", "staking". * `commission` (u8|undefined): the vote account commission when the reward was credited, included for voting and staking rewards only. * `blockTime` (i64|null): estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available. * `blockHeight` (u64|null): the number of blocks beneath this block. ### Request example 1 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getBlock", "params": [370774640, {"encoding": "json","maxSupportedTransactionVersion":0,"transactionDetails":"full","rewards":false}], "id": 1 }' ``` ### Response example 1 ```json { "jsonrpc": "2.0", "result": { "blockHeight": 358752908, "blockTime": 1743307608, "blockhash": "HF4FCaWTHZqoTSqeZS5xtqfvKB3crSHgqugWCC2CrF6N", "parentSlot": 370774639, "previousBlockhash": "2f1r7z58nr7HX92YDko28wAHTyWAHYvmDHfVjSApvw7T", "transactions": [ { "meta": { "computeUnitsConsumed": 150, "err": null, "fee": 5000, "innerInstructions": [], "loadedAddresses": { "readonly": [], "writable": [] }, "logMessages": [ "Program 11111111111111111111111111111111 invoke [1]", "Program 11111111111111111111111111111111 success" ], "postBalances": [ 10804309975, 10804407530, 1 ], "postTokenBalances": [], "preBalances": [ 10804315088, 10804407417, 1 ], "preTokenBalances": [], "rewards": null, "status": { "Ok": null } }, "transaction": { "message": { "accountKeys": [ "ANVUJaJoVaJZELtV2AvRp7V5qPV1B84o29zAwDhPj1c2", "4PkiqJkUvxr9P8C1UsMqGN8NJsUcep9GahDRLfmeu8UK", "11111111111111111111111111111111" ], "header": { "numReadonlySignedAccounts": 0, "numReadonlyUnsignedAccounts": 1, "numRequiredSignatures": 1 }, "instructions": [ { "accounts": [ 0, 1 ], "data": "3Bxs4KkuG3n7y751", "programIdIndex": 2, "stackHeight": null } ], "recentBlockhash": "2XvJSKxQXyiYzdVdWQ3hQkb7FZMRnevWUtyttLCtweha" }, "signatures": [ "32wUcJEURNhdDJve1y7giwE1zhMWRgGbNwfn3cxsLmtTznnunGEbvDjkispJCVnu7XfTmHreeLfRDpETgzczMG8B" ] }, "version": "legacy" } ] }, "id": 1 } ``` ### Request example 2 ```shell curl -X POST https://rpc.ankr.com/solana/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getBlock", "params": [370774640, "base64"], "id": 1 }' ``` ### Response example 2 ```json { "jsonrpc": "2.0", "result": { "blockHeight": 358752908, "blockTime": 1743307608, "blockhash": "HF4FCaWTHZqoTSqeZS5xtqfvKB3crSHgqugWCC2CrF6N", "parentSlot": 370774639, "previousBlockhash": "2f1r7z58nr7HX92YDko28wAHTyWAHYvmDHfVjSApvw7T", "rewards": [ { "commission": null, "lamports": 77800, "postBalance": 1012068020241072, "pubkey": "dv2eQHeP4RFrJZ6UeiZWoc3XTtmtZCUKxxCApCDcRNV", "rewardType": "Fee" } ], "transactions": [ { "meta": { "computeUnitsConsumed": 150, "err": null, "fee": 5000, "innerInstructions": [], "loadedAddresses": { "readonly": [], "writable": [] }, "logMessages": [ "Program 11111111111111111111111111111111 invoke [1]", "Program 11111111111111111111111111111111 success" ], "postBalances": [ 10804309975, 10804407530, 1 ], "postTokenBalances": [], "preBalances": [ 10804315088, 10804407417, 1 ], "preTokenBalances": [], "rewards": [], "status": { "Ok": null } }, "transaction": [ "AWW00bg6XvEKFL0bfYFKxozs1lqn2iXsNGSISW8ecRprGyocrjVocrAFanSZbvhHxCtlHHELDHJQwMzkvi7AtQwBAAEDizqSQJGZ3Exs17wQBP+BB3AlC5LWj0lppkJp/w/nr98yZ0Y8gaZ3Klk/NF/WDYIThTzpRp42PYFbnRVVqliKHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFsdg39g9WrKEsn+BDMcD8H/kmr6+KwxKnn0feVGtoSUBAgIAAQwCAAAAcQAAAAAAAAA=", "base64" ] } ] }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/somnia/ title: Somnia description: Somnia is a high-performance, cost-efficient EVM-compatible Layer 1 blockchain capable of processing over… 23 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/somnia/index.mdx --- # Somnia
> Somnia API is available on [Web3 API platform](https://www.ankr.com/rpc/somnia). *Somnia* is a high-performance, cost-efficient EVM-compatible Layer 1 blockchain capable of processing over 1,000,000 transactions per second (TPS) with sub-second finality. It is suitable for serving millions of users and building real-time mass-consumer applications like games, social applications, metaverses, and more, all fully on-chain. In order for your Web3 application to interact with Somnia — either by reading blockchain data or sending transactions to the network — it must connect to a Somnia node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/somnia/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/somnia/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/somnia/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/somnia/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/somnia/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/somnia/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/somnia/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/somnia/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/somnia/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/somnia/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/somnia/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/somnia/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getCode`](/rpc-service/chains/chains-api/somnia/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/somnia/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/somnia/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/somnia/web3/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getLogs`](/rpc-service/chains/chains-api/somnia/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/somnia/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/somnia/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/somnia/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/somnia/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/somnia/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/somnia/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/somnia/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/somnia/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/somnia/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/somnia/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/somnia/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/somnia/web3/#eth_getblocktransactioncountbynumber) - [`eth_getCode`](/rpc-service/chains/chains-api/somnia/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/somnia/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/somnia/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/somnia/web3/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_gettransactionreceipt) - [`eth_getLogs`](/rpc-service/chains/chains-api/somnia/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/somnia/web3-p2/ title: Somnia — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/somnia/web3-p2.mdx --- # Somnia — web3, net, eth (2/3) > API reference for [Somnia](/rpc-service/chains/chains-api/somnia/). [All methods ->](/rpc-service/chains/chains-api/somnia/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/somnia/web3/) · 2 · [3](/rpc-service/chains/chains-api/somnia/web3-p3/) ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x31818d38639178fb1477e7afcbd2371beb981de9221e9e49e6385e331c8d1ddd", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "hash": "0x31818d38639178fb1477e7afcbd2371beb981de9221e9e49e6385e331c8d1ddd", "parentHash": "0x4d665ca03db0bd497a0ad4359a7e1a451aba5a56269e4821bb71f759d4485f78", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x12a76e09bae1934265a1aea2812e0c772f372f8d", "stateRoot": "0xc692230d0bae5c3d7d567a4db80d83a053279eddb45ae11d7c8b2277cac265c9", "transactionsRoot": "0x421dcee9479873523b514eb5ef417e7137609faf811e50be6a2d4f39a301984c", "receiptsRoot": "0x6ec8f4131151c377af40d5a35fd8a70526d4679070ed9d57169452dfbc024637", "logsBloom": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "difficulty": "0x0", "number": "0x6d3b37", "gasLimit": "0x7b0c", "gasUsed": "0x5208", "baseFeePerGas": "0x6fc23ac00", "timestamp": "0x67c196b4", "extraData": "0x0163a0b05ce8634b04fa9305fa67192d6040950dbe3ed3f3561d7fd734cd0717", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "transactions": [ "0x10fa9e4c01179007b272d4f0e2262664440332e898b84b22c0faebb07517899b" ] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x6D3B37", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "hash": "0x31818d38639178fb1477e7afcbd2371beb981de9221e9e49e6385e331c8d1ddd", "parentHash": "0x4d665ca03db0bd497a0ad4359a7e1a451aba5a56269e4821bb71f759d4485f78", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x12a76e09bae1934265a1aea2812e0c772f372f8d", "stateRoot": "0xc692230d0bae5c3d7d567a4db80d83a053279eddb45ae11d7c8b2277cac265c9", "transactionsRoot": "0x421dcee9479873523b514eb5ef417e7137609faf811e50be6a2d4f39a301984c", "receiptsRoot": "0x6ec8f4131151c377af40d5a35fd8a70526d4679070ed9d57169452dfbc024637", "logsBloom": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "difficulty": "0x0", "number": "0x6d3b37", "gasLimit": "0x7b0c", "gasUsed": "0x5208", "baseFeePerGas": "0x6fc23ac00", "timestamp": "0x67c196b4", "extraData": "0x0163a0b05ce8634b04fa9305fa67192d6040950dbe3ed3f3561d7fd734cd0717", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "transactions": [ "0x10fa9e4c01179007b272d4f0e2262664440332e898b84b22c0faebb07517899b" ] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xbb414bee437b239f949080d1fba824dd393a9e8e8dd17c350e25a89f295567ec"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xed072c48428e6ab18332acc646339ca5ff126a57d68d153cb8a6b8622e2376c7", "blockNumber": "0x6d422d", "from": "0xe6d9300ef809c1efb08824bfe7e48b8287a4babb", "to": "0xca11bde05977b3631167028862be2a173976ca11", "gas": "0x816c", "gasPrice": "0x6fc23ac00", "hash": "0xbb414bee437b239f949080d1fba824dd393a9e8e8dd17c350e25a89f295567ec", "input": "0xa9059cbb000000000000000000000000da1fea7873338f34c6915a44028aa4d9aba1346b0000000000000000000000000000000000000000000000000011c37937e08000", "nonce": "0x0", "transactionIndex": "0x0", "value": "0x0", "v": "0x1", "r": "0xd01404707d5729feac00177b9856114086c345e42a1cc016370c9447efde9399", "s": "0x45996e8f26aa43d8418d7092eb3fc43e4c4d3d90568ac05585c74ed09b95a792" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0xed072c48428e6ab18332acc646339ca5ff126a57d68d153cb8a6b8622e2376c7", "0x0" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xed072c48428e6ab18332acc646339ca5ff126a57d68d153cb8a6b8622e2376c7", "blockNumber": "0x6d422d", "from": "0xe6d9300ef809c1efb08824bfe7e48b8287a4babb", "to": "0xca11bde05977b3631167028862be2a173976ca11", "gas": "0x816c", "gasPrice": "0x6fc23ac00", "hash": "0xbb414bee437b239f949080d1fba824dd393a9e8e8dd17c350e25a89f295567ec", "input": "0xa9059cbb000000000000000000000000da1fea7873338f34c6915a44028aa4d9aba1346b0000000000000000000000000000000000000000000000000011c37937e08000", "nonce": "0x0", "transactionIndex": "0x0", "value": "0x0", "v": "0x1", "r": "0xd01404707d5729feac00177b9856114086c345e42a1cc016370c9447efde9399", "s": "0x45996e8f26aa43d8418d7092eb3fc43e4c4d3d90568ac05585c74ed09b95a792" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x6D422D", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xed072c48428e6ab18332acc646339ca5ff126a57d68d153cb8a6b8622e2376c7", "blockNumber": "0x6d422d", "from": "0xe6d9300ef809c1efb08824bfe7e48b8287a4babb", "to": "0xca11bde05977b3631167028862be2a173976ca11", "gas": "0x816c", "gasPrice": "0x6fc23ac00", "hash": "0xbb414bee437b239f949080d1fba824dd393a9e8e8dd17c350e25a89f295567ec", "input": "0xa9059cbb000000000000000000000000da1fea7873338f34c6915a44028aa4d9aba1346b0000000000000000000000000000000000000000000000000011c37937e08000", "nonce": "0x0", "transactionIndex": "0x0", "value": "0x0", "v": "0x1", "r": "0xd01404707d5729feac00177b9856114086c345e42a1cc016370c9447efde9399", "s": "0x45996e8f26aa43d8418d7092eb3fc43e4c4d3d90568ac05585c74ed09b95a792" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xbb414bee437b239f949080d1fba824dd393a9e8e8dd17c350e25a89f295567ec"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "transactionHash": "0xbb414bee437b239f949080d1fba824dd393a9e8e8dd17c350e25a89f295567ec", "transactionIndex": "0x0", "blockHash": "0xed072c48428e6ab18332acc646339ca5ff126a57d68d153cb8a6b8622e2376c7", "blockNumber": "0x6d422d", "from": "0xe6d9300ef809c1efb08824bfe7e48b8287a4babb", "to": "0xca11bde05977b3631167028862be2a173976ca11", "cumulativeGasUsed": "0x0", "gasUsed": "0x5648", "contractAddress": null, "type": "0x2", "status": "0x1", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "logs": [], "effectiveGasPrice": "0x6fc23ac00" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/somnia/web3-p3/ title: Somnia — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/somnia/web3-p3.mdx --- # Somnia — web3, net, eth (3/3) > API reference for [Somnia](/rpc-service/chains/chains-api/somnia/). [All methods ->](/rpc-service/chains/chains-api/somnia/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/somnia/web3/) · [2](/rpc-service/chains/chains-api/somnia/web3-p2/) · 3 ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0x6D4F10", "toBlock": "0x6D4F11" }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xa2e9ff23495cf4f6c142fa7e109d0c17af799e2b", "topics": [ "0xe028433ec1ff3b8c839d1a18dc250bba72715735efde55f11debeb85fa863c5a" ], "data": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000002a30783131383538624346393563323733453539343339336461324239423333303645453832643242626600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000132000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011726573756c744465736372697074696f6e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000f84a757374206c696b65204d696e64792c20796f75277265207468652070657266656374206265737420667269656e64202d20737570706f72746976652c20656e7465727461696e696e672c20616e6420616c7761797320726561647920666f7220616e20616476656e747572652120f09f8c9f20596f75277265206e6f742061667261696420746f20636861736520796f757220647265616d732c206576656e206966206974206d65616e732074616b696e67207269736b732e20e2ad9020596f75722077697420616e6420636861726d206d616b6520796f7520746865206c696665206f662065766572792070617274792120f09f8ead0000000000000000", "blockNumber": "0x6d4f10", "transactionHash": "0x6f9c582354ab7ed53cb3f678e581aa60227f5e088ef69bb211992e37bd839df8", "transactionIndex": "0x0", "blockHash": "0x3d0aad15adb3b7a6815a8049eceb19c6fb2492d0f6c6cc9992aa33de5f8d7146", "logIndex": "0x0" }, { "address": "0xa2e9ff23495cf4f6c142fa7e109d0c17af799e2b", "topics": [ "0xe028433ec1ff3b8c839d1a18dc250bba72715735efde55f11debeb85fa863c5a" ], "data": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000002a3078313138353862434639356332373345353934333933646132423942333330364545383264324262660000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000573636f726500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000096", "blockNumber": "0x6d4f10", "transactionHash": "0x6f9c582354ab7ed53cb3f678e581aa60227f5e088ef69bb211992e37bd839df8", "transactionIndex": "0x0", "blockHash": "0x3d0aad15adb3b7a6815a8049eceb19c6fb2492d0f6c6cc9992aa33de5f8d7146", "logIndex": "0x1" }, { "address": "0xa2e9ff23495cf4f6c142fa7e109d0c17af799e2b", "topics": [ "0xe028433ec1ff3b8c839d1a18dc250bba72715735efde55f11debeb85fa863c5a" ], "data": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000002a3078313138353862434639356332373345353934333933646132423942333330364545383264324262660000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b726573756c745469746c65000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000017f09f8ea420596f75277265204d696e6479204368656e21000000000000000000", "blockNumber": "0x6d4f10", "transactionHash": "0x6f9c582354ab7ed53cb3f678e581aa60227f5e088ef69bb211992e37bd839df8", "transactionIndex": "0x0", "blockHash": "0x3d0aad15adb3b7a6815a8049eceb19c6fb2492d0f6c6cc9992aa33de5f8d7146", "logIndex": "0x2" } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/somnia/web3/ title: Somnia — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/somnia/web3.mdx --- # Somnia — web3, net, eth (1/3) > API reference for [Somnia](/rpc-service/chains/chains-api/somnia/). [All methods ->](/rpc-service/chains/chains-api/somnia/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/somnia/web3-p2/) · [3](/rpc-service/chains/chains-api/somnia/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "Somnia/v0.0.0" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xc488" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6fc23ac00" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6d06ba" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x5B470FCa4893DB7C19A099641888dD20ad5D422b", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3cec1fce2f7f800" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x329BE8B07CC81478199882Ad894Ec939f0a49a4B", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xC792A968152D61Fad8c485cAAa77D761D2FBf903", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xa" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x06599e6dcbd0499527b047b74de74a21dbc67895a05cabf79a59ca2347780a7e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x6D2309"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xFbb8FC205d494ccc14Df8De03CDAb9614AEfeDE6", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/somnia/web3-p2/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_tx_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0xC4a4309809A7103CffBAbb99338e0786FA59955E", "data": "0x70a08231000000000000000000000000abcdefabcdefabcdefabcdefabcdef" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0xC4a4309809A7103CffBAbb99338e0786FA59955E", "to": "0xcA11bde05977b3631167028862bE2a173976CA11", "data": "0xa9059cbb000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf90000000000000000000000000000000000000000000000000000000000000064" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x816c" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sonic/eth/ title: Sonic — eth source: docs/rpc-service/chains/chains-api/sonic/eth.mdx --- # Sonic — eth > API reference for [Sonic](/rpc-service/chains/chains-api/sonic/). [All methods ->](/rpc-service/chains/chains-api/sonic/#methods) ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", "blockNumber": "0x521b8", "contractAddress": null, "cumulativeGasUsed": "0x260f8", "effectiveGasPrice": "0x4190ab00", "from": "0xa66b0798e5f3812d84a91e5d14723c1c90fb2d00", "gasUsed": "0x260f8", "logs": [ { "address": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000a66b0798e5f3812d84a91e5d14723c1c90fb2d00", "0x0000000000000000000000000000000000000000000000000000000000000745" ], "data": "0x", "blockNumber": "0x521b8", "transactionHash": "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8", "transactionIndex": "0x0", "blockHash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", "logIndex": "0x0", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000000001000000000000000000000000000000000800000000000000000000020000000000000000022008000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000080000000000000000001000000008000000020000200000000000000000002000000000000000000000000000000000000000000", "status": "0x1", "to": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", "transactionHash": "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8", "transactionIndex": "0x0", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "fromBlock": "0x1", "toBlock": "latest", "address": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" ] } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sonic/ title: Sonic description: Sonic is an EVM-compatible Layer 1 blockchain designed to deliver high-speed, low-latency transactions, aiming… 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/sonic/index.mdx --- # Sonic
> Sonic API is available on [Web3 API platform](https://www.ankr.com/rpc/sonic). *Sonic* is an EVM-compatible Layer 1 blockchain designed to deliver high-speed, low-latency transactions, aiming to process over 10,000 transactions per second with sub-second finality. Key Features of Sonic: * **High Throughput and Speed**: Sonic achieves transaction finality in approximately 720 milliseconds, positioning it among the fastest EVM-compatible blockchains. * **Developer Incentives**: The platform offers attractive incentives, including a fee monetization program that allows developers to earn up to 90% of the fees generated by their applications. * **EVM Compatibility**: Sonic's compatibility with the Ethereum Virtual Machine enables seamless deployment of existing Ethereum-based decentralized applications (dApps) without significant modifications. * **Secure Ethereum Gateway**: Sonic provides a secure bridge to Ethereum, facilitating easy access to Ethereum's liquidity and assets while maintaining high transaction speeds and low costs. In order for your Web3 application to interact with Sonic — either by reading blockchain data or sending transactions to the network — it must connect to a Sonic node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/sonic/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/sonic/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/sonic/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/sonic/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/sonic/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/sonic/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/sonic/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/sonic/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/sonic/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/sonic/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/sonic/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/sonic/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/sonic/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/sonic/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/sonic/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/sonic/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/sonic/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/sonic/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/sonic/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/sonic/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/sonic/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/sonic/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/sonic/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/sonic/web3-p3/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/sonic/eth/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/sonic/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/sonic/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/sonic/eth/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/sonic/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/sonic/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/sonic/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/sonic/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/sonic/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/sonic/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/sonic/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/sonic/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/sonic/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/sonic/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/sonic/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/sonic/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/sonic/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/sonic/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/sonic/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/sonic/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/sonic/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/sonic/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/sonic/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/sonic/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/sonic/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/sonic/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/sonic/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/sonic/web3-p3/#eth_gettransactionbyblocknumberandindex) ### eth - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/sonic/eth/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/sonic/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/sonic/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/sonic/eth/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sonic/web3-p2/ title: Sonic — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/sonic/web3-p2.mdx --- # Sonic — web3, net, eth (2/3) > API reference for [Sonic](/rpc-service/chains/chains-api/sonic/). [All methods ->](/rpc-service/chains/chains-api/sonic/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/sonic/web3/) · 2 · [3](/rpc-service/chains/chains-api/sonic/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0x3561607590e28e0848ba3B67074C676D6D1C9953", "to": "0x5A93A3F8C5E3EAE603B36E3E0805A2E2290B1E82", "value": "0x2386f26fc10000" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", false], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "parentHash": "0xe8eb5513b16b8eb8b2be12a96e152a6499bff9b1a35e20093efa8ecf2f9ee68f", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x0000000000000000000000000000000000000000", "stateRoot": "0x83b6d171379b20bb862eb75be7c27f069b2e3ae09d7422170f30d42cbdb595b7", "transactionsRoot": "0xacdedffe20b24f7d038de5cc021060ba3bcb17accda55b0c7951126fcbad0f4b", "receiptsRoot": "0x06e8fb351cd05705aa7a7319abd441121798c3e8481e0a00901838b7fb244f90", "logsBloom": "0x00000000000000000000000000000000000001000000000000000000000000000000000800000000000000000000020000000000000000022008000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000080000000000000000001000000008000000020000200000000000000000002000000000000000000000000000000000000000000", "difficulty": "0x0", "number": "0x521b8", "gasLimit": "0x3b9aca00", "gasUsed": "0x260f8", "timestamp": "0x675adcd2", "timestampNano": "0x18106f1b1049d289", "extraData": "0x21b81e8900000000b7e32c07", "mixHash": "0x4e41663dbed98b5493d2867d5d3d05c01fc31e8e80a82c19eac6414232c81d98", "nonce": "0x0000000000000000", "baseFeePerGas": "0x3b9aca00", "hash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", "epoch": "0x615", "totalDifficulty": "0x0", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0", "excessBlobGas": "0x0", "transactions": [ "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8" ], "size": "0x435", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", true], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "parentHash": "0x6487e909bb86f04165bd5fb6dfe7ad7ed9d4ebd9e1b177a35f01c7711c69d999", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x0000000000000000000000000000000000000000", "stateRoot": "0xeaa7a4cec2ab5b3eb639b1170df4f5465b5db5403992122c2328e13821a61016", "transactionsRoot": "0x4a784bb0085a0081a1648cb5f27914657dd4bd029d20fddf4188d5e8e7adbef4", "receiptsRoot": "0x4ca54bd7bfdbbc68f7134724c7c2b1ed3fa70ff6bc67713f37ea2e47fcc15089", "logsBloom": "0x00000000000000000000000000000000000001000000000000000000000400000000000800800000000000000000000000000000000000020000000000000000000000000000000000000008000800000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000002000000000000000000000000000000000001000000008000000020000000000000000000000002000000000000000000000000000000000200000000", "difficulty": "0x0", "number": "0x52881", "gasLimit": "0x3b9aca00", "gasUsed": "0x26104", "timestamp": "0x675aee4b", "timestampNano": "0x1810732c95444006", "extraData": "0x331f1206000000002dda168a", "mixHash": "0x791c91d9720778698a98dd336026c813d9b21a9ba0fd54fb9799e3392924c9ad", "nonce": "0x0000000000000000", "baseFeePerGas": "0x3b9aca00", "hash": "0xfda0b9e3d7d9f239cdbfe5857018306ec7299c05a394c0ed7e9f34b84dd37b87", "epoch": "0x61d", "totalDifficulty": "0x0", "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "blobGasUsed": "0x0", "excessBlobGas": "0x0", "transactions": [ { "blockHash": "0xfda0b9e3d7d9f239cdbfe5857018306ec7299c05a394c0ed7e9f34b84dd37b87", "blockNumber": "0x52881", "from": "0xbe0332bb852ddb346752a6cf1e45daec723ef8e1", "gas": "0x2681e", "gasPrice": "0x4190ab00", "maxFeePerGas": "0x4190ab00", "maxPriorityFeePerGas": "0x4190ab00", "hash": "0xa41a7200f0724199da5b1cb8f215ffeafbc95a5721802dc018e38ad76aefe64c", "input": "0x84bb1e42000000000000000000000000be0332bb852ddb346752a6cf1e45daec723ef8e10000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000c28f219c40000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000c28f219c400000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0", "to": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", "transactionIndex": "0x0", "value": "0xc28f219c400", "type": "0x2", "accessList": [], "chainId": "0x92", "v": "0x1", "r": "0x62e5ddfac6ec5317784f401494f5ad9b348797901867447421fc8db90c9b65d", "s": "0x36f1cb064e9589d70d068bff6257c3351724f42b73a931a7272ab1c596f74881", "maxFeePerBlobGas": null, "blobVersionedHashes": null } ], "size": "0x435", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", "blockNumber": "0x521b8", "from": "0xa66b0798e5f3812d84a91e5d14723c1c90fb2d00", "gas": "0x26812", "gasPrice": "0x4190ab00", "maxFeePerGas": "0x4190ab00", "maxPriorityFeePerGas": "0x4190ab00", "hash": "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8", "input": "0x84bb1e42000000000000000000000000a66b0798e5f3812d84a91e5d14723c1c90fb2d000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000c28f219c40000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000c28f219c400000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0", "to": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", "transactionIndex": "0x0", "value": "0xc28f219c400", "type": "0x2", "accessList": [], "chainId": "0x92", "v": "0x1", "r": "0xfad93fb7b0d204241bdbe082857e9b37c5cc085eca348ee1159fb2887615af5", "s": "0x2ffe202fe44c01158896f8b6f9d15b4da730eee52102fa3b69b9a697d0841cb8", "maxFeePerBlobGas": null, "blobVersionedHashes": null } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", "blockNumber": "0x521b8", "from": "0xa66b0798e5f3812d84a91e5d14723c1c90fb2d00", "gas": "0x26812", "gasPrice": "0x4190ab00", "maxFeePerGas": "0x4190ab00", "maxPriorityFeePerGas": "0x4190ab00", "hash": "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8", "input": "0x84bb1e42000000000000000000000000a66b0798e5f3812d84a91e5d14723c1c90fb2d000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000c28f219c40000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000c28f219c400000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0", "to": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", "transactionIndex": "0x0", "value": "0xc28f219c400", "type": "0x2", "accessList": [], "chainId": "0x92", "v": "0x1", "r": "0xfad93fb7b0d204241bdbe082857e9b37c5cc085eca348ee1159fb2887615af5", "s": "0x2ffe202fe44c01158896f8b6f9d15b4da730eee52102fa3b69b9a697d0841cb8", "maxFeePerBlobGas": null, "blobVersionedHashes": null } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sonic/web3-p3/ title: Sonic — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/sonic/web3-p3.mdx --- # Sonic — web3, net, eth (3/3) > API reference for [Sonic](/rpc-service/chains/chains-api/sonic/). [All methods ->](/rpc-service/chains/chains-api/sonic/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/sonic/web3/) · [2](/rpc-service/chains/chains-api/sonic/web3-p2/) · 3 ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x521B8", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", "blockNumber": "0x521b8", "from": "0xa66b0798e5f3812d84a91e5d14723c1c90fb2d00", "gas": "0x26812", "gasPrice": "0x4190ab00", "maxFeePerGas": "0x4190ab00", "maxPriorityFeePerGas": "0x4190ab00", "hash": "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8", "input": "0x84bb1e42000000000000000000000000a66b0798e5f3812d84a91e5d14723c1c90fb2d000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000c28f219c40000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000c28f219c400000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0", "to": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", "transactionIndex": "0x0", "value": "0xc28f219c400", "type": "0x2", "accessList": [], "chainId": "0x92", "v": "0x1", "r": "0xfad93fb7b0d204241bdbe082857e9b37c5cc085eca348ee1159fb2887615af5", "s": "0x2ffe202fe44c01158896f8b6f9d15b4da730eee52102fa3b69b9a697d0841cb8", "maxFeePerBlobGas": null, "blobVersionedHashes": null } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sonic/web3/ title: Sonic — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/sonic/web3.mdx --- # Sonic — web3, net, eth (1/3) > API reference for [Sonic](/rpc-service/chains/chains-api/sonic/). [All methods ->](/rpc-service/chains/chains-api/sonic/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/sonic/web3-p2/) · [3](/rpc-service/chains/chains-api/sonic/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Sonic/v2.0.1-1933d89b-1733132635/linux-amd64/go1.23.2", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "146" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4190ab00" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5223d" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x4DF5875E703A29627D87BB0AF5b9d185AFe09982", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x879dbc66802a609e" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x4DF5875E703A29627D87BB0AF5b9d185AFe09982", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x4DF5875E703A29627D87BB0AF5b9d185AFe09982", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x24a0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xa335691b34232e9376817d7edea89bc2b23b20528ac7721d8e39879d044bc739"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x52212"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xe0400def67cf2f1d5a13c39830b850cda5231968887665bc12ac8bb29d86a6c3"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x52212"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x2C7F8b79de38Db416346D65e011757b8EcAeCbDe", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/sonic/eth/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83", "data": "0x70a082310000000000000000000000005A93A3F8C5E3EAE603B36E3E0805A2E2290B1E82" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/accounts-p2/ title: Stellar — Accounts (2/3) source: docs/rpc-service/chains/chains-api/stellar/accounts-p2.mdx --- # Stellar — Accounts (2/3) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/stellar/accounts/) · 2 · [3](/rpc-service/chains/chains-api/stellar/accounts-p3/) ## Accounts ### `GET /accounts/{account_id}/transactions` #### Parameters * `account_id` (string; path; required): the account’s public key encoded in a base32 string representation. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "memo": "string", "_links": { "self": { "href": "string", "templated": true }, "account": { "href": "string", "templated": true }, "ledger": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "successful": true, "hash": "string", "ledger": 0, "created_at": "string", "source_account": "string", "account_muxed": "string", "account_muxed_id": "string", "source_account_sequence": "string", "fee_account": "string", "fee_account_muxed": "string", "fee_account_muxed_id": "string", "fee_charged": "string", "max_fee": "string", "operation_count": 0, "envelope_xdr": "string", "result_xdr": "string", "result_meta_xdr": "string", "fee_meta_xdr": "string", "memo_type": "string", "signatures": [ "string" ], "valid_after": "string", "valid_before": "string", "preconditions": { "timebounds": { "min_time": "string", "max_time": "string" }, "ledgerbounds": { "min_ledger": "string", "max_ledger": "string" }, "min_account_sequence": "string", "min_account_sequence_age": "string", "min_account_sequence_ledger_gap": 0, "extra_signers": [ "string" ] }, "fee_bump_transaction": { "hash": "string", "signatures": [ "string" ] }, "inner_transaction": { "hash": "string", "signatures": [ "string" ], "max_fee": "string" } } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/transactions{?cursor,limit,order} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/transactions{?cursor,limit,order} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/accounts/GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU/transactions?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/accounts/GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU/transactions?cursor=94658837230923776\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/accounts/GBVFTZL5HIPT4PFQVTZVIWR77V7LWYCXU4CLYWWHHOEXB64XPG5LDMTU/transactions?cursor=94658837230923776\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "memo": "", "memo_bytes": "", "_links": { "self": { "href": "https://rpc.ankr.com/transactions/4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee" }, "account": { "href": "https://rpc.ankr.com/accounts/GBYSOAM7D42RMUN4LCKCFYNXZU3F7TJVKD2NMR672J4372BCH6DE4BKR" }, "ledger": { "href": "https://rpc.ankr.com/ledgers/22039478" }, "operations": { "href": "https://rpc.ankr.com/transactions/4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee/operations{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/transactions/4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee/effects{?cursor,limit,order}", "templated": true }, "precedes": { "href": "https://rpc.ankr.com/transactions?order=asc\u0026cursor=94658837230923776" }, "succeeds": { "href": "https://rpc.ankr.com/transactions?order=desc\u0026cursor=94658837230923776" }, "transaction": { "href": "https://rpc.ankr.com/transactions/4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee" } }, "id": "4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee", "paging_token": "94658837230923776", "successful": true, "hash": "4826a3d41a5a795bf795767d0fb5e39c4abbcf695cf888b3578aa126b5b257ee", "ledger": 22039478, "created_at": "2019-01-18T14:40:47Z", "source_account": "GBYSOAM7D42RMUN4LCKCFYNXZU3F7TJVKD2NMR672J4372BCH6DE4BKR", "source_account_sequence": "90296735301107721", "fee_account": "GBYSOAM7D42RMUN4LCKCFYNXZU3F7TJVKD2NMR672J4372BCH6DE4BKR", "fee_charged": "100", "max_fee": "100", "operation_count": 1, "envelope_xdr": "AAAAAHEnAZ8fNRZRvFiUIuG3zTZfzTVQ9NZH39J5v+giP4ZOAAAAZAFAzGcAAAAJAAAAAQAAAAAAAAAAAAAAAFxB5cMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAAAC+vCAAAAAAAAAAAEiP4ZOAAAAQO421wcb/JYfBpnYEJzHpMyQnrM8rHd4PUoyHXpPlvQAUGzARqwbX8hcLSM4tlk51AwbuZOaZfWCaFQfzFZJuAA=", "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=", "result_meta_xdr": "AAAAAgAAAAIAAAADAVBLtgAAAAAAAAAAcScBnx81FlG8WJQi4bfNNl/NNVD01kff0nm/6CI/hk4AAAAAI9MEZAFAzGcAAAAIAAAAAAAAAAEAAAAA7Nxp7lmV7taqQfqoSP+tlqjOHWeANaQYFqhDkCQERZQAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAVBLtgAAAAAAAAAAcScBnx81FlG8WJQi4bfNNl/NNVD01kff0nm/6CI/hk4AAAAAI9MEZAFAzGcAAAAJAAAAAAAAAAEAAAAA7Nxp7lmV7taqQfqoSP+tlqjOHWeANaQYFqhDkCQERZQAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAMBUEu2AAAAAAAAAABxJwGfHzUWUbxYlCLht802X801UPTWR9/Seb/oIj+GTgAAAAAj0wRkAUDMZwAAAAkAAAAAAAAAAQAAAADs3GnuWZXu1qpB+qhI/62WqM4dZ4A1pBgWqEOQJARFlAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBUEu2AAAAAAAAAABxJwGfHzUWUbxYlCLht802X801UPTWR9/Seb/oIj+GTgAAAAAg2BPkAUDMZwAAAAkAAAAAAAAAAQAAAADs3GnuWZXu1qpB+qhI/62WqM4dZ4A1pBgWqEOQJARFlAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABUEu2AAAAAAAAAABqWeV9Oh8+PLCs81RaP/1+u2BXpwS8Wsc7iXD7l3m6sQAAAAAC+vCAAVBLtgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAA=", "fee_meta_xdr": "AAAAAgAAAAMBUCemAAAAAAAAAABxJwGfHzUWUbxYlCLht802X801UPTWR9/Seb/oIj+GTgAAAAAj0wTIAUDMZwAAAAgAAAAAAAAAAQAAAADs3GnuWZXu1qpB+qhI/62WqM4dZ4A1pBgWqEOQJARFlAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBUEu2AAAAAAAAAABxJwGfHzUWUbxYlCLht802X801UPTWR9/Seb/oIj+GTgAAAAAj0wRkAUDMZwAAAAgAAAAAAAAAAQAAAADs3GnuWZXu1qpB+qhI/62WqM4dZ4A1pBgWqEOQJARFlAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==", "memo_type": "text", "signatures": [ "7jbXBxv8lh8GmdgQnMekzJCeszysd3g9SjIdek+W9ABQbMBGrBtfyFwtIzi2WTnUDBu5k5pl9YJoVB/MVkm4AA==" ], "valid_after": "1970-01-01T00:00:00Z", "valid_before": "2019-01-18T14:42:11Z", "preconditions": { "timebounds": { "min_time": "0", "max_time": "1547822531" } } } ] } } ``` --- ### `GET /accounts/{account_id}/operations` > Retrieves an account's operations. The endpoint represents successful operations for a given account and can be used in streaming mode. Streaming mode allows you to listen for new operations for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known operation unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream operations created since your request time. #### Parameters * `account_id` (string; path; required): the account’s public key encoded in a base32 string representation. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. * `join` (any; query): set to transactions to include the transactions which created each of the operations in the response. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "transaction_successful": true, "source_account": "string", "type": "create_account", "type_i": 0, "created_at": "string", "transaction_hash": "string", "starting_balance": "string", "funder": "string", "account": "string" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/operations ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/operations \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?cursor=120194466505179137\u0026limit=10\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?cursor=213638377747542068\u0026limit=10\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations?cursor=213638377747542068\u0026limit=10\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/operations/213638377747542068" }, "transaction": { "href": "https://rpc.ankr.com/transactions/64946c9e2ea9e30bf076bbc92068dcfdafcfaaf0fa77f4fee1060858751b9974" }, "effects": { "href": "https://rpc.ankr.com/operations/213638377747542068/effects" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=213638377747542068" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=213638377747542068" } }, "id": "213638377747542068", "paging_token": "213638377747542068", "transaction_successful": true, "source_account": "GCAHDBWNRTRNYGE5CX4RDVC74BVW3DOZOP5U6NMH3HLWTV46QZBZPFH4", "type": "payment", "type_i": 1, "created_at": "2024-01-02T18:20:33Z", "transaction_hash": "64946c9e2ea9e30bf076bbc92068dcfdafcfaaf0fa77f4fee1060858751b9974", "asset_type": "native", "from": "GCAHDBWNRTRNYGE5CX4RDVC74BVW3DOZOP5U6NMH3HLWTV46QZBZPFH4", "to": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA", "amount": "0.0610489" } ] } } ``` --- ### `GET /accounts/{account_id}/payments` > Retrieves an account's payments. This endpoint represents successful payments for a given account and can be used in streaming mode. Streaming mode allows you to listen for new payments for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known payment unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream payments created since your request time. #### Parameters * `account_id` (string; path; required): the account’s public key encoded in a base32 string representation. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. * `join` (any; query): set to transactions to include the transactions which created each of the operations in the response. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "transaction_successful": true, "source_account": "string", "type": "payment", "type_i": "string", "created_at": "string", "transaction_hash": "string", "asset_type": "string", "asset_issuer": "string", "from": "string", "to": "string", "amount": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/payments{?cursor,limit,order} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/payments{?cursor,limit,order} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/payments?cursor=148289273518190684\u0026limit=10\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/payments?cursor=213638377747542068\u0026limit=10\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/payments?cursor=213638377747542068\u0026limit=10\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/operations/213638377747542068" }, "transaction": { "href": "https://rpc.ankr.com/transactions/64946c9e2ea9e30bf076bbc92068dcfdafcfaaf0fa77f4fee1060858751b9974" }, "effects": { "href": "https://rpc.ankr.com/operations/213638377747542068/effects" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=213638377747542068" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=213638377747542068" } }, "id": "213638377747542068", "paging_token": "213638377747542068", "transaction_successful": true, "source_account": "GCAHDBWNRTRNYGE5CX4RDVC74BVW3DOZOP5U6NMH3HLWTV46QZBZPFH4", "type": "payment", "type_i": 1, "created_at": "2024-01-02T18:20:33Z", "transaction_hash": "64946c9e2ea9e30bf076bbc92068dcfdafcfaaf0fa77f4fee1060858751b9974", "asset_type": "native", "from": "GCAHDBWNRTRNYGE5CX4RDVC74BVW3DOZOP5U6NMH3HLWTV46QZBZPFH4", "to": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA", "amount": "0.0610489" } ] } } ``` --- ### `GET /accounts/{account_id}/effects` > Retrieves an account's effects. This endpoint returns the effects of a specific account and can be used in streaming mode. Streaming mode allows you to listen for new effects for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time. #### Parameters * `account_id` (string; path; required): the account’s public key encoded in a base32 string representation. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "transaction_successful": true, "source_account": "string", "type": "create_account", "type_i": 0, "created_at": "string", "transaction_hash": "string", "starting_balance": "string", "funder": "string", "account": "string" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/effects{?cursor,limit,order} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/effects{?cursor,limit,order} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=110694007436259329-1\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/accounts/GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE/effects?cursor=110694007436259329-1\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "https://rpc.ankr.com/operations/110694007436259329" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=110694007436259329-1" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=110694007436259329-1" } }, "id": "0110694007436259329-0000000001", "paging_token": "110694007436259329-1", "account": "GCNL55IJTH2HX26HLNIGYD2JIQLTBAQL3SVPNZA6PXK7NAVHU423WOTE", "type": "account_created", "type_i": 0, "created_at": "2019-09-11T13:16:44Z", "starting_balance": "1.0000000" } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/accounts-p3/ title: Stellar — Accounts (3/3) source: docs/rpc-service/chains/chains-api/stellar/accounts-p3.mdx --- # Stellar — Accounts (3/3) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/stellar/accounts/) · [2](/rpc-service/chains/chains-api/stellar/accounts-p2/) · 3 ## Accounts ### `GET /accounts/{account_id}/offers` > Retrieves an account's offers. #### Parameters * `account_id` (string; path; required): the account’s public key encoded in a base32 string representation. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "offer_maker": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "seller": "string", "selling": { "asset_type": "string", "asset_code": "string", "asset_issuer": "string" }, "buying": { "asset_type": "string", "asset_code": "string", "asset_issuer": "string" }, "amount": "string", "price_r": { "n": 0, "d": 0 }, "price": "string", "last_modified_ledger": 0, "last_modified_time": "string", "sponser": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/offers{?cursor,limit,order} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/offers{?cursor,limit,order} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/offers?cursor=164943216\u0026limit=10\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/offers?cursor=164943216\u0026limit=10\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/offers?cursor=164943216\u0026limit=10\u0026order=desc" } }, "_embedded": { "records": [] } } ``` --- ### `GET /accounts/{account_id}/trades` > Retrieves an account's trades. This endpoint represents all trades for a given account and can be used in streaming mode. Streaming mode allows you to listen for trades for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time. #### Parameters * `account_id` (string; path; required): the account’s public key encoded in a base32 string representation. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "base": { "href": "string", "templated": true }, "counter": { "href": "string", "templated": true }, "operation": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "ledger_close_time": "string", "offer_id": "string", "trade_type": "string", "liquidity_pool_fee_bp": 0, "base_liquidity_pool_id": "string", "base_offer_id": "string", "base_account": "string", "base_amount": "string", "base_asset_type": "string", "base_asset_code": "string", "base_asset_issuer": "string", "counter_liquidity_pool_id": "string", "counter_offer_id": "string", "counter_account": "string", "counter_amount": "string", "counter_asset_type": "string", "counter_asset_code": "string", "counter_asset_issuer": "string", "base_is_seller": true, "price": { "n": "string", "d": "string" } } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/trades{?cursor,limit,order} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/trades{?cursor,limit,order} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/trades?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/trades?cursor=107449468881756161-0\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K/trades?cursor=107449468881756161-0\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "" }, "base": { "href": "https://rpc.ankr.com/accounts/GCO7OW5P2PP7WDN6YUDXUUOPAR4ZHJSDDCZTIAQRTRZHKQWV45WUPBWX" }, "counter": { "href": "https://rpc.ankr.com/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K" }, "operation": { "href": "https://rpc.ankr.com/operations/107449468881756161" } }, "id": "107449468881756161-0", "paging_token": "107449468881756161-0", "ledger_close_time": "2019-07-26T09:17:02Z", "trade_type": "orderbook", "base_offer_id": "104078276", "base_account": "GCO7OW5P2PP7WDN6YUDXUUOPAR4ZHJSDDCZTIAQRTRZHKQWV45WUPBWX", "base_amount": "4433.2000000", "base_asset_type": "native", "counter_offer_id": "4719135487309144065", "counter_account": "GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K", "counter_amount": "443.3200000", "counter_asset_type": "credit_alphanum4", "counter_asset_code": "BB1", "counter_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN", "base_is_seller": true, "price": { "n": "1", "d": "10" } } ] } } ``` --- ### `GET /accounts/{account_id}/data/{key}` > Retrieve an account's data. This endpoint represents a single data for a given account. #### Parameters * `account_id` (string; path; required): the account’s public key encoded in a base32 string representation. * `key` (string; path; required): the key name for this data. #### Returns ```json { "value": "string" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/data/{key} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id}/data/{key} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "value": "MQ==" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/accounts/ title: Stellar — Accounts (1/3) source: docs/rpc-service/chains/chains-api/stellar/accounts.mdx --- # Stellar — Accounts (1/3) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/stellar/accounts-p2/) · [3](/rpc-service/chains/chains-api/stellar/accounts-p3/) ## Accounts Users interact with the Stellar network through accounts. Everything else in the ledger—assets, offers, trustlines, etc.—are owned by accounts, and accounts must authorize all changes to the ledger through signed transactions. ### `GET /accounts` > Retrieves all accounts matching a filter. This endpoint lists accounts by one of four filters : `signer`, `asset`, `liquidity pool` or `sponsor`. #### Parameters * `sponsor` (string; query): account ID of the sponsor. Every account in the response will either be sponsored by the given account ID or have a subentry (trust line, offer, or data entry) which is sponsored by the given account ID. * `asset` (any; query): an issued asset represented as “Code:IssuerAccountID”. Every account in the response will have a trust line for the given asset. * `signer` (string; query): account ID of the signer. Every account in the response will have the given account ID as a signer. * `liqudity_pool` (any; query): with this parameter, the results will include only accounts which have trust lines to the specified liquidity pool. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record. * `order` (string; query): possible values: [asc, desc]. A designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "transactions": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "payments": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "offers": { "href": "string", "templated": true }, "trades": { "href": "string", "templated": true }, "data": { "href": "string", "templated": true } }, "id": "string", "account_id": "string", "sequence": "string", "sequence_ledger": 0, "sequence_time": "string", "subentry_count": 0, "inflation_destination": "string", "home_domain": "string", "last_modified_ledger": 0, "last_modified_time": "string", "thresholds": { "low_threshold": 0, "med_threshold": 0, "high_threshold": 0 }, "flags": { "auth_required": true, "auth_revocable": true, "auth_immutable": true, "auth_clawback_enabled": true }, "balances": [ { "balance": "string", "liquidity_pool_id": "string", "limit": "string", "buying_liabilites": "string", "selling_liabilites": "string", "sponser": "string", "last_modified_ledger": 0, "is_authorized": true, "is_authorized_to_maintain_liabilites": true, "is_clawback_enabled": true, "asset_type": "native" }, { "balance": "string", "limit": "string", "buying_liabilites": "string", "selling_liabilites": "string", "sponser": "string", "last_modified_ledger": 0, "is_authorized": true, "is_authorized_to_maintain_liabilites": true, "is_clawback_enabled": true, "asset_type": "native", "asset_code": "string", "asset_issuer": "string" }, { "liquidity_pool_id": "string", "asset_type": "liquidity_pool_shares", "balance": "string", "limit": "string", "last_modified_ledger": 0, "sponser": "string", "is_authorized": true, "is_authorized_to_maintain_liabilites": true, "is_clawback_enabled": true } ], "signers": [ { "key": "string", "weight": 0, "type": "ed25519_public_key", "sponser": "string" } ], "data": {}, "num_sponsoring": 0, "num_sponsered": 0, "sponser": "string", "paging_token": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts{?signer,sponsor,asset,liquidity_pool,cursor,limit,order} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts{?signer,sponsor,asset,liquidity_pool,cursor,limit,order} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/accounts?cursor=\u0026limit=2\u0026order=desc\u0026signer=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U" }, "next": { "href": "https://rpc.ankr.com/accounts?cursor=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U\u0026limit=2\u0026order=desc\u0026signer=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U" }, "prev": { "href": "https://rpc.ankr.com/accounts?cursor=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U\u0026limit=2\u0026order=asc\u0026signer=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U" }, "transactions": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/transactions{?cursor,limit,order}", "templated": true }, "operations": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/operations{?cursor,limit,order}", "templated": true }, "payments": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/payments{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/effects{?cursor,limit,order}", "templated": true }, "offers": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/offers{?cursor,limit,order}", "templated": true }, "trades": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/trades{?cursor,limit,order}", "templated": true }, "data": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/data/{key}", "templated": true } }, "id": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U", "account_id": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U", "sequence": "24739097524306474", "subentry_count": 3, "inflation_destination": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U", "home_domain": "tempo.eu.com", "last_modified_ledger": 46469501, "last_modified_time": null, "thresholds": { "low_threshold": 5, "med_threshold": 0, "high_threshold": 0 }, "flags": { "auth_required": false, "auth_revocable": true, "auth_immutable": false, "auth_clawback_enabled": false }, "balances": [ { "balance": "0.0000000", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 40074670, "is_authorized": true, "is_authorized_to_maintain_liabilities": true, "asset_type": "credit_alphanum4", "asset_code": "EURT", "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { "balance": "0.0000000", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 20213845, "is_authorized": true, "is_authorized_to_maintain_liabilities": true, "asset_type": "credit_alphanum4", "asset_code": "NGN", "asset_issuer": "GCC4YLCR7DDWFCIPTROQM7EB2QMFD35XRWEQVIQYJQHVW6VE5MJZXIGW" }, { "balance": "0.0000000", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 7877447, "is_authorized": false, "is_authorized_to_maintain_liabilities": false, "asset_type": "credit_alphanum4", "asset_code": "PHP", "asset_issuer": "GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" }, { "balance": "80.8945748", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "asset_type": "native" } ], "signers": [ { "weight": 10, "key": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U", "type": "ed25519_public_key" } ], "data": {}, "num_sponsoring": 0, "num_sponsored": 0, "paging_token": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U" } ] } } ``` --- ## Accounts ### `GET /accounts/{account_id}` > Retrieves account info by account ID. The single account endpoint provides information on a specific account. The balances section in the response will also list all the trust lines this account has established, including trust lines that haven’t been authorized yet. #### Parameters * `account_id` (string; path; required): the account’s public key encoded in a base32 string representation. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "transactions": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "payments": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "offers": { "href": "string", "templated": true }, "trades": { "href": "string", "templated": true }, "data": { "href": "string", "templated": true } }, "id": "string", "account_id": "string", "sequence": "string", "sequence_ledger": 0, "sequence_time": "string", "subentry_count": 0, "inflation_destination": "string", "home_domain": "string", "last_modified_ledger": 0, "last_modified_time": "string", "thresholds": { "low_threshold": 0, "med_threshold": 0, "high_threshold": 0 }, "flags": { "auth_required": true, "auth_revocable": true, "auth_immutable": true, "auth_clawback_enabled": true }, "balances": [ { "balance": "string", "liquidity_pool_id": "string", "limit": "string", "buying_liabilites": "string", "selling_liabilites": "string", "sponser": "string", "last_modified_ledger": 0, "is_authorized": true, "is_authorized_to_maintain_liabilites": true, "is_clawback_enabled": true, "asset_type": "native" }, { "balance": "string", "limit": "string", "buying_liabilites": "string", "selling_liabilites": "string", "sponser": "string", "last_modified_ledger": 0, "is_authorized": true, "is_authorized_to_maintain_liabilites": true, "is_clawback_enabled": true, "asset_type": "native", "asset_code": "string", "asset_issuer": "string" }, { "liquidity_pool_id": "string", "asset_type": "liquidity_pool_shares", "balance": "string", "limit": "string", "last_modified_ledger": 0, "sponser": "string", "is_authorized": true, "is_authorized_to_maintain_liabilites": true, "is_clawback_enabled": true } ], "signers": [ { "key": "string", "weight": 0, "type": "ed25519_public_key", "sponser": "string" } ], "data": {}, "num_sponsoring": 0, "num_sponsered": 0, "sponser": "string", "paging_token": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts/{account_id} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA" }, "transactions": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/transactions{?cursor,limit,order}", "templated": true }, "operations": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/operations{?cursor,limit,order}", "templated": true }, "payments": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/payments{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/effects{?cursor,limit,order}", "templated": true }, "offers": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/offers{?cursor,limit,order}", "templated": true }, "trades": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/trades{?cursor,limit,order}", "templated": true }, "data": { "href": "https://rpc.ankr.com/accounts/GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA/data/{key}", "templated": true } }, "id": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA", "account_id": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA", "sequence": "120192344968520093", "subentry_count": 6, "last_modified_ledger": 48375369, "last_modified_time": null, "thresholds": { "low_threshold": 0, "med_threshold": 0, "high_threshold": 0 }, "flags": { "auth_required": false, "auth_revocable": false, "auth_immutable": false, "auth_clawback_enabled": false }, "balances": [ { "balance": "1.0000000", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 27984972, "is_authorized": true, "is_authorized_to_maintain_liabilities": true, "asset_type": "credit_alphanum4", "asset_code": "BB1", "asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN" }, { "balance": "20.0000000", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 27984988, "is_authorized": true, "is_authorized_to_maintain_liabilities": true, "asset_type": "credit_alphanum4", "asset_code": "CNY", "asset_issuer": "GAREELUB43IRHWEASCFBLKHURCGMHE5IF6XSE7EXDLACYHGRHM43RFOX" }, { "balance": "3.0000008", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 34781349, "is_authorized": true, "is_authorized_to_maintain_liabilities": true, "asset_type": "credit_alphanum4", "asset_code": "EURT", "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { "balance": "194.9999990", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 28524340, "is_authorized": true, "is_authorized_to_maintain_liabilities": true, "asset_type": "credit_alphanum4", "asset_code": "NGNT", "asset_issuer": "GAWODAROMJ33V5YDFY3NPYTHVYQG7MJXVJ2ND3AOGIHYRWINES6ACCPD" }, { "balance": "2.5000000", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 29107236, "is_authorized": true, "is_authorized_to_maintain_liabilities": true, "asset_type": "credit_alphanum4", "asset_code": "USD", "asset_issuer": "GBNLJIYH34UWO5YZFA3A3HD3N76R6DOI33N4JONUOHEEYZYCAYTEJ5AK" }, { "balance": "3.1200000", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 29882476, "is_authorized": true, "is_authorized_to_maintain_liabilities": true, "asset_type": "credit_alphanum4", "asset_code": "USD", "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX" }, { "balance": "15.7298615", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "asset_type": "native" } ], "signers": [ { "weight": 1, "key": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA", "type": "ed25519_public_key" } ], "data": {}, "num_sponsoring": 0, "num_sponsored": 0, "paging_token": "GAYOLLLUIZE4DZMBB2ZBKGBUBZLIOYU6XFLW37GBP2VZD3ABNXCW4BVA" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/assets-p2/ title: Stellar — Assets, Claimable balances, Effects, Ledgers (2/3) source: docs/rpc-service/chains/chains-api/stellar/assets-p2.mdx --- # Stellar — Assets, Claimable balances, Effects, Ledgers (2/3) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/stellar/assets/) · 2 · [3](/rpc-service/chains/chains-api/stellar/assets-p3/) ## Claimable balances A claimable balance represents the transfer of ownership of some amount of an asset. Claimable balances provide a mechanism for setting up a payment which can be claimed in the future. This allows you to make payments to accounts which are currently not able to accept them. ### `GET /claimable_balances` > Lists all claimable balances. This endpoint lists all available claimable balances. #### Parameters * `sponsor` (string; query): an account ID of the sponsor. Every account in the response will either be sponsored by the given account ID or have a sub-entry (trustline, offer, or data entry) which is sponsored by the given account ID. * `asset` (any; query): an issued asset represented as “Code:IssuerAccountID”. Every account in the response will have a trustline for the given asset. * `claimant` (any; query): an account ID of the destination address. Only include claimable balances which can be claimed by the given account ID. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "transactions": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "asset": "string", "amount": "string", "sponsor": "string", "last_modified_ledger": "string", "last_modified_time": "string", "claimants": [ { "destination": "string", "predicate": { "and": [ { "or": [ { "relBefore": "string", "absBefore": "string", "absBeforeEpoch": "string" } ], "not": { "unconditional": true, "relBefore": "string", "absBefore": "string", "absBeforeEpoch": "string" } } ] } } ], "flags": 0 } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances{?asset,sponsor,claimant,cursor,limit,order} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances{?asset,sponsor,claimant,cursor,limit,order} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/claimable_balances?asset=native\u0026cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/claimable_balances?asset=native\u0026cursor=33324106-00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/claimable_balances?asset=native\u0026cursor=33324106-00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/claimable_balances/00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f" }, "transactions": { "href": "https://rpc.ankr.com/claimable_balances/00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f/transactions{?cursor,limit,order}", "templated": true }, "operations": { "href": "https://rpc.ankr.com/claimable_balances/00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f/operations{?cursor,limit,order}", "templated": true } }, "id": "00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f", "asset": "native", "amount": "0.1000000", "sponsor": "GDOZMXWISPB57FITUQIGTFH2KNNW7QTFESXF5DZEAMZK6QHE3KVO5TRT", "last_modified_ledger": 33324106, "last_modified_time": null, "claimants": [ { "destination": "GCD3T6UIQLYZPGRCYVSE7LKQB5HYYNVT7ENY6RCSFRFQYR5JTBDCECO3", "predicate": { "and": [ { "abs_before": "2020-12-30T23:03:56Z", "abs_before_epoch": "1609369436" }, { "not": { "abs_before": "2020-12-30T23:05:56Z", "abs_before_epoch": "1609369556" } } ] } } ], "flags": { "clawback_enabled": false }, "paging_token": "33324106-00000000691787983bc3ea12361092fe49ae83cbbe37804ee1590fe2b9b3e3860fc8261f" } ] } } ``` --- ### `GET /claimable_balances/{claimable_balance_id}` > Retrieves a particular claimable balance. The single claimable balance endpoint provides information on a claimable balance. #### Parameters * `claimable_balance_id` (string; path; required): a unique identifier for this claimable balance. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "transactions": { "href": "string", "templated": true } }, "id": "string", "asset": "string", "amount": "string", "sponsor": "string", "last_modified_ledger": "string", "last_modified_time": "string", "claimants": [ { "destination": "string", "predicate": { "and": [ { "or": [ { "relBefore": "string", "absBefore": "string", "absBeforeEpoch": "string" } ], "not": { "unconditional": true, "relBefore": "string", "absBefore": "string", "absBeforeEpoch": "string" } } ] } } ], "flags": 0, "paging_token": "string" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances/{claimable_balance_id} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances/{claimable_balance_id} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000" }, "operations": { "href": "https://rpc.ankr.com/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000/operations{?cursor,limit,order}", "templated": true }, "transactions": { "href": "https://rpc.ankr.com/claimable_balances/000000000102030000000000000000000000000000000000000000000000000000000000/transactions{?cursor,limit,order}", "templated": true } }, "id": "000000000102030000000000000000000000000000000000000000000000000000000000", "paging_token": "000000000102030000000000000000000000000000000000000000000000000000000000", "asset": "native", "amount": "10.0000000", "claimants": [ { "destination": "GC3C4AKRBQLHOJ45U4XG35ESVWRDECWO5XLDGYADO6DPR3L7KIDVUMML", "predicate": { "and": [ { "or": [ { "relBefore": "12" }, { "absBefore": "2020-08-26T11:15:39Z", "absBeforeEpoch": "1598440539" } ] }, { "not": { "unconditional": true } } ] } } ], "last_modified_ledger": 28411995, "last_modified_time": "2020-02-26T19:29:16Z" } ``` --- ### `GET /claimable_balances/{claimable_balance_id}/transactions` > Retrieves transactions of a particular claimable balance. This endpoint represents successful transactions referencing a given claimable balance and can be used in streaming mode. Streaming mode allows you to listen for new transactions referencing this claimable balance as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known transaction unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream transactions created since your request time. #### Parameters * `claimable_balance_id` (string; path; required): a unique identifier for this claimable balance. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "memo": "string", "_links": { "self": { "href": "string", "templated": true }, "account": { "href": "string", "templated": true }, "ledger": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "successful": true, "hash": "string", "ledger": 0, "created_at": "string", "source_account": "string", "account_muxed": "string", "account_muxed_id": "string", "source_account_sequence": "string", "fee_account": "string", "fee_account_muxed": "string", "fee_account_muxed_id": "string", "fee_charged": "string", "max_fee": "string", "operation_count": 0, "envelope_xdr": "string", "result_xdr": "string", "result_meta_xdr": "string", "fee_meta_xdr": "string", "memo_type": "string", "signatures": [ "string" ], "valid_after": "string", "valid_before": "string", "preconditions": { "timebounds": { "min_time": "string", "max_time": "string" }, "ledgerbounds": { "min_ledger": "string", "max_ledger": "string" }, "min_account_sequence": "string", "min_account_sequence_age": "string", "min_account_sequence_ledger_gap": 0, "extra_signers": [ "string" ] }, "fee_bump_transaction": { "hash": "string", "signatures": [ "string" ] }, "inner_transaction": { "hash": "string", "signatures": [ "string" ], "max_fee": "string" } } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances/{claimable_balance_id}/transactions{?cursor,order,limit,include_failed} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances/{claimable_balance_id}/transactions{?cursor,order,limit,include_failed} \ -H 'Accept: text/event-stream' ``` #### Response ```json { "_links": { "self": { "href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/transactions?cursor=&limit=2&order=asc" }, "next": { "href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/transactions?cursor=140648659841806336&limit=2&order=asc" }, "prev": { "href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/transactions?cursor=140648659841806336&limit=2&order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/transactions/fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8" }, "account": { "href": "https://rpc.ankr.com/accounts/GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF" }, "ledger": { "href": "https://rpc.ankr.com/ledgers/32747318" }, "operations": { "href": "https://rpc.ankr.com/transactions/fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8/operations{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/transactions/fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8/effects{?cursor,limit,order}", "templated": true }, "precedes": { "href": "https://rpc.ankr.com/transactions?order=asc&cursor=140648659841806336" }, "succeeds": { "href": "https://rpc.ankr.com/transactions?order=desc&cursor=140648659841806336" }, "transaction": { "href": "https://rpc.ankr.com/transactions/fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8" } }, "id": "fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8", "paging_token": "140648659841806336", "successful": true, "hash": "fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8", "ledger": 32747318, "created_at": "2020-11-23T16:02:38Z", "source_account": "GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF", "source_account_sequence": "140646847365513218", "fee_account": "GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF", "fee_charged": "100", "max_fee": "100", "operation_count": 1, "envelope_xdr": "AAAAAgAAAADElBx79rbhYaf3aUgLbVm0P2BNEN+aLisS3A/6YYRX4AAAAGQB862QAAAAAgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAADgAAAAJCT0RISQAAAAAAAAAAAAAAxJQce/a24WGn92lIC21ZtD9gTRDfmi4rEtwP+mGEV+AAAAAAAA9CQAAAAAEAAAAAAAAAAElBqA1BXzKd9k9nuPoodv0YBKY+Hgh6Uz/UxozgnvyzAAAAAAAAAAAAAAABYYRX4AAAAEDf41ykW+eq8IVpJNOc4iDaht5Beil8NpQB8WMHkOxW3rocUBF3EHKqUXDIsD9CzzY7Xr1PbzVk5FZ4iBKNF4MM", "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAAOAAAAAAAAAAAXiCb7/jOeH1xTQXxv7f4sBei+wUMDFD7EaziYGwnD+QAAAAA=", "result_meta_xdr": "AAAAAgAAAAIAAAADAfOvNgAAAAAAAAAAxJQce/a24WGn92lIC21ZtD9gTRDfmi4rEtwP+mGEV+AAAAAAAcnCVAHzrZAAAAABAAAAAAAAAAAAAAAAAAAAD2dpdmluZ2JvZGhpLm9yZwABAAAAAAAAAAAAAAAAAAAAAAAAAQHzrzYAAAAAAAAAAMSUHHv2tuFhp/dpSAttWbQ/YE0Q35ouKxLcD/phhFfgAAAAAAHJwlQB862QAAAAAgAAAAAAAAAAAAAAAAAAAA9naXZpbmdib2RoaS5vcmcAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAwHzrzYAAAAAAAAAAMSUHHv2tuFhp/dpSAttWbQ/YE0Q35ouKxLcD/phhFfgAAAAAAHJwlQB862QAAAAAgAAAAAAAAAAAAAAAAAAAA9naXZpbmdib2RoaS5vcmcAAQAAAAAAAAAAAAAAAAAAAAAAAAEB8682AAAAAAAAAADElBx79rbhYaf3aUgLbVm0P2BNEN+aLisS3A/6YYRX4AAAAAABycJUAfOtkAAAAAIAAAAAAAAAAAAAAAAAAAAPZ2l2aW5nYm9kaGkub3JnAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAfOvNgAAAAQAAAAAF4gm+/4znh9cU0F8b+3+LAXovsFDAxQ+xGs4mBsJw/kAAAABAAAAAAAAAABJQagNQV8ynfZPZ7j6KHb9GASmPh4IelM/1MaM4J78swAAAAAAAAACQk9ESEkAAAAAAAAAAAAAAMSUHHv2tuFhp/dpSAttWbQ/YE0Q35ouKxLcD/phhFfgAAAAAAAPQkAAAAAAAAAAAQAAAAEAAAAAxJQce/a24WGn92lIC21ZtD9gTRDfmi4rEtwP+mGEV+AAAAAAAAAAAA==", "fee_meta_xdr": "AAAAAgAAAAMB866UAAAAAAAAAADElBx79rbhYaf3aUgLbVm0P2BNEN+aLisS3A/6YYRX4AAAAAABycK4AfOtkAAAAAEAAAAAAAAAAAAAAAAAAAAPZ2l2aW5nYm9kaGkub3JnAAEAAAAAAAAAAAAAAAAAAAAAAAABAfOvNgAAAAAAAAAAxJQce/a24WGn92lIC21ZtD9gTRDfmi4rEtwP+mGEV+AAAAAAAcnCVAHzrZAAAAABAAAAAAAAAAAAAAAAAAAAD2dpdmluZ2JvZGhpLm9yZwABAAAAAAAAAAAAAAAAAAAA", "memo_type": "none", "signatures": [ "3+NcpFvnqvCFaSTTnOIg2obeQXopfDaUAfFjB5DsVt66HFARdxByqlFwyLA/Qs82O169T281ZORWeIgSjReDDA==" ], "valid_after": "1970-01-01T00:00:00Z", "preconditions": { "timebounds": { "min_time": "0" } } } ] } } ``` --- ### `GET /claimable_balances/{claimable_balance_id}/operations` > Retrieves operations of a particular claimable balance. This endpoint represents successful operations referencing a given claimable balance and can be used in streaming mode. Streaming mode allows you to listen for new operations referencing this claimable balance as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known operation unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream operations created since your request time. #### Parameters * `claimable_balance_id` (string; path; required): a unique identifier for this claimable balance. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. * `join` (any; query): set to `transactions` to include the transactions which created each of the operations in the response. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "transaction_successful": true, "source_account": "string", "type": "create_account", "type_i": 0, "created_at": "string", "transaction_hash": "string", "starting_balance": "string", "funder": "string", "account": "string" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances/{claimable_balance_id}/operations{?cursor,order,limit,include_failed,join} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/claimable_balances/{claimable_balance_id}/operations{?cursor,order,limit,include_failed,join} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/operations?cursor=&limit=3&order=asc" }, "next": { "href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/operations?cursor=140648659841806337&limit=3&order=asc" }, "prev": { "href": "https://rpc.ankr.com/claimable_balances/00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9/operations?cursor=140648659841806337&limit=3&order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/operations/140648659841806337" }, "transaction": { "href": "https://rpc.ankr.com/transactions/fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8" }, "effects": { "href": "https://rpc.ankr.com/operations/140648659841806337/effects" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc&cursor=140648659841806337" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc&cursor=140648659841806337" } }, "id": "140648659841806337", "paging_token": "140648659841806337", "transaction_successful": true, "source_account": "GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF", "type": "create_claimable_balance", "type_i": 14, "created_at": "2020-11-23T16:02:38Z", "transaction_hash": "fc5a98fc3869df408ebd4ac1c2e3fefec8b0a858e82ff1d14e362676708b91e8", "sponsor": "GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF", "asset": "BODHI:GDCJIHD3623OCYNH65UUQC3NLG2D6YCNCDPZULRLCLOA76TBQRL6A3TF", "amount": "0.1000000", "claimants": [ { "destination": "GBEUDKANIFPTFHPWJ5T3R6RIO36RQBFGHYPAQ6STH7KMNDHAT36LHOLD", "predicate": { "unconditional": true } } ] } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/assets-p3/ title: Stellar — Assets, Claimable balances, Effects, Ledgers (3/3) source: docs/rpc-service/chains/chains-api/stellar/assets-p3.mdx --- # Stellar — Assets, Claimable balances, Effects, Ledgers (3/3) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/stellar/assets/) · [2](/rpc-service/chains/chains-api/stellar/assets-p2/) · 3 ## Effects Effects represent specific changes that occur in the ledger as a result of successful operations, but are not necessarily directly reflected in the ledger or history, as transactions and operations are. ### `GET /effects` > Lists all effects. This endpoint lists all effects and can be used in streaming mode. Streaming mode allows you to listen for new effects as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time. #### Parameters * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "account": "string", "type": "Account Created", "type_i": 1, "created_at": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/effects{?curson,order,limit} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/effects{?curson,order,limit} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/effects?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/effects?cursor=211459450643517441-1\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/effects?cursor=211459450643517441-1\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "https://rpc.ankr.com/operations/211459450643517441" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=211459450643517441-1" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=211459450643517441-1" } }, "id": "0211459450643517441-0000000001", "paging_token": "211459450643517441-1", "account": "GCV7NQTKV3ZZGC366FYVH2XOSZBOTQIOTHG7JJFJJP2XKCLGEYUZHRRR", "type": "account_credited", "type_i": 2, "created_at": "2023-11-29T10:37:29Z", "asset_type": "native", "amount": "0.0251621" } ] } } ``` --- ## Ledgers Each ledger stores the state of the network at a point in time and contains all the changes - transactions, operations, effects, etc. - to that state. ### `GET /ledgers` > List all ledgers. This endpoint lists all ledgers and can be used in streaming mode. Streaming mode allows you to listen for new ledgers as they close. If called in streaming mode, Horizon will start at the earliest known ledger unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream ledgers since your request time. #### Parameters * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "transactions": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "payments": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "hash": "string", "pre_hash": "string", "sequence": 0, "successful_transaction_count": 0, "failed_transaction_count": 0, "operation_count": 0, "tx_set_operation_count": 0, "closed_at": "string", "total_coins": "string", "fee_pool": "string", "base_fee_in_stroops": 0, "base_reserve_in_stroops": 0, "max_tx_set_size": 0, "protocol_version": 0, "header_xdr": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers{?curson,order,limit} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers{?curson,order,limit} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/ledgers?cursor=\u0026limit=2\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/ledgers?cursor=211459454938382336\u0026limit=2\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/ledgers?cursor=211459450643415040\u0026limit=2\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/ledgers/49234240" }, "transactions": { "href": "https://rpc.ankr.com/ledgers/49234240/transactions{?cursor,limit,order}", "templated": true }, "operations": { "href": "https://rpc.ankr.com/ledgers/49234240/operations{?cursor,limit,order}", "templated": true }, "payments": { "href": "https://rpc.ankr.com/ledgers/49234240/payments{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/ledgers/49234240/effects{?cursor,limit,order}", "templated": true } }, "id": "5265a451c307cfca00bca3931a0abce38c34010a88260c52b0569881ef820d45", "paging_token": "211459450643415040", "hash": "5265a451c307cfca00bca3931a0abce38c34010a88260c52b0569881ef820d45", "prev_hash": "f0aac2ec4af61e88481b1b47c79d346041fe1a09d6a43c24bcaf416acd937f75", "sequence": 49234240, "successful_transaction_count": 153, "failed_transaction_count": 47, "operation_count": 494, "tx_set_operation_count": 673, "closed_at": "2023-11-29T10:37:29Z", "total_coins": "105443902087.3472865", "fee_pool": "4270449.1081721", "base_fee_in_stroops": 100, "base_reserve_in_stroops": 5000000, "max_tx_set_size": 1000, "protocol_version": 19, "header_xdr": "AAAAE/CqwuxK9h6ISBsbR8edNGBB/hoJ1qQ8JLyvQWrNk391dpkM53++2Odc2P3uwVpsimH3sW1rfHemGyOle94syIIAAAAAZWcUaQAAAAAAAAABAAAAAFMKIvR3Lya8FJ+cNeaJjXTX3wCSqBxw3WYftnPvFVHeAAAAQHDQ+BSiecIZ2eYWRwR+r8v3rUXz1IpU32/kosKtPS/zStlrBvqi6moxShcT4mHzqyov8VA2FIhzSqznIoLsyQvFjIxal5BMXIRP6LE2pVbuhI3iJ5iGbOy1s90z0Cfu1/Lz1I1vlBmRsfKzQc8JP2pkawR/gktVJgRTbNaIMTwTAu9BQA6iHrPseVthAAAm1uoFb/kAAAEWAAAAAFREgMsAAABkAExLQAAAA+jiy/A54/0RJsdgB3p3iG4xmmfch6G208T/VI/BFUv4ERjxmfiAnjFIK14tlbcrLvvGX9DEM6kTlFV7U3tfHISPWobdcbkpe4hlTxt+iUMnU6fqMLuFDMYBLwL7kvSbsnWSMMEe8/r7pDlxCuKa1eY4rqGQf8oaUCJcZ4Og+zrIwQAAAAA=" }, { "_links": { "self": { "href": "https://rpc.ankr.com/ledgers/49234241" }, "transactions": { "href": "https://rpc.ankr.com/ledgers/49234241/transactions{?cursor,limit,order}", "templated": true }, "operations": { "href": "https://rpc.ankr.com/ledgers/49234241/operations{?cursor,limit,order}", "templated": true }, "payments": { "href": "https://rpc.ankr.com/ledgers/49234241/payments{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/ledgers/49234241/effects{?cursor,limit,order}", "templated": true } }, "id": "a3f6611d47eb0303cd0352a7b6bcecfe540d3c82d4ea85b7c3d0d494ea89d260", "paging_token": "211459454938382336", "hash": "a3f6611d47eb0303cd0352a7b6bcecfe540d3c82d4ea85b7c3d0d494ea89d260", "prev_hash": "5265a451c307cfca00bca3931a0abce38c34010a88260c52b0569881ef820d45", "sequence": 49234241, "successful_transaction_count": 174, "failed_transaction_count": 50, "operation_count": 452, "tx_set_operation_count": 874, "closed_at": "2023-11-29T10:37:35Z", "total_coins": "105443902087.3472865", "fee_pool": "4270449.1171621", "base_fee_in_stroops": 100, "base_reserve_in_stroops": 5000000, "max_tx_set_size": 1000, "protocol_version": 19, "header_xdr": "AAAAE1JlpFHDB8/KALyjkxoKvOOMNAEKiCYMUrBWmIHvgg1FALlcFm56tDS2cb0ia8B+N6yLaiJXuQLWsWa74aQmM0wAAAAAZWcUbwAAAAAAAAABAAAAAALFJZ5Gu3RxX6evZlFupBENfCKbFy8HGJOsqYaXrFMrAAAAQLrU3H1O/MbfNJ7vmCQY0fRXyDtdaYnBqOATsrPsiMbrRU80fmRMEIGZgb58GPEaZdpZXxHcVPirZQf3VvNvQwyWO71I7+SuPAtJRllRAeexSnqrFApXvxsS0uatsDbtJ+uZq+JZS9bso557+bjqki7e5+7EyGZ7sDxzoZEqSqBlAu9BQQ6iHrPseVthAAAm1uoGzyUAAAEWAAAAAFREgU0AAABkAExLQAAAA+jiy/A54/0RJsdgB3p3iG4xmmfch6G208T/VI/BFUv4ERjxmfiAnjFIK14tlbcrLvvGX9DEM6kTlFV7U3tfHISPWobdcbkpe4hlTxt+iUMnU6fqMLuFDMYBLwL7kvSbsnWSMMEe8/r7pDlxCuKa1eY4rqGQf8oaUCJcZ4Og+zrIwQAAAAA=" } ] } } ``` --- ### `GET /ledgers/{sequence}` > Retrieves a particular ledger. The single ledger endpoint provides information on a specific ledger. #### Parameters * `sequence` (integer; path; required): the sequence number of a specific ledger. #### Returns ```json { "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "transactions": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "payments": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "hash": "string", "pre_hash": "string", "sequence": 0, "successful_transaction_count": 0, "failed_transaction_count": 0, "operation_count": 0, "tx_set_operation_count": 0, "closed_at": "string", "total_coins": "string", "fee_pool": "string", "base_fee_in_stroops": 0, "base_reserve_in_stroops": 0, "max_tx_set_size": 0, "protocol_version": 0, "header_xdr": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/ledgers/27146933" }, "transactions": { "href": "https://rpc.ankr.com/ledgers/27146933/transactions{?cursor,limit,order}", "templated": true }, "operations": { "href": "https://rpc.ankr.com/ledgers/27146933/operations{?cursor,limit,order}", "templated": true }, "payments": { "href": "https://rpc.ankr.com/ledgers/27146933/payments{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/ledgers/27146933/effects{?cursor,limit,order}", "templated": true } }, "id": "e1218a337cecda05526fba902c61d3d7130baa58d8db41f544bf563f779b6329", "paging_token": "116595189421703168", "hash": "e1218a337cecda05526fba902c61d3d7130baa58d8db41f544bf563f779b6329", "prev_hash": "9eac16fecd885147067b58b7684f60d216f931b813f651265bbc97de4cea313d", "sequence": 27146933, "successful_transaction_count": 26, "failed_transaction_count": 9, "operation_count": 67, "closed_at": "2019-12-06T22:39:32Z", "total_coins": "105443902087.3472865", "fee_pool": "1807264.7509661", "base_fee_in_stroops": 100, "base_reserve_in_stroops": 5000000, "max_tx_set_size": 1000, "protocol_version": 12, "header_xdr": "AAAADJ6sFv7NiFFHBntYt2hPYNIW+TG4E/ZRJlu8l95M6jE9bsvzId+Gtul2mNMW4UZQ+KqSb/nbN8F1CTxAfQsyUy8AAAAAXerYpAAAAAAAAAAAXQNpS8daKGZUeY5quYUcIiJZBMB7LiLsZJsEx9qw79fx99Bu/lk+sIePNUNcuOC2euthzfhLuWJ1nZBuoQFDjgGeOrUOoh6z7HlbYQAAEG/dvCadAAABFgAAAAAIOwAqAAAAZABMS0AAAAPooSNtHXJNJKKWlBtgkAM1LBxzlzYjIlS0xwpjP+uCi76fQj59wgTy0+xtx7O1qTb+W6zcI2zWZnrUU/8v8RZHFBfoo20QYKh95+wWr348yZAexZpdrjhyCxbChxlVTZOX6nZfIgcYBMnZRkOTCLdPO76yeqpDhqu9KrPe3YPTO3wAAAAA" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/assets/ title: Stellar — Assets, Claimable balances, Effects, Ledgers (1/3) source: docs/rpc-service/chains/chains-api/stellar/assets.mdx --- # Stellar — Assets, Claimable balances, Effects, Ledgers (1/3) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/stellar/assets-p2/) · [3](/rpc-service/chains/chains-api/stellar/assets-p3/) ## Assets Assets are representations of value issued on the Stellar network. An asset consists of a type, code, and issuer. ### `GET /assets` > Lists all assets. This endpoint lists all assets. #### Parameters * `asset_code` (any; query): the code of the asset you would like to filter by. * `asset_issuer` (any; query): the Stellar address of the issuer for the asset you would like to filter by. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "toml": { "href": "string", "templated": true } }, "asset_type": "string", "asset_issuer": "string", "paging_token": "string", "accounts": { "authorized": 0, "authorized_to_maintain_liabilities": 0, "unauthorized": 0 }, "num_claimable_balances": 0, "num_contracts": 0, "num_liquidity_pools": 0, "balances": { "authorized": "string", "authorized_to_maintain_liabilities": "string", "unauthorized": "string" }, "claimable_balances_amount": "string", "contracts_amount": "string", "liquidity_pools_amount": "string", "amount": "string", "num_accounts": 0, "flags": { "auth_required": true, "auth_revocable": true, "auth_immutable": true } } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/assets{?asset_code,asset_issuer,cursor,limit,order} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/assets{?asset_code,asset_issuer,cursor,limit,order} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/assets?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/assets?cursor=0_GBBJZOYEGLOCW32Q4ZGWRWQ7UKIGMMIQXIRBBBOVJVFJTZW7CR2VQKAT_credit_alphanum4\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/assets?cursor=0_GBBJZOYEGLOCW32Q4ZGWRWQ7UKIGMMIQXIRBBBOVJVFJTZW7CR2VQKAT_credit_alphanum4\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "toml": { "href": "https://emily.stellarskull.io/.well-known/stellar.toml" } }, "asset_type": "credit_alphanum4", "asset_code": "0", "asset_issuer": "GBBJZOYEGLOCW32Q4ZGWRWQ7UKIGMMIQXIRBBBOVJVFJTZW7CR2VQKAT", "paging_token": "0_GBBJZOYEGLOCW32Q4ZGWRWQ7UKIGMMIQXIRBBBOVJVFJTZW7CR2VQKAT_credit_alphanum4", "num_accounts": 24, "num_claimable_balances": 0, "num_liquidity_pools": 0, "amount": "998.9481303", "accounts": { "authorized": 24, "authorized_to_maintain_liabilities": 0, "unauthorized": 0 }, "claimable_balances_amount": "0.0000000", "liquidity_pools_amount": "0.0000000", "balances": { "authorized": "998.9481303", "authorized_to_maintain_liabilities": "0.0000000", "unauthorized": "0.0000000" }, "flags": { "auth_required": false, "auth_revocable": false, "auth_immutable": false, "auth_clawback_enabled": false } } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/ title: Stellar description: Stellar is a layer-1 open-source, decentralized, peer-to-peer blockchain network that provides a framework for… Available on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/stellar/index.mdx --- # Stellar
> Stellar API is available on [Web3 API platform](https://www.ankr.com/rpc/stellar). *Stellar* is a layer-1 open-source, decentralized, peer-to-peer blockchain network that provides a framework for developers to create applications, issue assets, and connect to existing financial rails. Stellar is designed to enable creators, innovators, and developers to build projects on the network that can interoperate with each other. For Stellar, we support blockchain interaction via the following methods: * [Horizon REST](/rpc-service/chains/chains-api/stellar/#horizon-rest-methods) * [Soroban JSON-RPC](/rpc-service/chains/chains-api/stellar/transactions/#soroban-json-rpc-methods) ## Horizon REST methods **Accounts**: * [`GET /accounts`](/rpc-service/chains/chains-api/stellar/accounts/#get-accounts) — lists all accounts. * [`GET /accounts/{account_id}`](/rpc-service/chains/chains-api/stellar/accounts/#get-accountsaccount_id) — retrieves a particular account. * [`GET /accounts/{account_id}/transactions`](/rpc-service/chains/chains-api/stellar/accounts-p2/#get-accountsaccount_idtransactions) — retrieves an account's transactions. * [`GET /accounts/{account_id}/operations`](/rpc-service/chains/chains-api/stellar/accounts-p2/#get-accountsaccount_idoperations) — retrieves an account's operations. * [`GET /accounts/{account_id}/payments`](/rpc-service/chains/chains-api/stellar/accounts-p2/#get-accountsaccount_idpayments) — retrieves an account's payments. * [`GET /accounts/{account_id}/effects`](/rpc-service/chains/chains-api/stellar/accounts-p2/#get-accountsaccount_ideffects) — retrieves an account's effects. * [`GET /accounts/{account_id}/offers`](/rpc-service/chains/chains-api/stellar/accounts-p3/#get-accountsaccount_idoffers) — retrieves an account's offers. * [`GET /accounts/{account_id}/trades`](/rpc-service/chains/chains-api/stellar/accounts-p3/#get-accountsaccount_idtrades) — retrieves an account's trades. * [`GET /accounts/{account_id}/data/{key}`](/rpc-service/chains/chains-api/stellar/accounts-p3/#get-accountsaccount_iddatakey) — retrieves an account's data. **Assets**: * [`GET /assets`](/rpc-service/chains/chains-api/stellar/assets/#get-assets) — lists all assets. **Claimable Balances**: * [`GET /claimable_balances`](/rpc-service/chains/chains-api/stellar/assets-p2/#get-claimable_balances) — lists all claimable balances. * [`GET /claimable_balances/{claimable_balance_id}`](/rpc-service/chains/chains-api/stellar/assets-p2/#get-claimable_balancesclaimable_balance_id) — retrieves a particular claimable balance. * [`GET /claimable_balances/{claimable_balance_id}/transactions`](/rpc-service/chains/chains-api/stellar/assets-p2/#get-claimable_balancesclaimable_balance_idtransactions) — retrieves transactions of a particular claimable balance. * [`GET /claimable_balances/{claimable_balance_id}/operations`](/rpc-service/chains/chains-api/stellar/assets-p2/#get-claimable_balancesclaimable_balance_idoperations) — retrieves operations of a particular claimable balance. **Effects**: * [`GET /effects`](/rpc-service/chains/chains-api/stellar/assets-p3/#get-effects) — lists all effects. **Ledgers**: * [`GET /ledgers`](/rpc-service/chains/chains-api/stellar/assets-p3/#get-ledgers) — lists all ledgers. * [`GET /ledgers/{sequence}`](/rpc-service/chains/chains-api/stellar/assets-p3/#get-ledgerssequence) — retrieves a particular ledger. * [`GET /ledgers/{sequence}/transactions`](/rpc-service/chains/chains-api/stellar/ledgers/#get-ledgerssequencetransactions) — retrieves transactions of a particular ledger. * [`GET /ledgers/{sequence}/operations`](/rpc-service/chains/chains-api/stellar/ledgers/#get-ledgerssequenceoperations) — retrieves operations of a particular ledger. * [`GET /ledgers/{sequence}/payments`](/rpc-service/chains/chains-api/stellar/ledgers/#get-ledgerssequencepayments) — retrieves payments of a particular ledger. * [`GET /ledgers/{sequence}/effects`](/rpc-service/chains/chains-api/stellar/ledgers/#get-ledgerssequenceeffects) — retrieves effects of a particular ledger. **Liquidity Pools**: * [`GET /liquidity_pools`](/rpc-service/chains/chains-api/stellar/ledgers-p2/#get-liquidity_pools) — lists all liquidity pools. * [`GET /liquidity_pools/{liquidity_pool_id}`](/rpc-service/chains/chains-api/stellar/ledgers-p2/#get-liquidity_poolsliquidity_pool_id) — retrieves a particular liquidity pool. * [`GET /liquidity_pools/{liquidity_pool_id}/effects`](/rpc-service/chains/chains-api/stellar/ledgers-p2/#get-liquidity_poolsliquidity_pool_ideffects) — retrieves effects of a particular liquidity pool. * [`GET /liquidity_pools/{liquidity_pool_id}/trades`](/rpc-service/chains/chains-api/stellar/ledgers-p2/#get-liquidity_poolsliquidity_pool_idtrades) — retrieves trades of a particular liquidity pool. * [`GET /liquidity_pools/{liquidity_pool_id}/transactions`](/rpc-service/chains/chains-api/stellar/liquidity-pools/#get-liquidity_poolsliquidity_pool_idtransactions) — retrieves transactions of a particular liquidity pool. * [`GET /liquidity_pools/{liquidity_pool_id}/operations`](/rpc-service/chains/chains-api/stellar/liquidity-pools/#get-liquidity_poolsliquidity_pool_idoperations) — retrieves operations of a particular liquidity pool. **Offers**: * [`GET /offers`](/rpc-service/chains/chains-api/stellar/liquidity-pools/#get-offers) — lists all offers. * [`GET /offers/{offer_id}`](/rpc-service/chains/chains-api/stellar/liquidity-pools/#get-offersoffer_id) — retrieves a particular offer. * [`GET /offers/{offer_id}/trades`](/rpc-service/chains/chains-api/stellar/liquidity-pools/#get-offersoffer_idtrades) — retrieves trades of a particular offer. **Operations**: * [`GET /operations`](/rpc-service/chains/chains-api/stellar/liquidity-pools-p2/#get-operations) — lists all operations. * [`GET /operations/{id}`](/rpc-service/chains/chains-api/stellar/liquidity-pools-p2/#get-operationsid) — retrieves a particular operation. * [`GET /operations/{id}/effects`](/rpc-service/chains/chains-api/stellar/liquidity-pools-p2/#get-operationsideffects) — retrieves effects of a particular operation. * [`GET /payments`](/rpc-service/chains/chains-api/stellar/liquidity-pools-p2/#get-payments) — lists all payments. **Trades**: * [`GET /trades`](/rpc-service/chains/chains-api/stellar/trades/#get-trades) — lists all trades. **Transactions**: * [`GET /transactions`](/rpc-service/chains/chains-api/stellar/trades-p2/#get-transactions) — lists all transactions. * [`POST /transactions`](/rpc-service/chains/chains-api/stellar/trades-p3/#post-transactions) — submits a transaction. * [`GET /transactions/{transaction_hash}`](/rpc-service/chains/chains-api/stellar/trades-p3/#get-transactionstransaction_hash) — retrieves a particular transaction. * [`GET /transactions/{transaction_id}/operations`](/rpc-service/chains/chains-api/stellar/trades-p3/#get-transactionstransaction_hashoperations) — retrieves operations of a particular transaction. * [`GET /transactions/{transaction_id}/effects`](/rpc-service/chains/chains-api/stellar/transactions/#get-transactionstransaction_hasheffects) — retrieves effects of a particular transaction. --- ## Methods ### Accounts - [`GET /accounts`](/rpc-service/chains/chains-api/stellar/accounts/#get-accounts) - [`GET /accounts/{account_id}`](/rpc-service/chains/chains-api/stellar/accounts/#get-accountsaccount_id) - [`GET /accounts/{account_id}/transactions`](/rpc-service/chains/chains-api/stellar/accounts-p2/#get-accountsaccount_idtransactions) - [`GET /accounts/{account_id}/operations`](/rpc-service/chains/chains-api/stellar/accounts-p2/#get-accountsaccount_idoperations) - [`GET /accounts/{account_id}/payments`](/rpc-service/chains/chains-api/stellar/accounts-p2/#get-accountsaccount_idpayments) - [`GET /accounts/{account_id}/effects`](/rpc-service/chains/chains-api/stellar/accounts-p2/#get-accountsaccount_ideffects) - [`GET /accounts/{account_id}/offers`](/rpc-service/chains/chains-api/stellar/accounts-p3/#get-accountsaccount_idoffers) - [`GET /accounts/{account_id}/trades`](/rpc-service/chains/chains-api/stellar/accounts-p3/#get-accountsaccount_idtrades) - [`GET /accounts/{account_id}/data/{key}`](/rpc-service/chains/chains-api/stellar/accounts-p3/#get-accountsaccount_iddatakey) ### Assets, Claimable balances, Effects, Ledgers - [`GET /assets`](/rpc-service/chains/chains-api/stellar/assets/#get-assets) - [`GET /claimable_balances`](/rpc-service/chains/chains-api/stellar/assets-p2/#get-claimable_balances) - [`GET /claimable_balances/{claimable_balance_id}`](/rpc-service/chains/chains-api/stellar/assets-p2/#get-claimable_balancesclaimable_balance_id) - [`GET /claimable_balances/{claimable_balance_id}/transactions`](/rpc-service/chains/chains-api/stellar/assets-p2/#get-claimable_balancesclaimable_balance_idtransactions) - [`GET /claimable_balances/{claimable_balance_id}/operations`](/rpc-service/chains/chains-api/stellar/assets-p2/#get-claimable_balancesclaimable_balance_idoperations) - [`GET /effects`](/rpc-service/chains/chains-api/stellar/assets-p3/#get-effects) - [`GET /ledgers`](/rpc-service/chains/chains-api/stellar/assets-p3/#get-ledgers) - [`GET /ledgers/{sequence}`](/rpc-service/chains/chains-api/stellar/assets-p3/#get-ledgerssequence) ### Ledgers, Liquidity pools - [`GET /ledgers/{sequence}/transactions`](/rpc-service/chains/chains-api/stellar/ledgers/#get-ledgerssequencetransactions) - [`GET /ledgers/{sequence}/operations`](/rpc-service/chains/chains-api/stellar/ledgers/#get-ledgerssequenceoperations) - [`GET /ledgers/{sequence}/payments`](/rpc-service/chains/chains-api/stellar/ledgers/#get-ledgerssequencepayments) - [`GET /ledgers/{sequence}/effects`](/rpc-service/chains/chains-api/stellar/ledgers/#get-ledgerssequenceeffects) - [`GET /liquidity_pools`](/rpc-service/chains/chains-api/stellar/ledgers-p2/#get-liquidity_pools) - [`GET /liquidity_pools/{liquidity_pool_id}`](/rpc-service/chains/chains-api/stellar/ledgers-p2/#get-liquidity_poolsliquidity_pool_id) - [`GET /liquidity_pools/{liquidity_pool_id}/effects`](/rpc-service/chains/chains-api/stellar/ledgers-p2/#get-liquidity_poolsliquidity_pool_ideffects) - [`GET /liquidity_pools/{liquidity_pool_id}/trades`](/rpc-service/chains/chains-api/stellar/ledgers-p2/#get-liquidity_poolsliquidity_pool_idtrades) ### Liquidity pools, Offers, Operations - [`GET /liquidity_pools/{liquidity_pool_id}/transactions`](/rpc-service/chains/chains-api/stellar/liquidity-pools/#get-liquidity_poolsliquidity_pool_idtransactions) - [`GET /liquidity_pools/{liquidity_pool_id}/operations`](/rpc-service/chains/chains-api/stellar/liquidity-pools/#get-liquidity_poolsliquidity_pool_idoperations) - [`GET /offers`](/rpc-service/chains/chains-api/stellar/liquidity-pools/#get-offers) - [`GET /offers/{offer_id}`](/rpc-service/chains/chains-api/stellar/liquidity-pools/#get-offersoffer_id) - [`GET /offers/{offer_id}/trades`](/rpc-service/chains/chains-api/stellar/liquidity-pools/#get-offersoffer_idtrades) - [`GET /operations`](/rpc-service/chains/chains-api/stellar/liquidity-pools-p2/#get-operations) - [`GET /operations/{id}`](/rpc-service/chains/chains-api/stellar/liquidity-pools-p2/#get-operationsid) - [`GET /operations/{id}/effects`](/rpc-service/chains/chains-api/stellar/liquidity-pools-p2/#get-operationsideffects) - [`GET /payments`](/rpc-service/chains/chains-api/stellar/liquidity-pools-p2/#get-payments) ### Trades, Transactions - [`GET /trades`](/rpc-service/chains/chains-api/stellar/trades/#get-trades) - [`GET /transactions`](/rpc-service/chains/chains-api/stellar/trades-p2/#get-transactions) - [`POST /transactions`](/rpc-service/chains/chains-api/stellar/trades-p3/#post-transactions) - [`GET /transactions/{transaction_hash}`](/rpc-service/chains/chains-api/stellar/trades-p3/#get-transactionstransaction_hash) - [`GET /transactions/{transaction_hash}/operations`](/rpc-service/chains/chains-api/stellar/trades-p3/#get-transactionstransaction_hashoperations) ### Transactions, Soroban JSON-RPC methods - [`GET /transactions/{transaction_hash}/effects`](/rpc-service/chains/chains-api/stellar/transactions/#get-transactionstransaction_hasheffects) - [`getEvents`](/rpc-service/chains/chains-api/stellar/transactions/#getevents) - [`getFeeStats`](/rpc-service/chains/chains-api/stellar/transactions/#getfeestats) - [`getHealth`](/rpc-service/chains/chains-api/stellar/transactions/#gethealth) - [`getLatestLedger`](/rpc-service/chains/chains-api/stellar/transactions/#getlatestledger) - [`getLedgerEntries`](/rpc-service/chains/chains-api/stellar/transactions/#getledgerentries) - [`getLedgers`](/rpc-service/chains/chains-api/stellar/transactions/#getledgers) - [`getNetwork`](/rpc-service/chains/chains-api/stellar/transactions-p2/#getnetwork) - [`getTransaction`](/rpc-service/chains/chains-api/stellar/transactions-p2/#gettransaction) - [`getTransactions`](/rpc-service/chains/chains-api/stellar/transactions-p2/#gettransactions) - [`getVersionInfo`](/rpc-service/chains/chains-api/stellar/transactions-p2/#getversioninfo) - [`sendTransaction`](/rpc-service/chains/chains-api/stellar/transactions-p2/#sendtransaction) - [`simulateTransaction`](/rpc-service/chains/chains-api/stellar/transactions-p2/#simulatetransaction) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/ledgers-p2/ title: Stellar — Ledgers, Liquidity pools (2/2) source: docs/rpc-service/chains/chains-api/stellar/ledgers-p2.mdx --- # Stellar — Ledgers, Liquidity pools (2/2) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/stellar/ledgers/) · 2 ## Liquidity pools Liquidity pools provide a simple, non-interactive way to trade large amounts of capital and enable high volumes of trading. ### `GET /liquidity_pools` > Lists all liquidity pools. This endpoint lists all available liquidity pools. #### Parameters * `reserves` (any; query): a comma-separated list of assets in canonical form (Code:IssuerAccountID), to only include liquidity pools which have reserves matching all listed assets. * `account` (any; query): a Stellar account ID, to only include liquidity pools in which this account is participating in (i.e. holds pool shares to). * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "id": "string", "paging_token": "string", "fee_bp": 0, "type": "string", "total_trustlines": "string", "total_shares": "string", "reserves": { "asset": "string", "amount": "string" }, "last_modified_ledger": "string", "last_modified_time": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools{?reserves,account,curson,order,limit} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools{?reserves,account,curson,order,limit} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/liquidity_pools?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/liquidity_pools?cursor=0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/liquidity_pools?cursor=0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/liquidity_pools/0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a" }, "transactions": { "href": "https://rpc.ankr.com/liquidity_pools/0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a/transactions{?cursor,limit,order}", "templated": true }, "operations": { "href": "https://rpc.ankr.com/liquidity_pools/0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a/operations{?cursor,limit,order}", "templated": true } }, "id": "0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a", "paging_token": "0000a8198b5e25994c1ca5b0556faeb27325ac746296944144e0a7406d501e8a", "fee_bp": 30, "type": "constant_product", "total_trustlines": "1", "total_shares": "5494.2144063", "reserves": [ { "asset": "native", "amount": "6.3915888" }, { "asset": "GOLDBANK001:GDEUQ2MX3YXMITFOTC3CO3GW5V3XE3IVG7JKLZZAOZ7WFYIN256INDUS", "amount": "6259562.9445306" } ], "last_modified_ledger": 49899809, "last_modified_time": "2024-01-13T13:23:26Z" } ] } } ``` --- ### `GET /liquidity_pools/{liquidity_pool_id}` > Retrieves a particular liquidity pool. The single liquidity pool endpoint provides information on a liquidity pool. #### Parameters * `liquidity_pool_id` (any; path; required): a unique identifier for this liquidity pool. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "transactions": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "fee_bp": 0, "type": "string", "total_trustlines": "string", "total_shares": "string", "reserves": { "asset": "string", "amount": "string" }, "last_modified_ledger": "string", "last_modified_time": "string" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9" }, "effects": { "href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/effects{?cursor,limit,order}", "templated": true }, "operations": { "href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/operations{?cursor,limit,order}", "templated": true }, "transactions": { "href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/transactions{?cursor,limit,order}", "templated": true } }, "id": "67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9", "paging_token": "113725249324879873", "fee_bp": 30, "type": "constant_product", "total_trustlines": "300", "total_shares": "5000", "reserves": [ { "amount": "1000.0000005", "asset": "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { "amount": "2000.0000000", "asset": "PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" } ] } ``` --- ### `GET /liquidity_pools/{liquidity_pool_id}/effects` > Retrieves effects of a particular liquidity pool. This endpoint represents effects referencing a given liquidity pool and can be used in streaming mode. Streaming mode allows you to listen for new effects referencing this liquidity pool as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time. #### Parameters * `liquidity_pool_id` (any; path; required): a unique identifier for this liquidity pool. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "account": "string", "type": "Account Created", "type_i": 1, "created_at": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}/effects{?cursor,order,limit} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}/effects{?cursor,order,limit} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/effects?cursor=&order=asc" }, "next": { "href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/effects?cursor=120192370561220608&order=asc" }, "prev": { "href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/effects?cursor=120192344791343104&order=desc" } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "https://rpc.ankr.com/operations/3849085266190337" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc&cursor=3849085266190337-1" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc&cursor=3849085266190337-1" } }, "id": "0000000012884905986-0000000001", "paging_token": "12884905986-2", "account": "GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7", "type": "liquidity_pool_deposited", "type_i": 81, "created_at": "2021-11-18T03:15:54Z", "liquidity_pool": { "id": "67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9", "fee_bp": 30, "type": "constant_product", "total_trustlines": "300", "total_shares": "5000", "reserves": [ { "amount": "1000.0000005", "asset": "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { "amount": "2000.0000000", "asset": "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" } ] }, "reserves_deposited": [ { "asset": "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", "amount": "2378.0000005" }, { "asset": "PHP:GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP", "amount": "983.0000005" } ], "shares_received": "1000" } ] } } ``` --- ### `GET /liquidity_pools/{liquidity_pool_id}/trades` > Retrieves trades of a particular liquidity pool. This endpoint represents successful trades fulfilled by the given liquidity pool and can be used in streaming mode. Streaming mode allows you to listen for new trades referencing this liquidity pool as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trade created since your request time. #### Parameters * `liquidity_pool_id` (any; path; required): a unique identifier for this liquidity pool. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "base": { "href": "string", "templated": true }, "counter": { "href": "string", "templated": true }, "operation": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "ledger_close_time": "string", "offer_id": "string", "trade_type": "string", "liquidity_pool_fee_bp": 0, "base_liquidity_pool_id": "string", "base_offer_id": "string", "base_account": "string", "base_amount": "string", "base_asset_type": "string", "base_asset_code": "string", "base_asset_issuer": "string", "counter_liquidity_pool_id": "string", "counter_offer_id": "string", "counter_account": "string", "counter_amount": "string", "counter_asset_type": "string", "counter_asset_code": "string", "counter_asset_issuer": "string", "base_is_seller": true, "price": { "n": "string", "d": "string" } } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}/trades{?cursor,order,limit} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}/trades{?cursor,order,limit} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=212026605370699777-0\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/trades?cursor=212026605370699777-0\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "" }, "base": { "href": "https://rpc.ankr.com/accounts/GBEI3CDPMFUKZCJ3EFJNGO7UNQSFTKGGCFH6HUXGHLMJ4ML3H7P4Y7R6" }, "counter": { "href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4" }, "operation": { "href": "https://rpc.ankr.com/operations/212026605370699777" } }, "id": "212026605370699777-0", "paging_token": "212026605370699777-0", "ledger_close_time": "2023-12-08T09:16:26Z", "trade_type": "liquidity_pool", "liquidity_pool_fee_bp": 30, "base_offer_id": "4823712623798087681", "base_account": "GBEI3CDPMFUKZCJ3EFJNGO7UNQSFTKGGCFH6HUXGHLMJ4ML3H7P4Y7R6", "base_amount": "9.9125000", "base_asset_type": "native", "counter_liquidity_pool_id": "3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4", "counter_amount": "1701.5904043", "counter_asset_type": "credit_alphanum4", "counter_asset_code": "VZT", "counter_asset_issuer": "GBENYXZDFFR2J4F4DB3YPBBAM244TXYOTIOOUQI5DBT3OKUU4ZJ2M7NO", "base_is_seller": false, "price": { "n": "17015904043", "d": "99125000" } } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/ledgers/ title: Stellar — Ledgers, Liquidity pools (1/2) source: docs/rpc-service/chains/chains-api/stellar/ledgers.mdx --- # Stellar — Ledgers, Liquidity pools (1/2) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/stellar/ledgers-p2/) ### `GET /ledgers/{sequence}/transactions` > Retrieves transactions of a particular ledger. This endpoint represents successful transactions in a given ledger. #### Parameters * `sequence` (integer; path; required): the sequence number of a specific ledger. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "memo": "string", "_links": { "self": { "href": "string", "templated": true }, "account": { "href": "string", "templated": true }, "ledger": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "successful": true, "hash": "string", "ledger": 0, "created_at": "string", "source_account": "string", "account_muxed": "string", "account_muxed_id": "string", "source_account_sequence": "string", "fee_account": "string", "fee_account_muxed": "string", "fee_account_muxed_id": "string", "fee_charged": "string", "max_fee": "string", "operation_count": 0, "envelope_xdr": "string", "result_xdr": "string", "result_meta_xdr": "string", "fee_meta_xdr": "string", "memo_type": "string", "signatures": [ "string" ], "valid_after": "string", "valid_before": "string", "preconditions": { "timebounds": { "min_time": "string", "max_time": "string" }, "ledgerbounds": { "min_ledger": "string", "max_ledger": "string" }, "min_account_sequence": "string", "min_account_sequence_age": "string", "min_account_sequence_ledger_gap": 0, "extra_signers": [ "string" ] }, "fee_bump_transaction": { "hash": "string", "signatures": [ "string" ] }, "inner_transaction": { "hash": "string", "signatures": [ "string" ], "max_fee": "string" } } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/transactions{?cursor,order,limit,include_failed} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/transactions{?cursor,order,limit,include_failed} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/ledgers/27147222/transactions?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/ledgers/27147222/transactions?cursor=116596430667255808\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/ledgers/27147222/transactions?cursor=116596430667255808\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "memo": "FadBcV0owHrsLQif/V2TxZKGA2YiX+MoifI7oB/UjJM=", "_links": { "self": { "href": "https://rpc.ankr.com/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0" }, "account": { "href": "https://rpc.ankr.com/accounts/GBKTEASNXABG2NC4TY6N3IA5UFC6YW53Y4KTIKY3CUEKQ2W5EIYRMYVB" }, "ledger": { "href": "https://rpc.ankr.com/ledgers/27147222" }, "operations": { "href": "https://rpc.ankr.com/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0/operations{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0/effects{?cursor,limit,order}", "templated": true }, "precedes": { "href": "https://rpc.ankr.com/transactions?order=asc\u0026cursor=116596430667255808" }, "succeeds": { "href": "https://rpc.ankr.com/transactions?order=desc\u0026cursor=116596430667255808" }, "transaction": { "href": "https://rpc.ankr.com/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0" } }, "id": "3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0", "paging_token": "116596430667255808", "successful": true, "hash": "3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0", "ledger": 27147222, "created_at": "2019-12-06T23:05:38Z", "source_account": "GBKTEASNXABG2NC4TY6N3IA5UFC6YW53Y4KTIKY3CUEKQ2W5EIYRMYVB", "source_account_sequence": "113943107245989112", "fee_account": "GBKTEASNXABG2NC4TY6N3IA5UFC6YW53Y4KTIKY3CUEKQ2W5EIYRMYVB", "fee_charged": "100", "max_fee": "100", "operation_count": 1, "envelope_xdr": "AAAAAFUyAk24Am00XJ483aAdoUXsW7vHFTQrGxUIqGrdIjEWAAAAZAGUzqcAAFz4AAAAAQAAAAAAAAAAAAAAAAAAAAAAAAADFadBcV0owHrsLQif/V2TxZKGA2YiX+MoifI7oB/UjJMAAAABAAAAAQAAAADhZHiqD/Q3uSTgjYEWGVRfCCHYvFmeqJU12G9SkzJYEQAAAAEAAAAAB77j4CQxLlm5aPrq/PDwFhGNs2ldqbdCZwkSfzXhUhYAAAABTk9ETAAAAAB1jYLXrFzNBOWCoPnZSHI3PJAhHtc1TrCaiPuZwSf5pgAAAAAAAABNAAAAAAAAAALw9Tl2AAAAQLSLnL3XT3F6dq5m2WHZ7tH3HBrK/e+p2G7Hrl3WXQToUsgxKIRH6bhHT/mIWwnrfLZ9nlVjMCFoZPqVKrI2lgLdIjEWAAAAQCrZ9IbjDAB408VgQaqNpwX8hXr/OUsoEexkWGkN9PjcBG2nf4bKWdbjiaqHZ+LrvM+DdmhxtA3L9bzmCie8NgA=", "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=", "result_meta_xdr": "AAAAAgAAAAIAAAADAZ471gAAAAAAAAAAVTICTbgCbTRcnjzdoB2hRexbu8cVNCsbFQioat0iMRYAAAAAB5tToAGUzqcAAFz3AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAZ471gAAAAAAAAAAVTICTbgCbTRcnjzdoB2hRexbu8cVNCsbFQioat0iMRYAAAAAB5tToAGUzqcAAFz4AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAABAAAAAMBnju+AAAAAQAAAAAHvuPgJDEuWblo+ur88PAWEY2zaV2pt0JnCRJ/NeFSFgAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAAAAAIP38ASptjhEiAAAAAAAEAAAAAAAAAAAAAAAEBnjvWAAAAAQAAAAAHvuPgJDEuWblo+ur88PAWEY2zaV2pt0JnCRJ/NeFSFgAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAAAAAIP8wASptjhEiAAAAAAAEAAAAAAAAAAAAAAAMBnjvVAAAAAQAAAADhZHiqD/Q3uSTgjYEWGVRfCCHYvFmeqJU12G9SkzJYEQAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAALEhqMpZ//////////wAAAAEAAAAAAAAAAAAAAAEBnjvWAAAAAQAAAADhZHiqD/Q3uSTgjYEWGVRfCCHYvFmeqJU12G9SkzJYEQAAAAFOT0RMAAAAAHWNgtesXM0E5YKg+dlIcjc8kCEe1zVOsJqI+5nBJ/mmAAAALEhqMkl//////////wAAAAEAAAAAAAAAAAAAAAA=", "fee_meta_xdr": "AAAAAgAAAAMBnjvKAAAAAAAAAABVMgJNuAJtNFyePN2gHaFF7Fu7xxU0KxsVCKhq3SIxFgAAAAAHm1QEAZTOpwAAXPcAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEBnjvWAAAAAAAAAABVMgJNuAJtNFyePN2gHaFF7Fu7xxU0KxsVCKhq3SIxFgAAAAAHm1OgAZTOpwAAXPcAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==", "memo_type": "hash", "signatures": [ "tIucvddPcXp2rmbZYdnu0fccGsr976nYbseuXdZdBOhSyDEohEfpuEdP+YhbCet8tn2eVWMwIWhk+pUqsjaWAg==", "Ktn0huMMAHjTxWBBqo2nBfyFev85SygR7GRYaQ30+NwEbad/hspZ1uOJqodn4uu8z4N2aHG0Dcv1vOYKJ7w2AA==" ], "valid_after": "1970-01-01T00:00:00Z", "preconditions": { "timebounds": { "min_time": "0" } } } ] } } ``` --- ### `GET /ledgers/{sequence}/operations` > Retrieves operations of a particular ledger. This endpoint returns successful operations in a specific ledger. #### Parameters * `sequence` (integer; path; required): the sequence number of a specific ledger. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. * `join` (any; query): set to `transactions` to include the transactions which created each of the operations in the response. #### Returns ```json { "_links": { "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "self": { "href": "string", "templated": true }, "succeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "type_i": 0, "type": "create_account" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/operations{?cursor,order,limit,include_failed,join} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/operations{?cursor,order,limit,include_failed,join} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/ledgers/27147222/operations?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/ledgers/27147222/operations?cursor=116596430667255809\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/ledgers/27147222/operations?cursor=116596430667255809\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/operations/116596430667255809" }, "transaction": { "href": "https://rpc.ankr.com/transactions/3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0" }, "effects": { "href": "https://rpc.ankr.com/operations/116596430667255809/effects" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=116596430667255809" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=116596430667255809" } }, "id": "116596430667255809", "paging_token": "116596430667255809", "transaction_successful": true, "source_account": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH", "type": "payment", "type_i": 1, "created_at": "2019-12-06T23:05:38Z", "transaction_hash": "3a644389bbec63dd2b107a03c16711563fc549daa7b7f56f951a2e470f81f2e0", "asset_type": "credit_alphanum4", "asset_code": "NODL", "asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL", "from": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH", "to": "GAD35Y7AEQYS4WNZND5OV7HQ6ALBDDNTNFO2TN2CM4ERE7ZV4FJBNXZ6", "amount": "0.0000077" } ] } } ``` --- ### `GET /ledgers/{sequence}/payments` > Retrieves payments of a particular ledger. This endpoint returns all payment-related operations in a specific ledger. Operation types that can be returned by this endpoint include: `create_account`, `payment`, `path_payment`, and `account_merge`. #### Parameters * `sequence` (integer; path; required): the sequence number of a specific ledger. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. * `join` (any; query): set to `transactions` to include the transactions which created each of the operations in the response. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "transaction_successful": true, "source_account": "string", "type": "payment", "type_i": "string", "created_at": "string", "transaction_hash": "string", "asset_type": "string", "asset_issuer": "string", "from": "string", "to": "string", "amount": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/payments{?cursor,order,limit,include_failed,join} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/payments{?cursor,order,limit,include_failed,join} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/ledgers/27521176/payments?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/ledgers/27521176/payments?cursor=118202550867476481\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/ledgers/27521176/payments?cursor=118202550867476481\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/operations/118202550867476481" }, "transaction": { "href": "https://rpc.ankr.com/transactions/971454b84a82baa38afa975e9eb4ff2632821b5a3e7f7993a7e20bbd9d7633ea" }, "effects": { "href": "https://rpc.ankr.com/operations/118202550867476481/effects" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=118202550867476481" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=118202550867476481" } }, "id": "118202550867476481", "paging_token": "118202550867476481", "transaction_successful": true, "source_account": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH", "type": "payment", "type_i": 1, "created_at": "2019-12-30T22:35:49Z", "transaction_hash": "971454b84a82baa38afa975e9eb4ff2632821b5a3e7f7993a7e20bbd9d7633ea", "asset_type": "credit_alphanum4", "asset_code": "NODL", "asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL", "from": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH", "to": "GDGJS7AXAUFDZARIRDVZ5V7CFW6XY47WSBE2OVLCCGCDWOE7INKYN3PS", "amount": "0.0000017" } ] } } ``` --- ### `GET /ledgers/{sequence}/effects` > Retrieves all effects of a particular ledger. This endpoint returns the effects of a specific ledger. #### Parameters * `sequence` (integer; path; required): the sequence number of a specific ledger. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "account": "string", "type": "Account Created", "type_i": 1, "created_at": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/effects{?cursor,order,limit} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/ledgers/{sequence}/effects{?cursor,order,limit} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/ledgers/0/effects?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/ledgers/0/effects?cursor=211459450643517441-1\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/ledgers/0/effects?cursor=211459450643517441-1\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "https://rpc.ankr.com/operations/211459450643517441" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=211459450643517441-1" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=211459450643517441-1" } }, "id": "0211459450643517441-0000000001", "paging_token": "211459450643517441-1", "account": "GCV7NQTKV3ZZGC366FYVH2XOSZBOTQIOTHG7JJFJJP2XKCLGEYUZHRRR", "type": "account_credited", "type_i": 2, "created_at": "2023-11-29T10:37:29Z", "asset_type": "native", "amount": "0.0251621" } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/liquidity-pools-p2/ title: Stellar — Liquidity pools, Offers, Operations (2/2) source: docs/rpc-service/chains/chains-api/stellar/liquidity-pools-p2.mdx --- # Stellar — Liquidity pools, Offers, Operations (2/2) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/stellar/liquidity-pools/) · 2 ## Operations Operations are objects that represent a desired change to the ledger: payments, offers to exchange currency, changes made to account options, etc. Operations are submitted to the Stellar network grouped in a Transaction. ### `GET /operations` > Lists all operations. This endpoint lists all Successful operations and can be used in streaming mode. Streaming mode allows you to listen for new operations as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known operation unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream operations created since your request time. #### Parameters * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. * `join` (any; query): set to transactions to include the transactions which created each of the operations in the response. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "type_i": 0, "type": "create_account" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/operations{?cursor,limit,order,include_failed,join} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/operations{?cursor,limit,order,include_failed,join} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/operations?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/operations?cursor=211459450643419137\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/operations?cursor=211459450643419137\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/operations/211459450643419137" }, "transaction": { "href": "https://rpc.ankr.com/transactions/f6ae066da1fa185c4c610b44499d7263b2cc14e33725c83bd2f0ff2e364be7ba" }, "effects": { "href": "https://rpc.ankr.com/operations/211459450643419137/effects" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=211459450643419137" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=211459450643419137" } }, "id": "211459450643419137", "paging_token": "211459450643419137", "transaction_successful": true, "source_account": "GBIAUMQXLF2LHKWCUPWJX7YWSA33DZMTZ42HJCIBE2OBDU23XCEQF6TA", "type": "manage_buy_offer", "type_i": 12, "created_at": "2023-11-29T10:37:29Z", "transaction_hash": "f6ae066da1fa185c4c610b44499d7263b2cc14e33725c83bd2f0ff2e364be7ba", "amount": "0.0500000", "price": "2050.3600000", "price_r": { "n": 51259, "d": 25 }, "buying_asset_type": "credit_alphanum12", "buying_asset_code": "aeETH", "buying_asset_issuer": "GALLBRBQHAPW5FOVXXHYWR6J4ZDAQ35BMSNADYGBW25VOUHUYRZM4XIL", "selling_asset_type": "credit_alphanum4", "selling_asset_code": "USDC", "selling_asset_issuer": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN", "offer_id": "1413266664" } ] } } ``` --- ### `GET /operations/{id}` > Retrieves a particular operation. The single operation endpoint provides information about a specific operation. #### Parameters * `id` (string; path; required): the ID number for this operation. * `join` (any; query): set to `transactions` to include the transactions which created each of the operations in the response. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "type_i": 0, "type": "create_account" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/operations/{id}{?join} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/operations/{id}{?join} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/operations/121692259040116737" }, "transaction": { "href": "https://rpc.ankr.com/transactions/f92a9648c1084d1de0fd786faac5d5e1637d4127c60841d2366c70d2e7f77b85" }, "effects": { "href": "https://rpc.ankr.com/operations/121692259040116737/effects" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=121692259040116737" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=121692259040116737" } }, "id": "121692259040116737", "paging_token": "121692259040116737", "transaction_successful": true, "source_account": "GBDVKE33GVVMBXX73OHIBRP6RAHKHHW2P4PQVV6UNOKQCOXU7GNUM4QI", "type": "manage_sell_offer", "type_i": 3, "created_at": "2020-02-21T20:10:21Z", "transaction_hash": "f92a9648c1084d1de0fd786faac5d5e1637d4127c60841d2366c70d2e7f77b85", "amount": "10000.0000000", "price": "0.0704336", "price_r": { "n": 44021, "d": 625000 }, "buying_asset_type": "credit_alphanum4", "buying_asset_code": "USD", "buying_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX", "selling_asset_type": "native", "offer_id": "161536436" } ``` --- ### `GET /operations/{id}/effects` > Retrieves all effects of a particular operation. This endpoint returns the effects of a specific operation. #### Parameters * `id` (string; path; required): the ID number for this operation. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "account": "string", "type": "Account Created", "type_i": 1, "created_at": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/operations/{id}/effects{?order,limit,cursor} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/operations/{id}/effects{?order,limit,cursor} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/operations/121693057904021505/effects?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/operations/121693057904021505/effects?cursor=121693057904021505-1\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/operations/121693057904021505/effects?cursor=121693057904021505-1\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "https://rpc.ankr.com/operations/121693057904021505" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=121693057904021505-1" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=121693057904021505-1" } }, "id": "0121693057904021505-0000000001", "paging_token": "121693057904021505-1", "account": "GALSPNVKGNRJ3VIOQ26QKPZBDCTVJK7XPLSPF3UVZV3JJXCKVCHNSPCK", "type": "account_credited", "type_i": 2, "created_at": "2020-02-21T20:27:30Z", "asset_type": "credit_alphanum4", "asset_code": "NODL", "asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL", "amount": "0.0000027" } ] } } ``` --- ### `GET /payments` > Lists all payments. This endpoint lists all Successful payment-related operations and can be used in streaming mode. Streaming mode allows you to listen for new payments as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known payment unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream payments created since your request time. Operations that can be returned by this endpoint include: `create_account`, `payment`, `path_payment_strict_recieve`, `path_payment_strict_send`, and `account_merge`. #### Parameters * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. * `join` (any; query): set to `transactions` to include the transactions which created each of the operations in the response. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "transaction_successful": true, "source_account": "string", "type": "create_account", "type_i": 0, "created_at": "string", "transaction_hash": "string", "starting_balance": "string", "funder": "string", "account": "string" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/payments{?curson,order,limit,include_failed,join} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/payments{?curson,order,limit,include_failed,join} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/payments?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/payments?cursor=211459450643517441\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/payments?cursor=211459450643517441\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/operations/211459450643517441" }, "transaction": { "href": "https://rpc.ankr.com/transactions/4dc95da8e9ecb3b7e4f33e8d2ab0b817bea718932b793336f7a35b388999168f" }, "effects": { "href": "https://rpc.ankr.com/operations/211459450643517441/effects" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=211459450643517441" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=211459450643517441" } }, "id": "211459450643517441", "paging_token": "211459450643517441", "transaction_successful": true, "source_account": "GCV7NQTKV3ZZGC366FYVH2XOSZBOTQIOTHG7JJFJJP2XKCLGEYUZHRRR", "type": "path_payment_strict_receive", "type_i": 2, "created_at": "2023-11-29T10:37:29Z", "transaction_hash": "4dc95da8e9ecb3b7e4f33e8d2ab0b817bea718932b793336f7a35b388999168f", "asset_type": "native", "from": "GCV7NQTKV3ZZGC366FYVH2XOSZBOTQIOTHG7JJFJJP2XKCLGEYUZHRRR", "to": "GCV7NQTKV3ZZGC366FYVH2XOSZBOTQIOTHG7JJFJJP2XKCLGEYUZHRRR", "amount": "0.0251621", "path": [ { "asset_type": "credit_alphanum4", "asset_code": "yXLM", "asset_issuer": "GARDNV3Q7YGT4AKSDF25LT32YSCCW4EV22Y2TV3I2PU2MMXJTEDL5T55" }, { "asset_type": "credit_alphanum4", "asset_code": "MKR", "asset_issuer": "GD67CI2DXVTTVK5NJK3LBBUEZAZKCVZ3MSDUV656XNYRLHJOLZ5LHUMB" }, { "asset_type": "credit_alphanum4", "asset_code": "ETX", "asset_issuer": "GCEFMSNWXTALXQPRQFIXOMWJHZFDEQJBM26RGEDZUDFMU32JB6WJGRJX" }, { "asset_type": "credit_alphanum4", "asset_code": "SLVR", "asset_issuer": "GBZVELEQD3WBN3R3VAG64HVBDOZ76ZL6QPLSFGKWPFED33Q3234NSLVR" } ], "source_amount": "0.0237050", "source_max": "0.0251621", "source_asset_type": "native" } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/liquidity-pools/ title: Stellar — Liquidity pools, Offers, Operations (1/2) source: docs/rpc-service/chains/chains-api/stellar/liquidity-pools.mdx --- # Stellar — Liquidity pools, Offers, Operations (1/2) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/stellar/liquidity-pools-p2/) ### `GET /liquidity_pools/{liquidity_pool_id}/transactions` > Retrieves transactions of a particular liquidity pool. This endpoint represents successful transactions referencing a given liquidity pool and can be used in streaming mode. Streaming mode allows you to listen for new transactions referencing this liquidity pool as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known transaction unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream transactions created since your request time. #### Parameters * `liquidity_pool_id` (any; path; required): a unique identifier for this liquidity pool. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to `true` to include failed operations in results. Options include `true` and `false`. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "memo": "string", "_links": { "self": { "href": "string", "templated": true }, "account": { "href": "string", "templated": true }, "ledger": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "successful": true, "hash": "string", "ledger": 0, "created_at": "string", "source_account": "string", "account_muxed": "string", "account_muxed_id": "string", "source_account_sequence": "string", "fee_account": "string", "fee_account_muxed": "string", "fee_account_muxed_id": "string", "fee_charged": "string", "max_fee": "string", "operation_count": 0, "envelope_xdr": "string", "result_xdr": "string", "result_meta_xdr": "string", "fee_meta_xdr": "string", "memo_type": "string", "signatures": [ "string" ], "valid_after": "string", "valid_before": "string", "preconditions": { "timebounds": { "min_time": "string", "max_time": "string" }, "ledgerbounds": { "min_ledger": "string", "max_ledger": "string" }, "min_account_sequence": "string", "min_account_sequence_age": "string", "min_account_sequence_ledger_gap": 0, "extra_signers": [ "string" ] }, "fee_bump_transaction": { "hash": "string", "signatures": [ "string" ] }, "inner_transaction": { "hash": "string", "signatures": [ "string" ], "max_fee": "string" } } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}/transactions{?cursor,order,limit,include_failed} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}/transactions{?cursor,order,limit,include_failed} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/transactions?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/transactions?cursor=212026605370699776\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/liquidity_pools/3b476aff8a406a6ec3b61d5c038009cef85f2ddfaf616822dc4fec92845149b4/transactions?cursor=212026605370699776\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/transactions/f2c93ecfb152ad5a42114296518751781d44a5513833ab855f29122e93f3bb6d" }, "account": { "href": "https://rpc.ankr.com/accounts/GBEI3CDPMFUKZCJ3EFJNGO7UNQSFTKGGCFH6HUXGHLMJ4ML3H7P4Y7R6" }, "ledger": { "href": "https://rpc.ankr.com/ledgers/49366291" }, "operations": { "href": "https://rpc.ankr.com/transactions/f2c93ecfb152ad5a42114296518751781d44a5513833ab855f29122e93f3bb6d/operations{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/transactions/f2c93ecfb152ad5a42114296518751781d44a5513833ab855f29122e93f3bb6d/effects{?cursor,limit,order}", "templated": true }, "precedes": { "href": "https://rpc.ankr.com/transactions?order=asc\u0026cursor=212026605370699776" }, "succeeds": { "href": "https://rpc.ankr.com/transactions?order=desc\u0026cursor=212026605370699776" }, "transaction": { "href": "https://rpc.ankr.com/transactions/f2c93ecfb152ad5a42114296518751781d44a5513833ab855f29122e93f3bb6d" } }, "id": "f2c93ecfb152ad5a42114296518751781d44a5513833ab855f29122e93f3bb6d", "paging_token": "212026605370699776", "successful": true, "hash": "f2c93ecfb152ad5a42114296518751781d44a5513833ab855f29122e93f3bb6d", "ledger": 49366291, "created_at": "2023-12-08T09:16:26Z", "source_account": "GBEI3CDPMFUKZCJ3EFJNGO7UNQSFTKGGCFH6HUXGHLMJ4ML3H7P4Y7R6", "source_account_sequence": "158971643161494781", "fee_account": "GBEI3CDPMFUKZCJ3EFJNGO7UNQSFTKGGCFH6HUXGHLMJ4ML3H7P4Y7R6", "fee_charged": "200", "max_fee": "200000", "operation_count": 2, "envelope_xdr": "AAAAAgAAAABIjYhvYWisiTshUtM79GwkWajGEU/j0uY62J4xez/fzAADDUACNMfeAABE/QAAAAAAAAAAAAAAAgAAAAEAAAAASI2Ib2ForIk7IVLTO/RsJFmoxhFP49LmOtieMXs/38wAAAANAAAAAAAAAAAF6IcIAAAAAEiNiG9haKyJOyFS0zv0bCRZqMYRT+PS5jrYnjF7P9/MAAAAAVZaVAAAAAAASNxfIyljpPC8GHeHhCBmucnfDpoc6kEdGGe3KpTmU6YAAAAD7BWrawAAAAAAAAABAAAAAEiNiG9haKyJOyFS0zv0bCRZqMYRT+PS5jrYnjF7P9/MAAAADQAAAAAAAAAAAA1Z+AAAAAAC90wBFo+lH6oihgg4xRmby+YL5+1WH3WX9GYUSm43zgAAAAJ5VVNEQwAAAAAAAAAAAAAAzTraTOMNLk/59bkX2cI5NI9EZRILk0tjcD212hOLctkAAAAAAAAAAQAAAAEAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAAAAAABez/fzAAAAED07bKKZkaJt/ZlzYI1b09x9GUBodAGkNSUq0KTHchBIqUinQX+ujNQVQyqB17KK68fyfs+DbeDbl/vHmf8RpgA", "result_xdr": "AAAAAAAAAMgAAAAAAAAAAgAAAAAAAAANAAAAAAAAAAEAAAACO0dq/4pAam7Dth1cA4AJzvhfLd+vYWgi3E/skoRRSbQAAAABVlpUAAAAAABI3F8jKWOk8LwYd4eEIGa5yd8OmhzqQR0YZ7cqlOZTpgAAAAP2OhcrAAAAAAAAAAAF6IcIAAAAAEiNiG9haKyJOyFS0zv0bCRZqMYRT+PS5jrYnjF7P9/MAAAAAVZaVAAAAAAASNxfIyljpPC8GHeHhCBmucnfDpoc6kEdGGe3KpTmU6YAAAAD9joXKwAAAAAAAAANAAAAAAAAAAIAAAABAAAAAHZYB+nEN/fXC9jJ/NsMgId8lgFYNbOdLsA2xDjikuewAAAAAFSwm74AAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAAAAbJsAAAAAAAAAAAADVn4AAAAAQAAAABiNUyRCY4luIUIThovFvGdQrstOPwFnhhZJEsbfnjYbQAAAABUsl2OAAAAAnlVU0RDAAAAAAAAAAAAAADNOtpM4w0uT/n1uRfZwjk0j0RlEguTS2NwPbXaE4ty2QAAAAAAAbJtAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAAAGybAAAAAAC90wBFo+lH6oihgg4xRmby+YL5+1WH3WX9GYUSm43zgAAAAJ5VVNEQwAAAAAAAAAAAAAAzTraTOMNLk/59bkX2cI5NI9EZRILk0tjcD212hOLctkAAAAAAAGybQAAAAA=", "result_meta_xdr": "AAAAAgAAAAIAAAADAvFFEwAAAAAAAAAASI2Ib2ForIk7IVLTO/RsJFmoxhFP49LmOtieMXs/38wAAAAAic7MdgI0x94AAET8AAAAdAAAAAEAAAAAxHHGQ3BiyVBqiTQuU4oa2kBNL0HPHTolX0Mh98bg4XUAAAAAAAAACWxvYnN0ci5jbwAAAAEAAAAAAAAAAAAAAQAAACYNvdxGAAAAAACYln8AAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAC8UULAAAAAGVy3rkAAAAAAAAAAQLxRRMAAAAAAAAAAEiNiG9haKyJOyFS0zv0bCRZqMYRT+PS5jrYnjF7P9/MAAAAAInOzHYCNMfeAABE/QAAAHQAAAABAAAAAMRxxkNwYslQaok0LlOKGtpATS9Bzx06JV9DIffG4OF1AAAAAAAAAAlsb2JzdHIuY28AAAABAAAAAAAAAAAAAAEAAAAmDb3cRgAAAAAAmJZ/AAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAAvFFEwAAAABlct7qAAAAAAAAAAIAAAAGAAAAAwLoOYgAAAABAAAAAEiNiG9haKyJOyFS0zv0bCRZqMYRT+PS5jrYnjF7P9/MAAAAAVZaVAAAAAAASNxfIyljpPC8GHeHhCBmucnfDpoc6kEdGGe3KpTmU6YAAAAreWs4bH//////////AAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAvFFEwAAAAEAAAAASI2Ib2ForIk7IVLTO/RsJFmoxhFP49LmOtieMXs/38wAAAABVlpUAAAAAABI3F8jKWOk8LwYd4eEIGa5yd8OmhzqQR0YZ7cqlOZTpgAAAC9vpU+Xf/////////8AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMC7eGSAAAABTtHav+KQGpuw7YdXAOACc74Xy3fr2FoItxP7JKEUUm0AAAAAAAAAAAAAAABVlpUAAAAAABI3F8jKWOk8LwYd4eEIGa5yd8OmhzqQR0YZ7cqlOZTpgAAAB4AAAAAa73wdQAAAExs+mlKAAAABVWZPHMAAAAAAAAAAQAAAAAAAAABAvFFEwAAAAU7R2r/ikBqbsO2HVwDgAnO+F8t369haCLcT+yShFFJtAAAAAAAAAAAAAAAAVZaVAAAAAAASNxfIyljpPC8GHeHhCBmucnfDpoc6kEdGGe3KpTmU6YAAAAeAAAAAHGmd30AAABIdsBSHwAAAAVVmTxzAAAAAAAAAAEAAAAAAAAAAwLxRRMAAAAAAAAAAEiNiG9haKyJOyFS0zv0bCRZqMYRT+PS5jrYnjF7P9/MAAAAAInOzHYCNMfeAABE/QAAAHQAAAABAAAAAMRxxkNwYslQaok0LlOKGtpATS9Bzx06JV9DIffG4OF1AAAAAAAAAAlsb2JzdHIuY28AAAABAAAAAAAAAAAAAAEAAAAmDb3cRgAAAAAAmJZ/AAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAAvFFEwAAAABlct7qAAAAAAAAAAEC8UUTAAAAAAAAAABIjYhvYWisiTshUtM79GwkWajGEU/j0uY62J4xez/fzAAAAACD5kVuAjTH3gAARP0AAAB0AAAAAQAAAADEccZDcGLJUGqJNC5TihraQE0vQc8dOiVfQyH3xuDhdQAAAAAAAAAJbG9ic3RyLmNvAAAAAQAAAAAAAAAAAAABAAAAJg293EYAAAAAAJiWfwAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAALxRRMAAAAAZXLe6gAAAAAAAAAQAAAAAwLxRQ8AAAABAAAAAAL3TAEWj6UfqiKGCDjFGZvL5gvn7VYfdZf0ZhRKbjfOAAAAAnlVU0RDAAAAAAAAAAAAAADNOtpM4w0uT/n1uRfZwjk0j0RlEguTS2NwPbXaE4ty2QAAAC2WJEctf/////////8AAAABAAAAAAAAAAAAAAABAvFFEwAAAAEAAAAAAvdMARaPpR+qIoYIOMUZm8vmC+ftVh91l/RmFEpuN84AAAACeVVTREMAAAAAAAAAAAAAAM062kzjDS5P+fW5F9nCOTSPRGUSC5NLY3A9tdoTi3LZAAAALZYl+Zp//////////wAAAAEAAAAAAAAAAAAAAAMC8UUSAAAAAQAAAABiNUyRCY4luIUIThovFvGdQrstOPwFnhhZJEsbfnjYbQAAAAJ5VVNEQwAAAAAAAAAAAAAAzTraTOMNLk/59bkX2cI5NI9EZRILk0tjcD212hOLctkAAAAAChmbSHzmbFDihAAAAAAAAQAAAAEAAAAcMjdolQAAAAAKGOWiAAAAAAAAAAAAAAABAvFFEwAAAAEAAAAAYjVMkQmOJbiFCE4aLxbxnUK7LTj8BZ4YWSRLG3542G0AAAACeVVTREMAAAAAAAAAAAAAAM062kzjDS5P+fW5F9nCOTSPRGUSC5NLY3A9tdoTi3LZAAAAAAoX6Nt85mxQ4oQAAAAAAAEAAAABAAAAHDI3aJUAAAAAChczNQAAAAAAAAAAAAAAAwLxRRIAAAABAAAAAGI1TJEJjiW4hQhOGi8W8Z1Cuy04/AWeGFkkSxt+eNhtAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAA9RCnFbHzmbFDihAAAAAAAAQAAAAEAAAAACm75pAAAABo5SK9mAAAAAAAAAAAAAAABAvFFEwAAAAEAAAAAYjVMkQmOJbiFCE4aLxbxnUK7LTj8BZ4YWSRLG3542G0AAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAD1EK3fYfOZsUOKEAAAAAAABAAAAAQAAAAAKbUc4AAAAGjlIr2YAAAAAAAAAAAAAAAMC8UUSAAAAAgAAAABiNUyRCY4luIUIThovFvGdQrstOPwFnhhZJEsbfnjYbQAAAABUsl2OAAAAAnlVU0RDAAAAAAAAAAAAAADNOtpM4w0uT/n1uRfZwjk0j0RlEguTS2NwPbXaE4ty2QAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAAC7LEcATEsFAExLQAAAAAAAAAAAAAAAAAAAAAEC8UUTAAAAAgAAAABiNUyRCY4luIUIThovFvGdQrstOPwFnhhZJEsbfnjYbQAAAABUsl2OAAAAAnlVU0RDAAAAAAAAAAAAAADNOtpM4w0uT/n1uRfZwjk0j0RlEguTS2NwPbXaE4ty2QAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAAC5edoATEsFAExLQAAAAAAAAAAAAAAAAAAAAAMC8UUTAAAAAQAAAAB2WAfpxDf31wvYyfzbDICHfJYBWDWznS7ANsQ44pLnsAAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAL779ksp//////////wAAAAEAAAABAAAABzMM6FgAAAAHNhhdXAAAAAAAAAAAAAAAAQLxRRMAAAABAAAAAHZYB+nEN/fXC9jJ/NsMgId8lgFYNbOdLsA2xDjikuewAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAvvvvgXn//////////AAAAAQAAAAEAAAAHMwzoWAAAAAc2FqrwAAAAAAAAAAAAAAADAvFFEwAAAAAAAAAAdlgH6cQ399cL2Mn82wyAh3yWAVg1s50uwDbEOOKS57AAAAP00HuBtQLg29wAAABWAAAAEgAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAQAAADjAodWAAAAAOHkbSYAAAAACAAAAAAAAAAEAAAAAAAAAAwAAAAAC8TWqAAAAAGVyhZIAAAAAAAAAAQLxRRMAAAAAAAAAAHZYB+nEN/fXC9jJ/NsMgId8lgFYNbOdLsA2xDjikuewAAAD9NCI260C4NvcAAAAVgAAABIAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAA4wJR7iwAAADh5G0mAAAAAAgAAAAAAAAABAAAAAAAAAAMAAAAAAvE1qgAAAABlcoWSAAAAAAAAAAMC8UUTAAAAAgAAAAB2WAfpxDf31wvYyfzbDICHfJYBWDWznS7ANsQ44pLnsAAAAABUsJu+AAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAAAAAAHGi4aAAACcQAAAE9wAAAAAAAAAAAAAAAAAAAAEC8UUTAAAAAgAAAAB2WAfpxDf31wvYyfzbDICHfJYBWDWznS7ANsQ44pLnsAAAAABUsJu+AAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAAAAAAHGhLzQAACcQAAAE9wAAAAAAAAAAAAAAAAAAAAMC8UUTAAAAAAAAAABIjYhvYWisiTshUtM79GwkWajGEU/j0uY62J4xez/fzAAAAACD5kVuAjTH3gAARP0AAAB0AAAAAQAAAADEccZDcGLJUGqJNC5TihraQE0vQc8dOiVfQyH3xuDhdQAAAAAAAAAJbG9ic3RyLmNvAAAAAQAAAAAAAAAAAAABAAAAJg293EYAAAAAAJiWfwAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAALxRRMAAAAAZXLe6gAAAAAAAAABAvFFEwAAAAAAAAAASI2Ib2ForIk7IVLTO/RsJFmoxhFP49LmOtieMXs/38wAAAAAg9jrdgI0x94AAET9AAAAdAAAAAEAAAAAxHHGQ3BiyVBqiTQuU4oa2kBNL0HPHTolX0Mh98bg4XUAAAAAAAAACWxvYnN0ci5jbwAAAAEAAAAAAAAAAAAAAQAAACYNvdxGAAAAAACYln8AAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAC8UUTAAAAAGVy3uoAAAAAAAAAAA==", "fee_meta_xdr": "AAAAAgAAAAMC8UULAAAAAAAAAABIjYhvYWisiTshUtM79GwkWajGEU/j0uY62J4xez/fzAAAAACJzs0+AjTH3gAARPwAAAB0AAAAAQAAAADEccZDcGLJUGqJNC5TihraQE0vQc8dOiVfQyH3xuDhdQAAAAAAAAAJbG9ic3RyLmNvAAAAAQAAAAAAAAAAAAABAAAAJg293EYAAAAAAJiWfwAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAALxRQsAAAAAZXLeuQAAAAAAAAABAvFFEwAAAAAAAAAASI2Ib2ForIk7IVLTO/RsJFmoxhFP49LmOtieMXs/38wAAAAAic7MdgI0x94AAET8AAAAdAAAAAEAAAAAxHHGQ3BiyVBqiTQuU4oa2kBNL0HPHTolX0Mh98bg4XUAAAAAAAAACWxvYnN0ci5jbwAAAAEAAAAAAAAAAAAAAQAAACYNvdxGAAAAAACYln8AAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAC8UULAAAAAGVy3rkAAAAA", "memo_type": "none", "signatures": [ "9O2yimZGibf2Zc2CNW9PcfRlAaHQBpDUlKtCkx3IQSKlIp0F/rozUFUMqgdeyiuvH8n7Pg23g25f7x5n/EaYAA==" ] } ] } } ``` --- ### `GET /liquidity_pools/{liquidity_pool_id}/operations` > Retrieves operations of a particular liquidity pool. This endpoint represents successful operations referencing a given liquidity pool and can be used in streaming mode. Streaming mode allows you to listen for new operations referencing this liquidity pool as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known operation unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream operations created since your request time. #### Parameters * `liquidity_pool_id` (any; path; required): a unique identifier for this liquidity pool. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to `true` to include failed operations in results. Options include `true` and `false`. * `join` (any; query): set to `transactions` to include the transactions which created each of the operations in the response. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "type_i": 0, "type": "create_account" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}/operations{?cursor,order,limit,include_failed,join} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/liquidity_pools/{liquidity_pool_id}/operations{?cursor,order,limit,include_failed,join} \ -H 'Accept: text/event-stream' ``` #### Response parameters ```json { "_links": { "self": { "href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/operations?cursor=&limit=3&order=asc" }, "next": { "href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/operations?cursor=120192452165550081&limit=3&order=asc" }, "prev": { "href": "https://rpc.ankr.com/liquidity_pools/67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9/operations?cursor=120192344791343105&limit=3&order=desc" } }, "_embedded": { "records": [ { "id": "3697472920621057", "paging_token": "3697472920621057", "transaction_successful": true, "source_account": "GBB4JST32UWKOLGYYSCEYBHBCOFL2TGBHDVOMZP462ET4ZRD4ULA7S2L", "type": "liquidity_pool_withdraw", "type_i": 23, "created_at": "2021-11-18T03:47:47Z", "transaction_hash": "43ed5ce19190822ec080b67c3ccbab36a56bc34102b1a21d3ee690ed3bc23378", "liquidity_pool_id": "67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9", "reserves_min": [ { "asset": "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", "min": "1000.0000005" }, { "asset": "PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", "min": "3000.0000005" } ], "shares": "200", "reserves_received": [ { "asset": "EURT:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", "amount": "993.0000005" }, { "asset": "PHP:GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S", "amount": "2478.0000005" } ] }, { "id": "157639717969326081", "paging_token": "157639717969326081", "transaction_successful": true, "source_account": "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG", "type": "change_trust", "type_i": 6, "created_at": "2021-08-04T20:01:24Z", "transaction_hash": "941f2fa2101d1265696a3c7d35e7688cd210324114e96b64a386ab55f65e488f", "asset_type": "liquidity_pool_shares", "liquidity_pool_id": "67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9", "limit": "1000", "trustor": "GBBWI7TEVQBPEUXKYNGI3GBAH7EHFEREONKK3UK56ZSLJIDIYHQJCVSG" } ] } } ``` --- ## Offers Offers are statements about how much of an asset an account wants to buy or sell. ### `GET /offers` > Lists all offers. This endpoint lists all currently open offers and can be used in streaming mode. Streaming mode allows you to listen for new offers as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known offer unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to `now`, you can stream offers created since your request time. When filtering by buying or selling arguments, you must use a combination of `selling_asset_type`, `selling_asset_issuer`, and `selling_asset_code` for the selling asset, or a combination of `buying_asset_type`, `buying_asset_issuer`, and `buying_asset_code` for the buying asset. #### Parameters * `sponsor` (string; query): an account ID of the sponsor. Every account in the response will either be sponsored by the given account ID or have a sub-entry (trustline, offer, or data entry) which is sponsored by the given account ID. * `seller` (any; query): the account ID of the offer creator. * `selling_asset_type` (string; query): the type for the selling asset. Either `native`, `credit_alphanum4`, or `credit_alphanum12`. * `selling_asset_issuer` (any; query): the Stellar address of the selling asset’s issuer. * `selling_asset_code` (any; query): the code for the selling asset. * `buying_asset_type` (string; query): the type for the buying asset. Either `native`, `credit_alphanum4`, or `credit_alphanum12`. * `buying_asset_issuer` (any; query): the Stellar address of the buying asset’s issuer. * `buying_asset_code` (any; query): the code for the buying asset. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "offer_maker": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "seller": "string", "selling": { "asset_type": "string", "asset_code": "string", "asset_issuer": "string" }, "buying": { "asset_type": "string", "asset_code": "string", "asset_issuer": "string" }, "amount": "string", "price_r": { "n": 0, "d": 0 }, "price": "string", "last_modified_ledger": 0, "last_modified_time": "string", "sponser": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/offers{?selling,buying,seller,sponsor,cursor,limit,order} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/offers{?selling,buying,seller,sponsor,cursor,limit,order} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/offers?cursor=\u0026limit=3\u0026order=asc\u0026selling_asset_code=USD\u0026selling_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026selling_asset_type=credit_alphanum4" }, "next": { "href": "https://rpc.ankr.com/offers?cursor=126423127\u0026limit=3\u0026order=asc\u0026selling_asset_code=USD\u0026selling_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026selling_asset_type=credit_alphanum4" }, "prev": { "href": "https://rpc.ankr.com/offers?cursor=71673427\u0026limit=3\u0026order=desc\u0026selling_asset_code=USD\u0026selling_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026selling_asset_type=credit_alphanum4" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/offers/71673427" }, "offer_maker": { "href": "https://rpc.ankr.com/accounts/GBJPWEIFX6KO4H52BF3QJDYRCLXB2P3Z3QTKWUGFOOFH5MSRZV4WLRZ7" } }, "id": "71673427", "paging_token": "71673427", "seller": "GBJPWEIFX6KO4H52BF3QJDYRCLXB2P3Z3QTKWUGFOOFH5MSRZV4WLRZ7", "selling": { "asset_type": "credit_alphanum4", "asset_code": "USD", "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX" }, "buying": { "asset_type": "credit_alphanum4", "asset_code": "BTC", "asset_issuer": "GAUTUYY2THLF7SGITDFMXJVYH3LHDSMGEAKSBU267M2K7A3W543CKUEF" }, "amount": "25.6545775", "price_r": { "n": 289696073, "d": 25654776 }, "price": "11.2920913", "last_modified_ledger": 26981646, "last_modified_time": null } ] } } ``` --- ### `GET /offers/{offer_id}` > Retrieves a particular offer. The single offer endpoint provides information on a specific offer. #### Parameters * `offer_id` (any; path; required): a unique identifier for this offer. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "offer_maker": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "seller": "string", "selling": { "asset_type": "string", "asset_code": "string", "asset_issuer": "string" }, "buying": { "asset_type": "string", "asset_code": "string", "asset_issuer": "string" }, "amount": "string", "price_r": { "n": 0, "d": 0 }, "price": "string", "last_modified_ledger": 0, "last_modified_time": "string", "sponser": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/offers/{offer_id} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/offers/{offer_id} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/offers/165563085" }, "offer_maker": { "href": "https://rpc.ankr.com/accounts/GCM4PT6XDZBWOOENDS6FOU22GJQLJPV2GC7VRVII4TFGZBA3ZXNM55SV" } }, "id": 165563085, "paging_token": "165563085", "seller": "GCM4PT6XDZBWOOENDS6FOU22GJQLJPV2GC7VRVII4TFGZBA3ZXNM55SV", "selling": { "asset_type": "credit_alphanum4", "asset_code": "USD", "asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX" }, "buying": { "asset_type": "native" }, "amount": "26.1075388", "price_r": { "n": 1449156725, "d": 84642346 }, "price": "17.1209423", "last_modified_ledger": 28412042, "last_modified_time": null } ``` --- ### `GET /offers/{offer_id}/trades` > Retrieves all trades of a particular offer. This endpoint represents all trades for a given offer and can be used in streaming mode. Streaming mode allows you to listen for trades for this offer as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time. #### Parameters * `offer_id` (any; path; required): a unique identifier for this offer. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "base": { "href": "string", "templated": true }, "counter": { "href": "string", "templated": true }, "operation": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "ledger_close_time": "string", "offer_id": "string", "trade_type": "string", "liquidity_pool_fee_bp": 0, "base_liquidity_pool_id": "string", "base_offer_id": "string", "base_account": "string", "base_amount": "string", "base_asset_type": "string", "base_asset_code": "string", "base_asset_issuer": "string", "counter_liquidity_pool_id": "string", "counter_offer_id": "string", "counter_account": "string", "counter_amount": "string", "counter_asset_type": "string", "counter_asset_code": "string", "counter_asset_issuer": "string", "base_is_seller": true, "price": { "n": "string", "d": "string" } } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/offers/{offer_id}/trades{?cursor,limit,order} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/offers/{offer_id}/trades{?cursor,limit,order} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/offers/104078276/trades?cursor=&limit=3&order=asc" }, "next": { "href": "https://rpc.ankr.com/offers/104078276/trades?cursor=107449584845914113-0&limit=3&order=asc" }, "prev": { "href": "https://rpc.ankr.com/offers/104078276/trades?cursor=107449468881756161-0&limit=3&order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "" }, "base": { "href": "https://rpc.ankr.com/accounts/GCO7OW5P2PP7WDN6YUDXUUOPAR4ZHJSDDCZTIAQRTRZHKQWV45WUPBWX" }, "counter": { "href": "https://rpc.ankr.com/accounts/GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K" }, "operation": { "href": "https://rpc.ankr.com/operations/107449468881756161" } }, "id": "107449468881756161-0", "paging_token": "107449468881756161-0", "ledger_close_time": "2019-07-26T09:17:02Z", "offer_id": "104078276", "base_offer_id": "104078276", "base_account": "GCO7OW5P2PP7WDN6YUDXUUOPAR4ZHJSDDCZTIAQRTRZHKQWV45WUPBWX", "base_amount": "4433.2000000", "base_asset_type": "native", "counter_offer_id": "4719135487309144065", "counter_account": "GD3CJYUTZAY6JQF4CEI6Z7VW5O6VNGKZTBYUECTOJPEDTB7I2HZSPI2K", "counter_amount": "443.3200000", "counter_asset_type": "credit_alphanum4", "counter_asset_code": "BB1", "counter_asset_issuer": "GD5J6HLF5666X4AZLTFTXLY46J5SW7EXRKBLEYPJP33S33MXZGV6CWFN", "base_is_seller": true, "price": { "n": 1, "d": 10 } } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/trades-p2/ title: Stellar — Trades, Transactions (2/3) source: docs/rpc-service/chains/chains-api/stellar/trades-p2.mdx --- # Stellar — Trades, Transactions (2/3) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/stellar/trades/) · 2 · [3](/rpc-service/chains/chains-api/stellar/trades-p3/) ## Transactions Transactions are commands that modify the ledger state and consist of one or more operations. ### `GET /transactions` This endpoint lists all Successful transactions and can be used in streaming mode. Streaming mode allows you to listen for new transactions as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known transaction unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream transactions created since your request time. #### Parameters * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to `true` to include failed operations in results. Options include `true` and `false`. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "memo": "string", "_links": { "self": { "href": "string", "templated": true }, "account": { "href": "string", "templated": true }, "ledger": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "successful": true, "hash": "string", "ledger": 0, "created_at": "string", "source_account": "string", "account_muxed": "string", "account_muxed_id": "string", "source_account_sequence": "string", "fee_account": "string", "fee_account_muxed": "string", "fee_account_muxed_id": "string", "fee_charged": "string", "max_fee": "string", "operation_count": 0, "envelope_xdr": "string", "result_xdr": "string", "result_meta_xdr": "string", "fee_meta_xdr": "string", "memo_type": "string", "signatures": [ "string" ], "valid_after": "string", "valid_before": "string", "preconditions": { "timebounds": { "min_time": "string", "max_time": "string" }, "ledgerbounds": { "min_ledger": "string", "max_ledger": "string" }, "min_account_sequence": "string", "min_account_sequence_age": "string", "min_account_sequence_ledger_gap": 0, "extra_signers": [ "string" ] }, "fee_bump_transaction": { "hash": "string", "signatures": [ "string" ] }, "inner_transaction": { "hash": "string", "signatures": [ "string" ], "max_fee": "string" } } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/transactions{?cursor,order,limit,include_failed} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/transactions{?cursor,order,limit,include_failed} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/transactions?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/transactions?cursor=211459450643419136\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/transactions?cursor=211459450643419136\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/transactions/f6ae066da1fa185c4c610b44499d7263b2cc14e33725c83bd2f0ff2e364be7ba" }, "account": { "href": "https://rpc.ankr.com/accounts/GBS7JRJRFZWPOQQ7HWZKX4T2JPLTTCANSTW22SE6XM2A2ALNBYXCCYHX" }, "ledger": { "href": "https://rpc.ankr.com/ledgers/49234240" }, "operations": { "href": "https://rpc.ankr.com/transactions/f6ae066da1fa185c4c610b44499d7263b2cc14e33725c83bd2f0ff2e364be7ba/operations{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/transactions/f6ae066da1fa185c4c610b44499d7263b2cc14e33725c83bd2f0ff2e364be7ba/effects{?cursor,limit,order}", "templated": true }, "precedes": { "href": "https://rpc.ankr.com/transactions?order=asc\u0026cursor=211459450643419136" }, "succeeds": { "href": "https://rpc.ankr.com/transactions?order=desc\u0026cursor=211459450643419136" }, "transaction": { "href": "https://rpc.ankr.com/transactions/f6ae066da1fa185c4c610b44499d7263b2cc14e33725c83bd2f0ff2e364be7ba" } }, "id": "f6ae066da1fa185c4c610b44499d7263b2cc14e33725c83bd2f0ff2e364be7ba", "paging_token": "211459450643419136", "successful": true, "hash": "f6ae066da1fa185c4c610b44499d7263b2cc14e33725c83bd2f0ff2e364be7ba", "ledger": 49234240, "created_at": "2023-11-29T10:37:29Z", "source_account": "GBS7JRJRFZWPOQQ7HWZKX4T2JPLTTCANSTW22SE6XM2A2ALNBYXCCYHX", "source_account_sequence": "208381320597235999", "fee_account": "GBS7JRJRFZWPOQQ7HWZKX4T2JPLTTCANSTW22SE6XM2A2ALNBYXCCYHX", "fee_charged": "1000", "max_fee": "1000", "operation_count": 10, "envelope_xdr": "AAAAAgAAAABl9MUxLmz3Qh89sqvyekvXOYgNlO2tSJ67NA0BbQ4uIQAAA+gC5FG1AAZpHwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAADAAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAAAB6EgAADIOwAAABkAAAAAVDy86AAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAMAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAAAPQkAAAMgxAAAAGQAAAABUPLzpAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAwAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAABbjYAAAyCcAAAAZAAAAAFQ8vOoAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAADAAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAAAHoSAAADIHQAAABkAAAAAVDy86wAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAMAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAAAmJaAAAMgTAAAAGQAAAABUPLzsAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAMAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAAAehIAABkXsAAAAyAAAAAFQ8vO0AAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAwAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAAAD0JAAAGRjwAAADIAAAAAVDy87gAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAADAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAAAW42AAAZGjAAAAMgAAAABUPLzvAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAMAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAAB6EgAABkbcAAAAyAAAAAFQ8vPAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAwAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAAAJiWgAAMjlwAAAGQAAAAAVDy88QAAAAAAAAACbQ4uIQAAAEClHLYfaxbw9ZvqHug/Ni7sn0NGRTn8X6L21E22rtWLOVx2Any2IurYu9lS2kjbO/2IESgxgLuJOKjAWDmaAM4KW7iJAgAAAEARJSiRDlabe5U2pQjMVx1Uah9MWrs9NDvXXmX5FuMQQaktOvMrzoJ2tmsGNDCjQX7/U/M6MfRHshUKc7O+L6AM", "result_xdr": "AAAAAAAAA+gAAAAAAAAACgAAAAAAAAAMAAAAAAAAAAAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vOgAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAPRsBYAAAABkAAMg7AAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAABUPLzpAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAHov6EAAAAAZAADIMQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAAVDy86gAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAC3PrSgAAAAGQAAyCcAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vOsAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAA9EdmgAAAABkAAMgdAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAABUPLzsAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAATFJ/eAAAAAZAADIEwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAAVDy87QAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAAAB6EgAAGRewAAADIAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vO4AAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAAA9CQAABkY8AAAAyAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAABUPLzvAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAAAW42AAAZGjAAAAMgAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAAVDy88AAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAAAHoSAAAGRtwAAADIAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vPEAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAACYloAADI5cAAABkAAAAAAAAAAAAAAAA", "result_meta_xdr": "AAAAAgAAAAIAAAADAu9BQAAAAAAAAAAAZfTFMS5s90IfPbKr8npL1zmIDZTtrUieuzQNAW0OLiEAAAACBOgJLgLkUbUABmkeAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAC70E/AAAAAGVnFF8AAAAAAAAAAQLvQUAAAAAAAAAAAGX0xTEubPdCHz2yq/J6S9c5iA2U7a1Inrs0DQFtDi4hAAAAAgToCS4C5FG1AAZpHwAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAAu9BQAAAAABlZxRpAAAAAAAAAAoAAAAGAAAAAwLvQT8AAAACAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vOgAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAPRuxKAAAABQAAKAxAAAAAAAAAAAAAAAAAAAAAQLvQUAAAAACAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vOgAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAPRsBYAAAABkAAMg7AAAAAAAAAAAAAAAAAAAAAwLvQT8AAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAABdUngf/////////8AAAABAAAAAQAAAAAAcnDgAAAAAABycOAAAAAAAAAAAAAAAAEC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAAXVJ4H//////////AAAAAQAAAAEAAAAAAHJw4AAAAAAAcnDgAAAAAAAAAAAAAAADAu9BPwAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAABCvzGhkf/////////8AAAABAAAAAQAAAAOXaX3YAAAAA5QlT1gAAAAAAAAAAAAAAAEC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAEK/MaGR//////////wAAAAEAAAABAAAAA5dpfdgAAAADlCSfkAAAAAAAAAAAAAAABgAAAAMC70E/AAAAAgAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAABUPLzpAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAHoxR9AAAAAUAACgKQAAAAAAAAAAAAAAAAAAAAEC70FAAAAAAgAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAABUPLzpAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAHov6EAAAAAZAADIMQAAAAAAAAAAAAAAAAAAAAMC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAAXVJ4H//////////AAAAAQAAAAEAAAAAAHJw4AAAAAAAcnDgAAAAAAAAAAAAAAABAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAAF1SeB//////////wAAAAEAAAABAAAAAABycOAAAAAAAHJw4AAAAAAAAAAAAAAAAwLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAQr8xoZH//////////AAAAAQAAAAEAAAADl2l92AAAAAOUJJ+QAAAAAAAAAAAAAAABAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAABCvzGhkf/////////8AAAABAAAAAQAAAAOXaX3YAAAAA5QjQAAAAAAAAAAAAAAAAAYAAAADAu9BPwAAAAIAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAAVDy86gAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAC3QMP4AAAAFAAAoCEAAAAAAAAAAAAAAAAAAAABAu9BQAAAAAIAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAAVDy86gAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAC3PrSgAAAAGQAAyCcAAAAAAAAAAAAAAAAAAAADAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAAF1SeB//////////wAAAAEAAAABAAAAAABycOAAAAAAAHJw4AAAAAAAAAAAAAAAAQLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAABdUngf/////////8AAAABAAAAAQAAAAAAcnDgAAAAAABycOAAAAAAAAAAAAAAAAMC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAEK/MaGR//////////wAAAAEAAAABAAAAA5dpfdgAAAADlCNAAAAAAAAAAAAAAAAAAQLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAQr8xoZH//////////AAAAAQAAAAEAAAADl2l92AAAAAOUITCoAAAAAAAAAAAAAAAGAAAAAwLvQT8AAAACAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vOsAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAA9EoloAAAAAQAACAFAAAAAAAAAAAAAAAAAAAAAQLvQUAAAAACAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vOsAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAA9EdmgAAAABkAAMgdAAAAAAAAAAAAAAAAAAAAAwLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAABdUngf/////////8AAAABAAAAAQAAAAAAcnDgAAAAAABycOAAAAAAAAAAAAAAAAEC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAAXVJ4H//////////AAAAAQAAAAEAAAAAAHJw4AAAAAAAcnDgAAAAAAAAAAAAAAADAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAABCvzGhkf/////////8AAAABAAAAAQAAAAOXaX3YAAAAA5QhMKgAAAAAAAAAAAAAAAEC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAEK/MaGR//////////wAAAAEAAAABAAAAA5dpfdgAAAADlB5xiAAAAAAAAAAAAAAABgAAAAMC70E/AAAAAgAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAABUPLzsAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAATFNbMgAAAAUAACgEQAAAAAAAAAAAAAAAAAAAAEC70FAAAAAAgAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAABUPLzsAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAATFJ/eAAAAAZAADIEwAAAAAAAAAAAAAAAAAAAAMC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAAXVJ4H//////////AAAAAQAAAAEAAAAAAHJw4AAAAAAAcnDgAAAAAAAAAAAAAAABAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAAF1SeB//////////wAAAAEAAAABAAAAAABycOAAAAAAAHJw4AAAAAAAAAAAAAAAAwLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAQr8xoZH//////////AAAAAQAAAAEAAAADl2l92AAAAAOUHnGIAAAAAAAAAAAAAAABAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAABCvzGhkf/////////8AAAABAAAAAQAAAAOXaX3YAAAAA5QbAqAAAAAAAAAAAAAAAAYAAAADAu9BPwAAAAIAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAAVDy87QAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAAAB6EgAAGRfQAAADIAAAAAAAAAAAAAAAAAAAABAu9BQAAAAAIAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAAVDy87QAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAAAB6EgAAGRewAAADIAAAAAAAAAAAAAAAAAAAADAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAABCvzGhkf/////////8AAAABAAAAAQAAAAOXaX3YAAAAA5QbAqAAAAAAAAAAAAAAAAEC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAEK/MaGR//////////wAAAAEAAAABAAAAA5dpL7gAAAADlBsCoAAAAAAAAAAAAAAAAwLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAABdUngf/////////8AAAABAAAAAQAAAAAAcnDgAAAAAABycOAAAAAAAAAAAAAAAAEC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAAXVJ4H//////////AAAAAQAAAAEAAAAAAHJw4AAAAAAAcnDgAAAAAAAAAAAAAAAGAAAAAwLvQT8AAAACAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vO4AAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAAA9CQAABkZEAAAAyAAAAAAAAAAAAAAAAAAAAAQLvQUAAAAACAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vO4AAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAAA9CQAABkY8AAAAyAAAAAAAAAAAAAAAAAAAAAwLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAQr8xoZH//////////AAAAAQAAAAEAAAADl2kvuAAAAAOUGwKgAAAAAAAAAAAAAAABAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAABCvzGhkf/////////8AAAABAAAAAQAAAAOXaJN4AAAAA5QbAqAAAAAAAAAAAAAAAAMC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAAXVJ4H//////////AAAAAQAAAAEAAAAAAHJw4AAAAAAAcnDgAAAAAAAAAAAAAAABAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAAF1SeB//////////wAAAAEAAAABAAAAAABycOAAAAAAAHJw4AAAAAAAAAAAAAAABgAAAAMC70E/AAAAAgAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAABUPLzvAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAAAW42AAAZGlAAAAMgAAAAAAAAAAAAAAAAAAAAEC70FAAAAAAgAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAABUPLzvAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAAAAW42AAAZGjAAAAMgAAAAAAAAAAAAAAAAAAAAMC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAEK/MaGR//////////wAAAAEAAAABAAAAA5dok3gAAAADlBsCoAAAAAAAAAAAAAAAAQLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAQr8xoZH//////////AAAAAQAAAAEAAAADl2epGAAAAAOUGwKgAAAAAAAAAAAAAAADAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAAF1SeB//////////wAAAAEAAAABAAAAAABycOAAAAAAAHJw4AAAAAAAAAAAAAAAAQLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAABdUngf/////////8AAAABAAAAAQAAAAAAcnDgAAAAAABycOAAAAAAAAAAAAAAAAYAAAADAu9BPwAAAAIAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAAVDy88AAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAAAHoSAAAGRuQAAADIAAAAAAAAAAAAAAAAAAAABAu9BQAAAAAIAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAAAVDy88AAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAAAAAHoSAAAGRtwAAADIAAAAAAAAAAAAAAAAAAAADAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAABCvzGhkf/////////8AAAABAAAAAQAAAAOXZ6kYAAAAA5QbAqAAAAAAAAAAAAAAAAEC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAEK/MaGR//////////wAAAAEAAAABAAAAA5dmcJgAAAADlBsCoAAAAAAAAAAAAAAAAwLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAABdUngf/////////8AAAABAAAAAQAAAAAAcnDgAAAAAABycOAAAAAAAAAAAAAAAAEC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAAXVJ4H//////////AAAAAQAAAAEAAAAAAHJw4AAAAAAAcnDgAAAAAAAAAAAAAAAGAAAAAwLvQT8AAAACAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vPEAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAACYloAADI5sAAABkAAAAAAAAAAAAAAAAAAAAAQLvQUAAAAACAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAFQ8vPEAAAACYWVFVEgAAAAAAAAAAAAAABawxDA4H26V1b3Pi0fJ5kYIb6FkmgHgwba7V1D0xHLOAAAAAVVTREMAAAAAO5kROA7+mIugqJAOsc/kTzZvfb6Ua+0HckD39iTfFcUAAAAAACYloAADI5cAAABkAAAAAAAAAAAAAAAAAAAAAwLvQUAAAAABAAAAAFAKMhdZdLOqwqPsm/8WkDex5ZPPNHSJASacEdNbuIkCAAAAAmFlRVRIAAAAAAAAAAAAAAAWsMQwOB9uldW9z4tHyeZGCG+hZJoB4MG2u1dQ9MRyzgAAAAABdUngf/////////8AAAABAAAAAQAAAAAAcnDgAAAAAABycOAAAAAAAAAAAAAAAAEC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAJhZUVUSAAAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAAXVJ4H//////////AAAAAQAAAAEAAAAAAHJw4AAAAAAAcnDgAAAAAAAAAAAAAAADAu9BQAAAAAEAAAAAUAoyF1l0s6rCo+yb/xaQN7Hlk880dIkBJpwR01u4iQIAAAABVVNEQwAAAAA7mRE4Dv6Yi6CokA6xz+RPNm99vpRr7QdyQPf2JN8VxQAAABCvzGhkf/////////8AAAABAAAAAQAAAAOXZnCYAAAAA5QbAqAAAAAAAAAAAAAAAAEC70FAAAAAAQAAAABQCjIXWXSzqsKj7Jv/FpA3seWTzzR0iQEmnBHTW7iJAgAAAAFVU0RDAAAAADuZETgO/piLoKiQDrHP5E82b32+lGvtB3JA9/Yk3xXFAAAAEK/MaGR//////////wAAAAEAAAABAAAAA5dk6fgAAAADlBsCoAAAAAAAAAAAAAAAAA==", "fee_meta_xdr": "AAAAAgAAAAMC70E/AAAAAAAAAABl9MUxLmz3Qh89sqvyekvXOYgNlO2tSJ67NA0BbQ4uIQAAAAIE6A0WAuRRtQAGaR4AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAALvQT8AAAAAZWcUXwAAAAAAAAABAu9BQAAAAAAAAAAAZfTFMS5s90IfPbKr8npL1zmIDZTtrUieuzQNAW0OLiEAAAACBOgJLgLkUbUABmkeAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAC70E/AAAAAGVnFF8AAAAA", "memo_type": "none", "signatures": [ "pRy2H2sW8PWb6h7oPzYu7J9DRkU5/F+i9tRNtq7VizlcdgJ8tiLq2LvZUtpI2zv9iBEoMYC7iTiowFg5mgDOCg==", "ESUokQ5Wm3uVNqUIzFcdVGofTFq7PTQ7115l+RbjEEGpLTrzK86CdrZrBjQwo0F+/1PzOjH0R7IVCnOzvi+gDA==" ], "valid_after": "1970-01-01T00:00:00Z", "preconditions": { "timebounds": { "min_time": "0" } } } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/trades-p3/ title: Stellar — Trades, Transactions (3/3) source: docs/rpc-service/chains/chains-api/stellar/trades-p3.mdx --- # Stellar — Trades, Transactions (3/3) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/stellar/trades/) · [2](/rpc-service/chains/chains-api/stellar/trades-p2/) · 3 ## Transactions ### `POST /transactions` > Submits a transaction. This endpoint actually submits a transaction to the Stellar network. It only takes a single, required parameter: the signed transaction. Refer to the Transactions page for details on how to craft a proper one. If you submit a transaction that has already been included in a ledger, this endpoint will return the same response as would’ve been returned for the original transaction submission. This allows for safe resubmission of transactions in error scenarios, as highlighted in the error-handling guide. #### Parameters * `tx` (string; query; required): a signed transaction. #### Returns ```json { "_embedded": { "records": [ { "memo": "string", "memo_bytes": "string", "_links": { "self": { "href": "string", "templated": true }, "account": { "href": "string", "templated": true }, "ledger": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "successful": true, "hash": "string", "ledger": 0, "created_at": "string", "source_account": "string", "account_muxed": "string", "account_muxed_id": "string", "source_account_sequence": "string", "fee_account": "string", "fee_account_muxed": "string", "fee_account_muxed_id": "string", "fee_charged": "string", "max_fee": "string", "operation_count": 0, "envelope_xdr": "string", "result_xdr": "string", "result_meta_xdr": "string", "fee_meta_xdr": "string", "memo_type": "string", "signatures": [ "string" ], "valid_after": "string", "valid_before": "string", "preconditions": { "timebounds": { "min_time": "string", "max_time": "string" }, "ledgerbounds": { "min_ledger": "string", "max_ledger": "string" }, "min_account_sequence": "string", "min_account_sequence_age": "string", "min_account_sequence_ledger_gap": 0, "extra_signers": [ "string" ] }, "fee_bump_transaction": { "hash": "string", "signatures": [ "string" ] }, "inner_transaction": { "hash": "string", "signatures": [ "string" ], "max_fee": "string" } } ] } } ``` #### Request example ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/stellar_horizon/transactions{?tx} ``` ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/stellar_horizon/transactions{?tx} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "memo": "Test Transaction", "memo_bytes": "VGVzdCBUcmFuc2FjdGlvbg==", "_links": { "self": { "href": "https://rpc.ankr.com/transactions/8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124" }, "account": { "href": "https://rpc.ankr.com/accounts/GCIHAQVWZH2AB5BB5NP63FBSIREG77LQZZNUVKD2LN2IOCLOT6N72MJN" }, "ledger": { "href": "https://rpc.ankr.com/ledgers/139575" }, "operations": { "href": "https://rpc.ankr.com/transactions/8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124/operations{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/transactions/8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124/effects{?cursor,limit,order}", "templated": true }, "precedes": { "href": "https://rpc.ankr.com/transactions?order=asc&cursor=599470060347392" }, "succeeds": { "href": "https://rpc.ankr.com/transactions?order=desc&cursor=599470060347392" }, "transaction": { "href": "https://rpc.ankr.com/transactions/8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124" } }, "id": "8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124", "paging_token": "599470060347392", "successful": true, "hash": "8ef0c6d60357bf91b0b0d7800b747ff02bf73117d3e017690cbff641ca67f124", "ledger": 139575, "created_at": "2021-03-25T21:14:11Z", "source_account": "GCIHAQVWZH2AB5BB5NP63FBSIREG77LQZZNUVKD2LN2IOCLOT6N72MJN", "source_account_sequence": "599336916353025", "fee_account": "GCIHAQVWZH2AB5BB5NP63FBSIREG77LQZZNUVKD2LN2IOCLOT6N72MJN", "fee_charged": "100", "max_fee": "100", "operation_count": 1, "envelope_xdr": "AAAAAgAAAACQcEK2yfQA9CHrX+2UMkRIb/1wzltKqHpbdIcJbp+b/QAAAGQAAiEYAAAAAQAAAAEAAAAAAAAAAAAAAABgXP3QAAAAAQAAABBUZXN0IFRyYW5zYWN0aW9uAAAAAQAAAAAAAAABAAAAAJBwQrbJ9AD0Ietf7ZQyREhv/XDOW0qoelt0hwlun5v9AAAAAAAAAAAF9eEAAAAAAAAAAAFun5v9AAAAQKdJnG8QRiv9xGp1Oq7ACv/xR2BnNqjfUHrGNua7m4tWbrun3+GmAj6ca3xz+4ZppWRTbvTUcCxvpbHERZ85QgY=", "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=", "result_meta_xdr": "AAAAAgAAAAIAAAADAAIhNwAAAAAAAAAAkHBCtsn0APQh61/tlDJESG/9cM5bSqh6W3SHCW6fm/0AAAAXSHbnnAACIRgAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAIhNwAAAAAAAAAAkHBCtsn0APQh61/tlDJESG/9cM5bSqh6W3SHCW6fm/0AAAAXSHbnnAACIRgAAAABAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAA=", "fee_meta_xdr": "AAAAAgAAAAMAAiEYAAAAAAAAAACQcEK2yfQA9CHrX+2UMkRIb/1wzltKqHpbdIcJbp+b/QAAABdIdugAAAIhGAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAiE3AAAAAAAAAACQcEK2yfQA9CHrX+2UMkRIb/1wzltKqHpbdIcJbp+b/QAAABdIduecAAIhGAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA==", "memo_type": "text", "signatures": [ "p0mcbxBGK/3EanU6rsAK//FHYGc2qN9QesY25rubi1Zuu6ff4aYCPpxrfHP7hmmlZFNu9NRwLG+lscRFnzlCBg==" ], "valid_after": "1970-01-01T00:00:00Z", "valid_before": "2021-03-25T21:17:04Z" } ``` --- ### `GET /transactions/{transaction_hash}` > Retrieves a particular transaction. The single transaction endpoint provides information on a specific transaction. #### Parameters * `transaction_hash` (string; path; required): transactions are commands that modify the ledger state and consist of one or more operations. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "account": { "href": "string", "templated": true }, "ledger": { "href": "string", "templated": true }, "operations": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "successful": true, "hash": "string", "ledger": 0, "created_at": "string", "source_account": "string", "account_muxed": "string", "account_muxed_id": "string", "source_account_sequence": "string", "fee_account": "string", "fee_account_muxed": "string", "fee_account_muxed_id": "string", "fee_charged": "string", "max_fee": "string", "operation_count": 0, "envelope_xdr": "string", "result_xdr": "string", "result_meta_xdr": "string", "fee_meta_xdr": "string", "memo_type": "string", "signatures": [ "string" ] } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc" }, "account": { "href": "https://rpc.ankr.com/accounts/GDI5EK4HNMBHJJQGP3GUXQJIIOHU2CJO3LABPWD6WYSPJZP5NP67TMNN" }, "ledger": { "href": "https://rpc.ankr.com/ledgers/27963785" }, "operations": { "href": "https://rpc.ankr.com/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc/operations{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc/effects{?cursor,limit,order}", "templated": true }, "precedes": { "href": "https://rpc.ankr.com/transactions?order=asc\u0026cursor=120103542047408128" }, "succeeds": { "href": "https://rpc.ankr.com/transactions?order=desc\u0026cursor=120103542047408128" }, "transaction": { "href": "https://rpc.ankr.com/transactions/5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc" } }, "id": "5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc", "paging_token": "120103542047408128", "successful": true, "hash": "5ebd5c0af4385500b53dd63b0ef5f6e8feef1a7e1c86989be3cdcce825f3c0cc", "ledger": 27963785, "created_at": "2020-01-28T10:03:33Z", "source_account": "GDI5EK4HNMBHJJQGP3GUXQJIIOHU2CJO3LABPWD6WYSPJZP5NP67TMNN", "source_account_sequence": "65046128646685383", "fee_account": "GDI5EK4HNMBHJJQGP3GUXQJIIOHU2CJO3LABPWD6WYSPJZP5NP67TMNN", "fee_charged": "100", "max_fee": "100", "operation_count": 1, "envelope_xdr": "AAAAANHSK4drAnSmBn7NS8EoQ49NCS7awBfYfrYk9OX9a/35AAAAZADnFxwAAALHAAAAAAAAAAAAAAABAAAAAQAAAADR0iuHawJ0pgZ+zUvBKEOPTQku2sAX2H62JPTl/Wv9+QAAAAEAAAAA+qpaPAsU/CGcSeS4KnvqE9y+Bcjhyr1l6jiwixRsvu8AAAABTkdOVAAAAAAs4YIuYne69wMuNtfiZ64gb7E3qnTR7A4yD4jZDSS8AQAAAdGpSiAAAAAAAAAAAAH9a/35AAAAQM5LSBiFRQKtFYRPpNabwVuvIhZSVRDaajf0KzYaqJmgaXAlFaTOYyYc11YuxUM1Fzl1VT4UEbI22BvO/8HzUgQ=", "result_xdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=", "result_meta_xdr": "AAAAAgAAAAIAAAADAaqxiQAAAAAAAAAA0dIrh2sCdKYGfs1LwShDj00JLtrAF9h+tiT05f1r/fkAAAAAAhWQlADnFxwAAALGAAAAAQAAAAEAAAAAhD8BLsZFQEF33rKS6YopQUT3b6iLBG4nspe68/DBNBYAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBqrGJAAAAAAAAAADR0iuHawJ0pgZ+zUvBKEOPTQku2sAX2H62JPTl/Wv9+QAAAAACFZCUAOcXHAAAAscAAAABAAAAAQAAAACEPwEuxkVAQXfespLpiilBRPdvqIsEbieyl7rz8ME0FgAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAQAAAADAan62gAAAAEAAAAA+qpaPAsU/CGcSeS4KnvqE9y+Bcjhyr1l6jiwixRsvu8AAAABTkdOVAAAAAAs4YIuYne69wMuNtfiZ64gb7E3qnTR7A4yD4jZDSS8AQAAAAAAAAALf/////////8AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBqrGJAAAAAQAAAAD6qlo8CxT8IZxJ5Lgqe+oT3L4FyOHKvWXqOLCLFGy+7wAAAAFOR05UAAAAACzhgi5id7r3Ay421+JnriBvsTeqdNHsDjIPiNkNJLwBAAAB0alKIAt//////////wAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwGp+6EAAAABAAAAANHSK4drAnSmBn7NS8EoQ49NCS7awBfYfrYk9OX9a/35AAAAAU5HTlQAAAAALOGCLmJ3uvcDLjbX4meuIG+xN6p00ewOMg+I2Q0kvAEAAAkQQwRXzX//////////AAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAaqxiQAAAAEAAAAA0dIrh2sCdKYGfs1LwShDj00JLtrAF9h+tiT05f1r/fkAAAABTkdOVAAAAAAs4YIuYne69wMuNtfiZ64gb7E3qnTR7A4yD4jZDSS8AQAABz6ZujfNf/////////8AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", "fee_meta_xdr": "AAAAAgAAAAMBqfuhAAAAAAAAAADR0iuHawJ0pgZ+zUvBKEOPTQku2sAX2H62JPTl/Wv9+QAAAAACFZD4AOcXHAAAAsYAAAABAAAAAQAAAACEPwEuxkVAQXfespLpiilBRPdvqIsEbieyl7rz8ME0FgAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQGqsYkAAAAAAAAAANHSK4drAnSmBn7NS8EoQ49NCS7awBfYfrYk9OX9a/35AAAAAAIVkJQA5xccAAACxgAAAAEAAAABAAAAAIQ/AS7GRUBBd96ykumKKUFE92+oiwRuJ7KXuvPwwTQWAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", "memo_type": "none", "signatures": [ "zktIGIVFAq0VhE+k1pvBW68iFlJVENpqN/QrNhqomaBpcCUVpM5jJhzXVi7FQzUXOXVVPhQRsjbYG87/wfNSBA==" ] } ``` --- ### `GET /transactions/{transaction_hash}/operations` > Retrieves all operations of a particular transaction. This endpoint returns Successful operations for a specific transaction. #### Parameters * `transaction_hash` (string; path; required): transactions are commands that modify the ledger state and consist of one or more operations. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. * `include_failed` (boolean; query): set to true to include failed operations in results. Options include `true` and `false`. * `join` (any; query): set to transactions to include the transactions which created each of the operations in the response. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true }, "effects": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "transaction": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "type_i": 0, "type": "create_account" } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash}/operations{?cursor,order,limit,include_failed,join} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash}/operations{?cursor,order,limit,include_failed,join} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a/operations?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a/operations?cursor=120133379185221633\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a/operations?cursor=120133379185221633\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/operations/120133379185221633" }, "transaction": { "href": "https://rpc.ankr.com/transactions/6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a" }, "effects": { "href": "https://rpc.ankr.com/operations/120133379185221633/effects" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=120133379185221633" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=120133379185221633" } }, "id": "120133379185221633", "paging_token": "120133379185221633", "transaction_successful": true, "source_account": "GDJX67SFY2N73H72TWMKKBQP5UPBNKBNUMNE2IGFKNES43S4327X6DHG", "type": "manage_buy_offer", "type_i": 12, "created_at": "2020-01-28T21:14:59Z", "transaction_hash": "6b983a4e0dc3c04f4bd6b9037c55f70a09c434dfd01492be1077cf7ea68c2e4a", "amount": "0.0000000", "price": "0.0001000", "price_r": { "n": 1, "d": 10000 }, "buying_asset_type": "native", "selling_asset_type": "credit_alphanum4", "selling_asset_code": "ETH", "selling_asset_issuer": "GBDEVU63Y6NTHJQQZIKVTC23NWLQVP3WJ2RI2OTSJTNYOIGICST6DUXR", "offer_id": "149983118" } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/trades/ title: Stellar — Trades, Transactions (1/3) source: docs/rpc-service/chains/chains-api/stellar/trades.mdx --- # Stellar — Trades, Transactions (1/3) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/stellar/trades-p2/) · [3](/rpc-service/chains/chains-api/stellar/trades-p3/) ## Trades When an offer is fully or partially fulfilled, a trade happens. Trades can also be caused by successful path payments, because path payments involve fulfilling offers. A trade occurs between two parties — `base` and `counter`. Which is which is either arbitrary or determined by the calling query. ### `GET /trades` > Lists all trades. This endpoint lists all trades and can be used in streaming mode. Streaming mode allows you to listen for new trades as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time. When filtering for a specific orderbook, you must use all six of these arguments: base_asset_type, base_asset_issuer, base_asset_code, counter_asset_type, counter_asset_issuer, and counter_asset_code. If the base or counter asset is XLM, you only need to indicate the asset type as native and do not need to designate the code or the issuer. #### Parameters * `offer_id` (any; query): the offer ID. Used to filter for trades originating from a specific offer. * `base_asset_type` (string; query): the type for the base asset. Either `native`, `credit_alphanum4`, or `credit_alphanum12`. * `base_asset_issuer` (string; query): the Stellar address of the base asset’s issuer. * `base_asset_code` (string; query): the code for the base asset. * `counter_asset_type` (string; query): the type for the counter asset. Either `native`, `credit_alphanum4`, or `credit_alphanum12`. * `counter_asset_issuer` (string; query): the Stellar address of the counter asset’s issuer. * `counter_asset_code` (any; query): the code for the counter asset. * `trade_type` (string; query): can be set to `all`, `orderbook`, or `liquidity_pools` to filter only trades executed across a given mechanism. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "self": { "href": "string", "templated": true }, "base": { "href": "string", "templated": true }, "counter": { "href": "string", "templated": true }, "operation": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "ledger_close_time": "string", "offer_id": "string", "trade_type": "string", "liquidity_pool_fee_bp": 0, "base_liquidity_pool_id": "string", "base_offer_id": "string", "base_account": "string", "base_amount": "string", "base_asset_type": "string", "base_asset_code": "string", "base_asset_issuer": "string", "counter_liquidity_pool_id": "string", "counter_offer_id": "string", "counter_account": "string", "counter_amount": "string", "counter_asset_type": "string", "counter_asset_code": "string", "counter_asset_issuer": "string", "base_is_seller": true, "price": { "n": "string", "d": "string" } } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/trades{?offer_id,base_asset_type,base_asset_issuer,base_asset_code,counter_asset_type,counter_asset_issuer,counter_asset_code,trade_type,cursor, order,limit} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/trades{?offer_id,base_asset_type,base_asset_issuer,base_asset_code,counter_asset_type,counter_asset_issuer,counter_asset_code,trade_type,cursor, order,limit} \ -H 'Accept: text/event-stream' ``` ```json { "_links": { "self": { "href": "https://rpc.ankr.com/trades?base_asset_code=USD\u0026base_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026base_asset_type=credit_alphanum4\u0026counter_asset_type=native\u0026cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/trades?base_asset_code=USD\u0026base_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026base_asset_type=credit_alphanum4\u0026counter_asset_type=native\u0026cursor=211460674709372929-0\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/trades?base_asset_code=USD\u0026base_asset_issuer=GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX\u0026base_asset_type=credit_alphanum4\u0026counter_asset_type=native\u0026cursor=211460674709372929-0\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "" }, "base": { "href": "https://rpc.ankr.com/liquidity_pools/a75f810b19fd77af3955da980679db82dacb4264a0062493d08fe935aab4993e" }, "counter": { "href": "https://rpc.ankr.com/accounts/GA4QH4AJGERVYX4PBY55JYTQJ4RTLJIBYV7OCYIV56LWZE5MVDH3R3UQ" }, "operation": { "href": "https://rpc.ankr.com/operations/211460674709372929" } }, "id": "211460674709372929-0", "paging_token": "211460674709372929-0", "ledger_close_time": "2023-11-29T11:05:31Z", "trade_type": "liquidity_pool", "liquidity_pool_fee_bp": 30, "base_liquidity_pool_id": "a75f810b19fd77af3955da980679db82dacb4264a0062493d08fe935aab4993e", "base_amount": "0.0071205", "base_asset_type": "credit_alphanum4", "base_asset_code": "USD", "base_asset_issuer": "GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX", "counter_offer_id": "4823146693136760833", "counter_account": "GA4QH4AJGERVYX4PBY55JYTQJ4RTLJIBYV7OCYIV56LWZE5MVDH3R3UQ", "counter_amount": "0.0618899", "counter_asset_type": "native", "base_is_seller": true, "price": { "n": "618899", "d": "71205" } } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/transactions-p2/ title: Stellar — Transactions, Soroban JSON-RPC methods (2/2) source: docs/rpc-service/chains/chains-api/stellar/transactions-p2.mdx --- # Stellar — Transactions, Soroban JSON-RPC methods (2/2) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/stellar/transactions/) · 2 ## Soroban JSON-RPC methods ### `getNetwork` > Retrieves network config. General information about the currently configured network. This response will contain all the information needed to successfully submit transactions to the network this node serves. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. #### Returns * `passphrase` (string): the network passphrase configured for this Soroban RPC node. * `protocolVersion` (number): Stellar Core protocol version associated with the latest ledger. * `friendbotUrl` (string): the URL of this network's "friendbot" faucet. #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getNetwork" }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "friendbotUrl": "https://friendbot-testnet.stellar.org/", "passphrase": "Test SDF Network ; September 2015", "protocolVersion": 20 } } ``` --- ### `getTransaction` > Retrieves transaction details. The `getTransaction` method provides details about the specified transaction. Clients are expected to periodically query this method to ascertain when a transaction has been successfully recorded on the blockchain. The soroban-rpc system maintains a restricted history of recently processed transactions, with the default retention window set at 1440 ledgers, approximately equivalent to a 2-hour timeframe. For private soroban-rpc instances, it is possible to modify the retention window value by adjusting the transaction-retention-window configuration setting. For comprehensive debugging needs that extend beyond the 2-hour timeframe, it is advisable to retrieve transaction information from Horizon, as it provides a lasting and persistent record. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `hash` (string; required): a transaction hash to query (hex-encoded string); This transaction hash should correspond to the transaction that has been previously submitted to the network (pattern: `^[a-f\d]{64}$`). #### Returns * `status` (string): the current status of the transaction specified by hash (enum: `SUCCESS`, `NOT_FOUND`, `FAILED`). * `latestLedger` (number): the sequence number of the latest ledger known to Soroban RPC at the time it handles the request. * `latestLedgerCloseTime` (string): the unix stamp of the close time of the latest ledger known to Soroban RPC at the time it handles the request. * `oldestLedger` (number): the sequence number of the oldest ledger ingested by Soroban RPC at the time it handles the request. * `oldestLedgerCloseTime` (string): the unix stamp of the close time of the oldest ledger ingested by Soroban RPC at the time it handles the request. * `ledger` (number): the sequence number of the ledger which included the transaction. This field is only present if `status` is `SUCCESS` or `FAILED`. * `createdAt` (string): the unix timestamp of when the transaction was included in the ledger. This field is only present if `status` is `SUCCESS` or `FAILED`. * `applicationOrder` (number): the index of the transaction among all transactions included in the ledger. This field is only present if `status` is `SUCCESS` or `FAILED`. * `feeBump` (boolean): indicates whether the transaction was fee bumped. This field is only present if `status` is `SUCCESS` or `FAILED`. * `envelopeXdr` (string): a base64-encoded string of the raw TransactionEnvelope XDR struct for this transaction. * `resultXdr` (string): a base64-encoded string of the raw TransactionResult XDR struct for this transaction. This field is only present if `status` is `SUCCESS` or `FAILED`. * `resultMetaXdr` (string): a base64-encoded string of the raw TransactionResultMeta XDR struct for this transaction. #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTransaction", "params": { "hash": "6bc97bddc21811c626839baf4ab574f4f9f7ddbebb44d286ae504396d4e752da" } }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "status": "SUCCESS", "latestLedger": 2540076, "latestLedgerCloseTime": "1700086333", "oldestLedger": 2538637, "oldestLedgerCloseTime": "1700078796", "applicationOrder": 1, "envelopeXdr": "AAAAAgAAAADGFY14/R1KD0VGtTbi5Yp4d7LuMW0iQbLM/AUiGKj5owCpsoQAJY3OAAAjqgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABhhOwI+RL18Zpk7cqI5pRRf0L96jE8i+0x3ekhuBh2cUAAAARc2V0X2N1cnJlbmN5X3JhdGUAAAAAAAACAAAADwAAAANldXIAAAAACQAAAAAAAAAAAAAAAAARCz4AAAABAAAAAAAAAAAAAAABhhOwI+RL18Zpk7cqI5pRRf0L96jE8i+0x3ekhuBh2cUAAAARc2V0X2N1cnJlbmN5X3JhdGUAAAAAAAACAAAADwAAAANldXIAAAAACQAAAAAAAAAAAAAAAAARCz4AAAAAAAAAAQAAAAAAAAABAAAAB4408vVXuLU3mry897TfPpYjjsSN7n42REos241RddYdAAAAAQAAAAYAAAABhhOwI+RL18Zpk7cqI5pRRf0L96jE8i+0x3ekhuBh2cUAAAAUAAAAAQFvcYAAAImAAAAHxAAAAAAAAAACAAAAARio+aMAAABATbFMyom/TUz87wHex0LoYZA8jbNJkXbaDSgmOdk+wSBFJuMuta+/vSlro0e0vK2+1FqD/zWHZeYig4pKmM3rDA==", "resultXdr": "AAAAAAARFy8AAAAAAAAAAQAAAAAAAAAYAAAAAMu8SHUN67hTUJOz3q+IrH9M/4dCVXaljeK6x1Ss20YWAAAAAA==", "resultMetaXdr": "AAAAAwAAAAAAAAACAAAAAwAmwiAAAAAAAAAAAMYVjXj9HUoPRUa1NuLlinh3su4xbSJBssz8BSIYqPmjAAAAFUHZob0AJY3OAAAjqQAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAACbCHwAAAABlVUH3AAAAAAAAAAEAJsIgAAAAAAAAAADGFY14/R1KD0VGtTbi5Yp4d7LuMW0iQbLM/AUiGKj5owAAABVB2aG9ACWNzgAAI6oAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAmwiAAAAAAZVVB/AAAAAAAAAABAAAAAgAAAAMAJsIfAAAABgAAAAAAAAABhhOwI+RL18Zpk7cqI5pRRf0L96jE8i+0x3ekhuBh2cUAAAAUAAAAAQAAABMAAAAAjjTy9Ve4tTeavLz3tN8+liOOxI3ufjZESizbjVF11h0AAAABAAAABQAAABAAAAABAAAAAQAAAA8AAAAJQ29yZVN0YXRlAAAAAAAAEQAAAAEAAAAGAAAADwAAAAVhZG1pbgAAAAAAABIAAAAAAAAAADn1LT+CCK/HiHMChoEi/AtPrkos4XRR2E45Pr25lb3/AAAADwAAAAljb2xfdG9rZW4AAAAAAAASAAAAAdeSi3LCcDzP6vfrn", "ledger": 2540064, "createdAt": "1700086268" } } ``` --- ### `getTransactions` > Retrieves list of transactions. The `getTransactions` method return a detailed list of transactions starting from the user specified starting point that you can paginate as long as the pages fall within the history retention of their corresponding RPC provider. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): Method-specific parameters, passed by name (not by position): * `startLedger` (number; optional): Ledger sequence number to start fetching from (inclusive). This method returns an error if `startLedger` is less than the oldest ledger stored in this node or greater than the latest ledger seen by this node. If a `cursor` is included, `startLedger` must be omitted. * `pagination` (object; optional): Pagination options, similar to Horizon pagination. * `cursor` (string; optional): Opaque string acting as a paging token. To obtain the next page of results, set this value to the `cursor` field from the previous response. * `limit` (number; optional): Maximum number of records to return. Valid range: `1–10000`. Defaults to `100` if not specified. * `xdrFormat` (string; optional): Output format for the response — either `base64` (default) or `json`. The `json` schema may change as underlying XDR definitions evolve. #### Returns * `transactions` (array[object]; required): List of transactions included in the queried ledger range. * `status` (string): Indicates whether the transaction was successful or not. * `applicationOrder` (number): 1-based index of the transaction among all transactions included in the ledger. * `feeBump` (boolean): Indicates whether the transaction was fee-bumped. * `envelopeXdr` (string): Base64-encoded `TransactionEnvelope` structure for this transaction. * `resultXdr` (string): Base64-encoded `TransactionResult` structure for this transaction. * `resultMetaXdr` (string): Base64-encoded metadata structure associated with this transaction. * `diagnosticEventsXdr` (array[string]; optional): Base64-encoded list of `xdr.DiagnosticEvent` entries. Present only if `ENABLE_SOROBAN_DIAGNOSTIC_EVENTS` is enabled on the RPC server. * `events` (object): All events emitted during transaction execution. * `ledger` (number): Sequence number of the ledger that included this transaction. * `createdAt` (number): Unix timestamp of when the transaction was included in the ledger. * `latestLedger` (number; required): Sequence number of the latest ledger known to Stellar RPC at the time it handled the request. * `latestLedgerCloseTimestamp` (number; required): Unix timestamp of the close time of the latest ledger known to Stellar RPC at the time it handled the request. * `oldestLedger` (number; required): Sequence number of the oldest ledger ingested by Stellar RPC at the time it handled the request. * `oldestLedgerCloseTimestamp` (number; required): Unix timestamp of the close time of the oldest ledger ingested by Stellar RPC at the time it handled the request. * `cursor` (string; optional): Paging token that can be included in a subsequent request to obtain the next page of results. #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getTransactions", "params": { "startLedger": 1052434, "pagination": { "limit": 5 } } }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "transactions": [ { "status": "SUCCESS", "txHash": "b1cb82270d381ff5ba487fad50c00e3fb9cd3601bcce75253b157718a7890a91", "applicationOrder": 1, "feeBump": false, "envelopeXdr": "AAAAAgAAAACU+3v0Ae64yXpKFWzELvBXzV+CxBdatxq76IHUj4FeEgAAAGQAEA8QAAAAAgAAAAEAAAAAAAAAAAAAAABo7n3+AAAAAAAAAAEAAAAAAAAAAQAAAADu1x0Fy+Tl8JHtHUIdg4jDsT4PQY/JU50psZ2KOHv3FAAAAAAAAAAAATEtAAAAAAAAAAABj4FeEgAAAEC6Xlxcw/REbj+iodVG5PIk158ZZjziTwnQxWKLwXFD2zHKnByITkybE1EQIanPG8YD7htTAowDPoCHw4IKr4gF", "resultXdr": "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAA=", "resultMetaXdr": "AAAABAAAAAAAAAACAAAAAwAQDxIAAAAAAAAAAJT7e/QB7rjJekoVbMQu8FfNX4LEF1q3GrvogdSPgV4SAAAAF0eSBXgAEA8QAAAAAQAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAABAPEQAAAABo7n3fAAAAAAAAAAEAEA8SAAAAAAAAAACU+3v0Ae64yXpKFWzELvBXzV+CxBdatxq76IHUj4FeEgAAABdHkgV4ABAPEAAAAAIAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAQDxIAAAAAaO595AAAAAAAAAABAAAAAAAAAAQAAAADABAPEgAAAAAAAAAAlPt79AHuuMl6ShVsxC7wV81fgsQXWrcau+iB1I+BXhIAAAAXR5IFeAAQDxAAAAACAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAEA8SAAAAAGjufeQAAAAAAAAAAQAQDxIAAAAAAAAAAJT7e/QB7rjJekoVbMQu8FfNX4LEF1q3GrvogdSPgV4SAAAAF0Zg2HgAEA8QAAAAAgAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAABAPEgAAAABo7n3kAAAAAAAAAAMAEA8RAAAAAAAAAADu1x0Fy+Tl8JHtHUIdg4jDsT4PQY/JU50psZ2KOHv3FAAAABdJW8nAABAPDwAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAEA8SAAAAAAAAAADu1x0Fy+Tl8JHtHUIdg4jDsT4PQY/JU50psZ2KOHv3FAAAABdKjPbAABAPDwAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAdeSi3LCcDzP6vfrn/TvTVBKVai5efybRQ6iyEK00c5hAAAAAQAAAAAAAAAEAAAADwAAAAh0cmFuc2ZlcgAAABIAAAAAAAAAAJT7e/QB7rjJekoVbMQu8FfNX4LEF1q3GrvogdSPgV4SAAAAEgAAAAAAAAAA7tcdBcvk5fCR7R1CHYOIw7E+D0GPyVOdKbGdijh79xQAAAAOAAAABm5hdGl2ZQAAAAAACgAAAAAAAAAAAAAAAAExLQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAAAEAAAAAAAAAAgAAAA8AAAADZmVlAAAAABIAAAAAAAAAAJT7e/QB7rjJekoVbMQu8FfNX4LEF1q3GrvogdSPgV4SAAAACgAAAAAAAAAAAAAAAAAAAGQAAAAA", "events": { "transactionEventsXdr": [ "AAAAAAAAAAAAAAAB15KLcsJwPM/q9+uf9O9NUEpVqLl5/JtFDqLIQrTRzmEAAAABAAAAAAAAAAIAAAAPAAAAA2ZlZQAAAAASAAAAAAAAAACU+3v0Ae64yXpKFWzELvBXzV+CxBdatxq76IHUj4FeEgAAAAoAAAAAAAAAAAAAAAAAAABk" ], "contractEventsXdr": [ [ "AAAAAAAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAAAEAAAAAAAAABAAAAA8AAAAIdHJhbnNmZXIAAAASAAAAAAAAAACU+3v0Ae64yXpKFWzELvBXzV+CxBdatxq76IHUj4FeEgAAABIAAAAAAAAAAO7XHQXL5OXwke0dQh2DiMOxPg9Bj8lTnSmxnYo4e/cUAAAADgAAAAZuYXRpdmUAAAAAAAoAAAAAAAAAAAAAAAABMS0A" ] ] }, "ledger": 1052434, "createdAt": 1760460260 } ], "latestLedger": 1052436, "latestLedgerCloseTimestamp": 1760460270, "oldestLedger": 931477, "oldestLedgerCloseTimestamp": 1759854840, "cursor": "4520178201137153" } } ``` --- ### `getVersionInfo` > Retrieves version info. Version information about the RPC and Captive core. RPC manages its own, pared-down version of Stellar Core optimized for its own subset of needs. we'll refer to this as a "Captive Core" instance. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. #### Returns * `version` (string; required): Version of the RPC server. Example: `23.0.1`. * `commitHash` (string; required): Commit hash of the RPC server build. Example: `fcd2f0523f04279bae4502f3e3fa00ca627e6f6a`. * `buildTimestamp` (string; required): Build timestamp of the RPC server. Example: `2025-05-10T11:18:38`. * `captiveCoreVersion` (string; required): Version of the Captive Core used by the RPC server. Example: `stellar-core 23.0.1 (050eacf11a15afb2e95560dfb5723dfdcf78070f)`. * `protocolVersion` (integer; required): Stellar protocol version supported by the RPC server. Example: `23`. #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getVersionInfo" }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "version": "23.0.0-67bf8456a32c74e1fe189ec8d0321614d07944d5", "commitHash": "67bf8456a32c74e1fe189ec8d0321614d07944d5", "buildTimestamp": "2025-08-14T15:20:26", "captiveCoreVersion": "stellar-core 23.0.0 (d5cbc0793d6eab25eac886969c5bc0f7da69d6ea)", "protocolVersion": 23 } } ``` --- ### `sendTransaction` > Submits a transaction. Submit a real transaction to the Stellar network. This is the only way to make changes on-chain. Unlike Horizon, this does not wait for transaction completion. It simply validates and enqueues the transaction. Clients should call `getTransaction` to learn about transaction success/failure. This supports all transactions, not only smart contract-related transactions. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `transaction` (string; required): the signed transaction to broadcast for inclusion in a ledger (base64 string). #### Returns * `hash` (string): a transaction hash (hex-encoded string); pattern: `^[a-f\d]{64}$`. * `status` (string): the current status of the transaction specified by hash (enum: `PENDING`, `DUPLICATE`, `TRY_AGAIN_LATER`, `ERROR`). * `latestLedger` (number): the sequence number of the latest ledger known to Soroban RPC at the time it handles the request. * `latestLedgerCloseTime` (string): the unix timestamp of the close time of the latest ledger known to Soroban RPC at the time it handled the request. * `errorResultXdr` (string): if the transaction `status` is `ERROR`, this will be a base64-encoded string of the raw TransactionResult XDR struct containing details on why Stellar Core rejected the transaction. * `diagnosticEventsXdr` (array): if the transaction `status` is `ERROR`, this field may be present with an array of base64-encoded strings. Each string will decode to a raw DiagnosticEvent XDR struct containing details on why Stellar Core rejected the transaction. #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sendTransaction", "params": { "transaction": "AAAAAgAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAGQAJsOiAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAACgAAAAVIZWxsbwAAAAAAAAEAAAAMU29yb2JhbiBEb2NzAAAAAAAAAAELm/oYAAAAQATr6Ghp/DNO7S6JjEFwcJ9a+dvI6NJr7I/2eQttvoovjQ8te4zKKaapC3mbmx6ld6YKL5T81mxs45TjzdG5zw0=" } }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "status": "PENDING", "hash": "d8ec9b68780314ffdfdfc2194b1b35dd27d7303c3bceaef6447e31631a1419dc", "latestLedger": 2553978, "latestLedgerCloseTime": "1700159337" } } ``` --- ### `simulateTransaction` > Submits a trial contract invocation transaction. Submit a trial contract invocation to simulate how it would be executed by the network. This endpoint calculates the effective transaction data, required authorizations, and minimal resource fee. It provides a way to test and analyze the potential outcomes of a transaction without actually submitting it to the network. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `transaction` (base64 string; required): in order for the RPC server to successfully simulate a Stellar transaction, the provided transaction must contain only a single operation of the type `invokeHostFunction`. * `resourceConfig` (object; optional): configuration for how resources will be calculated: * `instructionLeeway` (number): allow extra instructions when budgeting resources. #### Returns * `latestLedger` (number): the sequence number of the latest ledger known to Soroban RPC at the time it handles the request. * `minResourceFee` (string): stringified number — a recommended minimum resource fee to add when submitting a transaction. This fee is to be added on top of the [Stellar network fee](https://developers.stellar.org/docs/encyclopedia/fees-surge-pricing-fee-strategies#network-fees-on-stellar). Not present in case of error. * `cost` (object): information about instructions used, etc. Not present in case of error: * `cpuInsns` (string): stringified number — total cpu instructions consumed by this transaction. * `memBytes` (string): stringified number — total memory bytes allocated by this transaction. * `results` (array of objects with properties): this array will only have one element: the result for the Host function invocation. Only present on successful simulation (no error) of the `InvokeHostFunction` operations: * `xdr` (string): serialized base64 string — return value of the Host Function call. * `auth` (array of strings): array of serialized base64 strings — per-address authorizations recorded when simulating this Host Function call. * `transactionData` (string): serialized base64 string — the recommended Soroban Transaction Data to use when submitting the simulated transaction. This data contains the refundable fee and resource usage information such as the ledger footprint and IO access data (serialized in a base64 string). Not present in case of error. * `events` (arrays of strings): array of serialized base64 strings — array of the events emitted during the contract invocation. The events are ordered by their emission time. Only present when simulating of `InvokeHostFunction` operations, note that it can be present on error, providing extra content about what failed. * `restorePreamble` (object): it can be only present on successful simulation (no error) of `InvokeHostFunction` operations. If present, it indicates that the simulation detected archived ledger entries which need to be restored before the submission of the `InvokeHostFunction` operation. The `minResourceFee` and `transactionData` fields should be used to submit a transaction containing a `RestoreFootprint` operation. Properties: * `minResourceFee` (string): stringified number — recommended minimum resource fee to add when submitting the `RestoreFootprint` operation. This fee is to be added on top of the [Stellar network fee](https://developers.stellar.org/docs/encyclopedia/fees-surge-pricing-fee-strategies#network-fees-on-stellar). * `transactionData` (string): serialized base64 string — the recommended Soroban Transaction Data to use when submitting the `RestoreFootprint` operation. * `error` (string): this field will include details about why the invoke host function call failed. Only present if the transaction simulation failed. #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "simulateTransaction", "params": { "transaction": "AAAAAgAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAGQAJsOiAAAAEQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAAJaW5jcmVtZW50AAAAAAAAAgAAABIAAAAAAAAAACDh1sDGwYAYgJ8EbeJPZwoZhDqEriwlbNnqivULm/oYAAAAAwAAAAMAAAAAAAAAAAAAAAA=", "resourceConfig": { "instructionLeeway": 3000000 } } }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "transactionData": "AAAAAAAAAAIAAAAGAAAAAcwD/nT9D7Dc2LxRdab+2vEUF8B+XoN7mQW21oxPT8ALAAAAFAAAAAEAAAAHy8vNUZ8vyZ2ybPHW0XbSrRtP7gEWsJ6zDzcfY9P8z88AAAABAAAABgAAAAHMA/50/Q+w3Ni8UXWm/trxFBfAfl6De5kFttaMT0/ACwAAABAAAAABAAAAAgAAAA8AAAAHQ291bnRlcgAAAAASAAAAAAAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAAEAHfKyAAAFiAAAAIgAAAAAAAAAAw==", "minResourceFee": "90353", "events": [ "AAAAAQAAAAAAAAAAAAAAAgAAAAAAAAADAAAADwAAAAdmbl9jYWxsAAAAAA0AAAAgzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAAPAAAACWluY3JlbWVudAAAAAAAABAAAAABAAAAAgAAABIAAAAAAAAAACDh1sDGwYAYgJ8EbeJPZwoZhDqEriwlbNnqivULm/oYAAAAAwAAAAM=", "AAAAAQAAAAAAAAABzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAACAAAAAAAAAAIAAAAPAAAACWZuX3JldHVybgAAAAAAAA8AAAAJaW5jcmVtZW50AAAAAAAAAwAAAAw=" ], "results": [ { "auth": [], "xdr": "AAAAAwAAAAw=" } ], "cost": { "cpuInsns": "1635562", "memBytes": "1295756" }, "latestLedger": 2552139 } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/stellar/transactions/ title: Stellar — Transactions, Soroban JSON-RPC methods (1/2) source: docs/rpc-service/chains/chains-api/stellar/transactions.mdx --- # Stellar — Transactions, Soroban JSON-RPC methods (1/2) > API reference for [Stellar](/rpc-service/chains/chains-api/stellar/). [All methods ->](/rpc-service/chains/chains-api/stellar/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/stellar/transactions-p2/) ### `GET /transactions/{transaction_hash}/effects` > Retrieves all effects of a particular transaction. This endpoint returns the effects of a specific transaction. #### Parameters * `transaction_hash` (string; path; required): transactions are commands that modify the ledger state and consist of one or more operations. * `cursor` (integer; query): a number that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. * `order` (string; query): a designation of the order in which records should appear. Options include `asc` (ascending) or `desc` (descending). If this argument isn’t set, it defaults to `asc`. * `limit` (integer; query): the maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. #### Returns ```json { "_links": { "self": { "href": "string", "templated": true }, "next": { "href": "string", "templated": true }, "prev": { "href": "string", "templated": true } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "string", "templated": true }, "succeeds": { "href": "string", "templated": true }, "precedes": { "href": "string", "templated": true } }, "id": "string", "paging_token": "string", "account": "string", "type": "Account Created", "type_i": 1, "created_at": "string" } ] } } ``` #### Request example ```shell curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash}/effects{?cursor,order,limit} ``` ```shell curl https://rpc.ankr.com/http/stellar_horizon/transactions/{transaction_hash}/effects{?cursor,order,limit} \ -H 'Accept: text/event-stream' ``` #### Response example ```json { "_links": { "self": { "href": "https://rpc.ankr.com/transactions/512a9946bc7ff4a363299f14f79e0beb9b9cdbd0103e3a69a44446a0aa6471a8/effects?cursor=\u0026limit=1\u0026order=asc" }, "next": { "href": "https://rpc.ankr.com/transactions/512a9946bc7ff4a363299f14f79e0beb9b9cdbd0103e3a69a44446a0aa6471a8/effects?cursor=121628667754319873-1\u0026limit=1\u0026order=asc" }, "prev": { "href": "https://rpc.ankr.com/transactions/512a9946bc7ff4a363299f14f79e0beb9b9cdbd0103e3a69a44446a0aa6471a8/effects?cursor=121628667754319873-1\u0026limit=1\u0026order=desc" } }, "_embedded": { "records": [ { "_links": { "operation": { "href": "https://rpc.ankr.com/operations/121628667754319873" }, "succeeds": { "href": "https://rpc.ankr.com/effects?order=desc\u0026cursor=121628667754319873-1" }, "precedes": { "href": "https://rpc.ankr.com/effects?order=asc\u0026cursor=121628667754319873-1" } }, "id": "0121628667754319873-0000000001", "paging_token": "121628667754319873-1", "account": "GAHK7EEG2WWHVKDNT4CEQFZGKF2LGDSW2IVM4S5DP42RBW3K6BTODB4A", "type": "account_credited", "type_i": 2, "created_at": "2020-02-20T21:18:33Z", "asset_type": "native", "amount": "1573.5112616" } ] } } ``` --- ## Soroban JSON-RPC methods * [`getEvents`](#getevents) — retrieves contract events. * [`getFeeStats`](#getfeestats) — retrieves statistics for charged inclusion fees. * [`getHealth`](#gethealth) — retrieves node health. * [`getLatestLedger`](#getlatestledger) — retrieves the latest known ledgers. * [`getLedgerEntries`](#getledgerentries) — retrieves ledger entries. * [`getLedgers`](#getledgers) — retrieves list of ledgers. * [`getNetwork`](/rpc-service/chains/chains-api/stellar/transactions-p2/#getnetwork) — retrieves network config. * [`getTransaction`](/rpc-service/chains/chains-api/stellar/transactions-p2/#gettransaction) — retrieves transaction details. * [`getTransactions`](/rpc-service/chains/chains-api/stellar/transactions-p2/#gettransactions) — retrieves list of transactions. * [`getVersionInfo`](/rpc-service/chains/chains-api/stellar/transactions-p2/#getversioninfo) — retrieves version info. * [`sendTransaction`](/rpc-service/chains/chains-api/stellar/transactions-p2/#sendtransaction) — submits a transaction. * [`simulateTransaction`](/rpc-service/chains/chains-api/stellar/transactions-p2/#simulatetransaction) — submits a trial contract invocation transaction. ### `getEvents` > Retrieves contract events. Clients can request a filtered list of events emitted by a given ledger range. Soroban RPC will support querying within a maximum 24 hours of recent ledgers. Note, this could be used by the client to only prompt a refresh when there is a new ledger with relevant events. It should also be used by backend Dapp components to "ingest" events into their own database for querying and serving. If making multiple requests, clients should deduplicate any events received, based on the event's unique id field. This prevents double-processing in the case of duplicate events being received. By default, Soroban RPC retains the most recent 24 hours of events. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `startLedger` (number, required): Ledger sequence number to fetch events after (inclusive). This method will return an error if startLedger is less than the oldest ledger stored in this node, or greater than the latest ledger seen by this node. If a cursor is included in the request, `startLedger` must be omitted. * `filters` (array of objects; optional): List of filters for the returned events. Events matching any of the filters are included. To match a filter, an event must match both a `contractId` and a `topic`. Maximum 5 filters are allowed per request: * `type` (string): A comma separated list of event types (system, contract, or diagnostic) used to filter events. If omitted, all event types are included. * `contractIds` (array of strings): List of contract IDs to query for events. If omitted, return events for all contracts. Maximum 5 contract IDs are allowed per request. * `topics` (array): List of topic filters. If omitted, query for all events. If multiple filters are specified, events will be included if they match any of the filters. Maximum 5 filters are allowed per request. * A `TopicFilter` is `SegmentMatcher[]` — The list can be 1-4 `SegmentMatchers` long. * A `SegmentMatcher` is one of the following: * For an exact segment match, a string containing a base64-encoded ScVal. * For a wildcard single-segment match, the string "*", matches exactly one segment. * `pagination` (object; optional): Pagination in Soroban RPC is similar to pagination in Horizon. See [Pagination](https://soroban.stellar.org/api/pagination). * `cursor` (string): A string ID that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. When a cursor is provided Soroban RPC will _not_ include the element whose id matches the cursor in the response. Only elements which appear _after_ the cursor are included. * `number` (number): The maximum number of records returned. The limit for `getEvents` can range from 1 to 10000 — an upper limit that is hardcoded in Soroban RPC for performance reasons. If this argument isn't designated, it defaults to 100. #### Returns * `latestLedger` (number): The sequence number of the latest ledger known to Soroban RPC at the time it handled the request. * `events` (array of objects): * `type` (string): The type of event emission (enum: `contract`, `diagnostic`, `system`) * `ledger` (number): Sequence number of the ledger in which this event was emitted. * `ledgerClosedAt` (string): [ISO-8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp of the ledger closing time * `contractId` (string): StrKey representation of the contract address that emitted this event. * `id` (string): Unique identifier for this event. - The event's unique id field is based on a [`toid` from Horizon](https://github.com/stellar/go/blob/master/toid/main.go) as used in Horizon's /effects endpoint. - https://github.com/stellar/go/blob/master/services/horizon/internal/db2/history/effect.go#L58 - Specifically, it is a string containing: - bigint(32 bit ledger sequence + 20 bit txn number + 12 bit operation) + `` + number for the event within the operation. - For example: `1234-1` * `pagingToken` (string): Duplicate of `id` field, but in the standard place for pagination tokens. * `inSuccessfulContractCall` (boolean): If true the event was emitted during a successful contract call. * `topic` (array of strings): List containing the topic this event was emitted with: * `SegmentMatcher` (string): A `SegmentMatcher` is one of the following: * For an exact segment match, a string containing a base64-encoded ScVal. * For a wildcard single-segment match, the string "*", matches exactly one segment. * `value` (object): The data the event was broadcasting in the emitted event: * `xdr` (string): The emitted body value of the event (serialized in a base64 string). #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getEvents", "params": { "startLedger": 1051743, "pagination": { "limit": 2 } } }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "events": [ { "type": "contract", "ledger": 180118, "ledgerClosedAt": "2024-01-22T16:13:07Z", "contractId": "CB22KRA3YZVCNCQI64JQ5WE7UY2VAV7WFLK6A2JN3HEX56T2EDAFO7QF", "id": "0000773600919453696-0000000000", "pagingToken": "0000773600919453696-0000000000", "topic": [ "AAAADwAAAAh0cmFuc2Zlcg==", "AAAAEgAAAAEmtLQQgiJ5guKLxbQdFEQ8qF20pUVTAcvU9RfF4mln5g==", "AAAAEgAAAAAAAAAAbLAgdrWIvo9rNehnYdwy70gTNnWQ4rP2Ffvq1rYk0sw=", "AAAADgAAAD1CTE5EOkdBVEFMVEdUV0lPVDZCVURCQ1pNM1E0T1E0Qk8yQ09MT0FaN0lZU0tQTEMyUE1TT1BQR0Y1VjU2AAAA" ], "value": "AAAACgAAAAAAAAAAAAAABkNdp0E=", "inSuccessfulContractCall": true }, { "type": "contract", "ledger": 180118, "ledgerClosedAt": "2024-01-22T16:13:07Z", "contractId": "CABFXDAA5BILXZPD7Y25QQPO77M5JHCCC3HWUBDGU52HNUHL4Z6YCTAC", "id": "0000773600919453696-0000000001", "pagingToken": "0000773600919453696-0000000001", "topic": [ "AAAADwAAAAVjbGFpbQAAAA==", "AAAAEgAAAAAAAAAAbLAgdrWIvo9rNehnYdwy70gTNnWQ4rP2Ffvq1rYk0sw=" ], "value": "AAAAEAAAAAEAAAACAAAAEAAAAAEAAAACAAAAAwAAAAAAAAADAAAAAwAAAAoAAAAAAAAAAAAAAAZDXadB", "inSuccessfulContractCall": true } ], "latestLedger": 192067 } } ``` --- ## Soroban JSON-RPC methods ### `getFeeStats` > Retrieves statistics for charged inclusion fees. Statistics for charged inclusion fees. The inclusion fee statistics are calculated from the inclusion fees that were paid for the transactions to be included onto the ledger. For Soroban transactions and Stellar transactions, they each have their own inclusion fees and own surge pricing. Inclusion fees are used to prevent spam and prioritize transactions during network traffic surge. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. #### Returns * `sorobanInclusionFee` (object; required): Inclusion-fee distribution statistics for Soroban transactions, measured per transaction. * `min` (string): Minimum inclusion fee observed. * `max` (string): Maximum inclusion fee observed. * `mode` (string): Most frequently occurring inclusion fee. * `p10` (string): 10th percentile inclusion fee (nearest-rank method). * `p20` (string): 20th percentile inclusion fee (nearest-rank method). * `p30` (string): 30th percentile inclusion fee (nearest-rank method). * `p40` (string): 40th percentile inclusion fee (nearest-rank method). * `p50` (string): 50th percentile inclusion fee (median, nearest-rank method). * `p60` (string): 60th percentile inclusion fee (nearest-rank method). * `p70` (string): 70th percentile inclusion fee (nearest-rank method). * `p80` (string): 80th percentile inclusion fee (nearest-rank method). * `p90` (string): 90th percentile inclusion fee (nearest-rank method). * `p95` (string): 95th percentile inclusion fee (nearest-rank method). * `p99` (string): 99th percentile inclusion fee (nearest-rank method). * `transactionCount` (number): Number of Soroban transactions included in this distribution. * `ledgerCount` (number): Number of consecutive ledgers analyzed to produce the statistics. * `inclusionFee` (object; required): Inclusion-fee distribution statistics for classic Stellar transactions, normalized per operation. * `min` (string): Minimum inclusion fee observed per operation. * `max` (string): Maximum inclusion fee observed per operation. * `mode` (string): Most frequently occurring inclusion fee per operation. * `p10` (string): 10th percentile inclusion fee per operation (nearest-rank method). * `p20` (string): 20th percentile inclusion fee per operation (nearest-rank method). * `p30` (string): 30th percentile inclusion fee per operation (nearest-rank method). * `p40` (string): 40th percentile inclusion fee per operation (nearest-rank method). * `p50` (string): 50th percentile inclusion fee per operation (median, nearest-rank method). * `p60` (string): 60th percentile inclusion fee per operation (nearest-rank method). * `p70` (string): 70th percentile inclusion fee per operation (nearest-rank method). * `p80` (string): 80th percentile inclusion fee per operation (nearest-rank method). * `p90` (string): 90th percentile inclusion fee per operation (nearest-rank method). * `p95` (string): 95th percentile inclusion fee per operation (nearest-rank method). * `p99` (string): 99th percentile inclusion fee per operation (nearest-rank method). * `transactionCount` (number): Number of classic transactions included in this distribution. * `ledgerCount` (number): Number of consecutive ledgers analyzed to produce the statistics. * `latestLedger` (number; required): Sequence number of the latest ledger known to Stellar RPC at the time it handled the request. #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getFeeStats" }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "sorobanInclusionFee": { "max": "100", "min": "100", "mode": "100", "p10": "100", "p20": "100", "p30": "100", "p40": "100", "p50": "100", "p60": "100", "p70": "100", "p80": "100", "p90": "100", "p95": "100", "p99": "100", "transactionCount": "14", "ledgerCount": 50 }, "inclusionFee": { "max": "108", "min": "100", "mode": "100", "p10": "100", "p20": "100", "p30": "100", "p40": "100", "p50": "100", "p60": "100", "p70": "100", "p80": "100", "p90": "100", "p95": "108", "p99": "108", "transactionCount": "13", "ledgerCount": 10 }, "latestLedger": 1051780 } } ``` --- ### `getHealth` > Retrieves node health. General node health check. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. #### Returns * `status` (string): node status (example: "healthy"). #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getHealth" }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "status": "healthy" } } ``` --- ### `getLatestLedger` > Retrieves the latest known ledger. For finding out the current latest known ledger of this node. This is a subset of the ledger info from Horizon. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. #### Returns * `id` (string): hash identifier of the latest ledger (as a hex-encoded string) known to Soroban RPC at the time it handles the request (pattern: `^[a-f\d]{64}$`). * `protocolVersion` (number): Stellar Core protocol version associated with the latest ledger. * `sequence` (number): the sequence number of the latest ledger known to Soroban RPC at the time it handles the request. #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getLatestLedger" }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "id": "c73c5eac58a441d4eb733c352...", "protocolVersion": 20, "sequence": 2539605 } } ``` --- ### `getLedgerEntries` > Retrieves ledger entries. For reading the current value of ledger entries directly. Allows you to directly inspect the current state of a contract, a contract's code, or any other ledger entry. This is a backup way to access your contract data which may not be available via events or `simulateTransaction`. To fetch contract wasm byte-code, use the `ContractCode` ledger entry key. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `keys` (array of strings; required): an array containing the keys of the ledger entries you wish to retrieve (an array of serialized base64 strings). #### Returns * `latestLedger` (number): the sequence number of the latest ledger known to Soroban RPC at the time it handles the request. * `entries` (array): an array of objects containing all found ledger entries: * `key` (string): the key of the ledger entry (base64 string). * `xdr` (string): the current value of the given ledger entry (base64 string). * `lastModifiedLedgerSeq` (number): the ledger sequence number of the last time this entry was updated. * `liveUntilLedgerSeq` (number): sequence number of the ledger. #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getLedgerEntries", "params": { "keys": [ 0: "AAAABgAAAAHMA/50/Q+w3Ni8UXWm/trxFBfAfl6De5kFttaMT0/ACwAAABAAAAABAAAAAgAAAA8AAAAHQ291bnRlcgAAAAASAAAAAAAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAAE=" ] } }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "entries": [ 0: { "key": "AAAAB+qfy4GuVKKfazvyk4R9P9fpo2n9HICsr+xqvVcTF+DC", "xdr": "AAAABgAAAAAAAAABzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAAQAAAAAQAAAAIAAAAPAAAAB0NvdW50ZXIAAAAAEgAAAAAAAAAAIOHWwMbBgBiAnwRt4k9nChmEOoSuLCVs2eqK9Qub+hgAAAABAAAAAwAAAAw=", "lastModifiedLedgerSeq": 2552504 } ], "latestLedger": 2552990 } } ``` --- ### `getLedgers` > Retrieves list of ledgers. The `getLedgers` method returns a detailed list of ledgers starting from the user specified starting point that you can paginate as long as the pages fall within the history retention of their corresponding RPC provider. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object; required): * `startLedger` (number; optional): ledger sequence number to start fetching from (inclusive). This must not be less than the oldest ledger stored in the node or greater than the latest ledger seen by the node. If a `cursor` is included, `startLedger` must be omitted. * `pagination` (object; optional): pagination options, similar to Horizon pagination. * `cursor` (string; optional): opaque string acting as a paging token. To fetch the next page of results, set this value to the `cursor` field returned in the previous response. * `limit` (number; optional): maximum number of records to return. Valid range is `1–10000`. Defaults to `100` if not specified. * `xdrFormat` (string; optional): output format for the response. Accepts `base64` (default) or `json`. If `json` is used, note that the schema may change with underlying XDR updates. #### Returns * `ledgers` (array[object]; required): List of ledger entries returned by the query. * `hash` (string): Hash of the ledger header that was included in the chain. * `sequence` (number): Sequence number of the ledger (also referred to as the block height). * `ledgerCloseTime` (string): Timestamp at which the ledger was closed. * `headerXdr` (string): Base64-encoded `LedgerHeader` structure for this ledger. * `metadataXdr` (string): Base64-encoded `LedgerCloseMeta` union for this ledger. * `latestLedger` (number; required): Sequence number of the latest ledger known to Stellar RPC at the time it handled the request. * `latestLedgerCloseTime` (number; required): Unix timestamp of the close time of the latest ledger known to Stellar RPC at the time it handled the request. * `oldestLedger` (number; required): Sequence number of the oldest ledger ingested by Stellar RPC at the time it handled the request. * `oldestLedgerCloseTime` (number; required): Unix timestamp of the close time of the oldest ledger ingested by Stellar RPC at the time it handled the request. * `cursor` (string; optional): Paging token to be included in a subsequent request to obtain the next page of results. #### Request example ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getLedgers", "params": { "startLedger": 1052244, "pagination": { "limit": 2 } } }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "ledgers": [ { "hash": "318ce21369ba24f8332bd14babdb09889f24dce1bc089db067ab2af47d7aea0a", "sequence": 1052244, "ledgerCloseTime": "1760459309", "headerXdr": "MYziE2m6JPgzK9FLq9sJiJ8k3OG8CJ2wZ6sq9H166goAAAAXqhYfNK6HfdyFen5WLUKzBrk4fqj2VgOFqA/e3Q0UBETV3k/2lliqEEleXCOJyLA7tEo+w6HoGUVmk9D1sibuxwAAAABo7notAAAAAAAAAAEAAAAAtV0Qsrt9KE7VwDpHpeG1kMkPV4NVRxzEUHu+ggTSPIsAAABAeBGYsdJuZvlPM7eIn7JrDrYrbTCGmMPYbMEKJtt7R8wJ2T8cjqH539FA7R8+WwwkH6aXeYnL7PGLFDprjVkHDmuVnjV3jJGH2Xbn8cE4ggoGSGNwv/kQZAVp4k9vqQu5/gq1fwb04v/lrWxbDVlQNcQczExnupW7OF5COtCaJYkAEA5UDeC2s6dkAAAAAAA6wJhozQAAAAAAAAAAAAAolQAAAGQATEtAAAAAyAtzObU3PsJWeTkdkBDOyExMTol0rEV7SX0oar2zxLtYDneB8P56sIYAP871glDb/k8XmSekQUzwCUQmkpViI6jDzf6BDMFFWKRAYhEqTq9VipuOz3SuiIzqdfMQdaLqhHjfX/XfBYxAEzDm6pGn2/xshRwOT3D56ojadgOLJjaYAAAAAAAAAAA=", "metadataXdr": "AAAAAgAAAAAxjOITabok+DMr0Uur2wmInyTc4bw..." }, { "hash": "f8a3fc2f5a48f6c45a8a135f73ef6c818ec609b12b0e2a0a9ce8af73c0d4458d", "sequence": 1052245, "ledgerCloseTime": "1760459314", "headerXdr": "+KP8L1pI9sRaihNfc+9sgY7GCbErDioKnOivc8DURY0AAAAXMYziE2m6JPgzK9FLq9sJiJ8k3OG8CJ2wZ6sq9H166gp533EGZ5PUMkezV8dRbxfBvkP+FWZ+DjgLLP+NYx2HzgAAAABo7noyAAAAAAAAAAEAAAAAtV0Qsrt9KE7VwDpHpeG1kMkPV4NVRxzEUHu+ggTSPIsAAABAJFqX2dyeZKxyFDk0H8uLiBqAkjnfnI/zCN43cLn26phZAivqFn+ZcURQTbPNLbMgx7Do59GWnkHZjpgFnrlDDNKlI/RUA1dq+H7EHtDzxOJuUk3iUMYSLimzRsEr3D+hRj35YE8eQRxWWnoiFL5qJnnRZG7pl6tByRySoa2a/mUAEA5VDeC2s6dkAAAAAAA6wJhplQAAAAAAAAAAAAAolQAAAGQATEtAAAAAyAtzObU3PsJWeTkdkBDOyExMTol0rEV7SX0oar2zxLtYDneB8P56sIYAP871glDb/k8XmSekQUzwCUQmkpViI6jDzf6BDMFFWKRAYhEqTq9VipuOz3SuiIzqdfMQdaLqhHjfX/XfBYxAEzDm6pGn2/xshRwOT3D56ojadgOLJjaYAAAAAAAAAAA=", "metadataXdr": "AAAAAgAAAAD4o/wvWkj2xFqKE19z72yBjsYJsSsO..." } ], "latestLedger": 1052247, "latestLedgerCloseTime": 1760459324, "oldestLedger": 931288, "oldestLedgerCloseTime": 1759853894, "cursor": "1052245" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/story/ title: Story description: Story Network is a purpose-built layer 1 blockchain achieving the best of EVM and Cosmos SDK. 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/story/index.mdx --- # Story
> Story API is available on [Web3 API platform](https://www.ankr.com/rpc/story). *Story Network* is a purpose-built layer 1 blockchain achieving the best of EVM and Cosmos SDK. It is 100% EVM-compatible alongside deep execution layer optimizations to support graph data structures, purpose-built for handling complex data structures like IP quickly and cost-efficiently. **Key Features**: * **EVM Compatibility**: Full compatibility with Ethereum Virtual Machine. * **Optimized Data Structures**: Precompiled primitives for efficient IP graph traversal. * **Fast Finality**: CometBFT-based consensus layer for quick transaction finality. * **Modular Architecture**: Decoupled consensus from execution using Ethereum's Engine-API. In order for your Web3 application to interact with Story — either by reading blockchain data or sending transactions to the network — it must connect to a Story node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/story/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/story/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/story/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/story/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/story/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/story/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/story/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/story/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/story/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/story/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/story/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/story/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/story/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/story/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/story/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/story/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/story/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/story/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/story/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/story/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/story/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/story/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/story/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/story/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/story/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/story/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/story/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/story/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/story/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/story/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/story/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/story/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/story/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/story/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/story/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/story/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/story/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/story/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/story/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/story/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/story/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/story/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/story/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/story/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/story/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/story/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/story/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/story/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/story/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/story/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/story/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/story/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/story/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/story/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/story/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/story/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/story/web3-p2/ title: Story — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/story/web3-p2.mdx --- # Story — web3, net, eth (2/3) > API reference for [Story](/rpc-service/chains/chains-api/story/). [All methods ->](/rpc-service/chains/chains-api/story/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/story/web3/) · 2 · [3](/rpc-service/chains/chains-api/story/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0x9994F1d8a6A086C0022f72913DcB1B4c4A744F90", "to": "0x631b6F24d2bDcccCA01C3c88B26480d0f71F1B35", "value": "0x0" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x17", "blobGasUsed": "0x0", "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0xd883010002846765746888676f312e32322e30856c696e7578", "gasLimit": "0x2255100", "gasUsed": "0x21d23d", "hash": "0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "logsBloom": "0x00000000000000000000000200014000400000000000000000000000000000400000000000000020804000600400400100000000100020000800000000200000008000001000040800000808000000000020000000000000004000008000040010020020220000800000000200008800800000021000000000001030000800000000600000008000020000000000004401000001000000108004400000000000020000000000001000006004040000000000008000000000000200000010000200000012000005000000000800000000000000020000800004000000000020008210000000040008000020000001000008000008000000400200400000000000", "miner": "0xeb41755f941b11fc6787de9e6a78dbd56523e3f1", "mixHash": "0xed49f2818f6e5ac3978cc8ae02c58a5a2b28a969bbefbbb4f18d2dd7db1b4787", "nonce": "0x0000000000000000", "number": "0x17a451", "parentBeaconBlockRoot": "0xbe4c142a85d6600a895dc64711968ccc5641998d7d662fead5db1ba90ad87d3d", "parentHash": "0xed49f2818f6e5ac3978cc8ae02c58a5a2b28a969bbefbbb4f18d2dd7db1b4787", "receiptsRoot": "0xe22cffc179a07467b33ed479de0a166ea9eb4d26a679136f86ba19584c6b7eeb", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x2ec1", "stateRoot": "0xfd7238851c9ec7b19059898d8dcff6f652be5aa52df5543bce19f9854816b3df", "timestamp": "0x67c6edab", "totalDifficulty": "0x20000", "transactions": [ "0x21502a06cfb5e5716ba265d5aff956ed234a875494a7bd36e71236ec62a511ae", "0x606fea1252215d2c6391f947c9c3e323127b66d950ba604bf53edcb5931c3f95", "0xd848f9bfe8716211fd248edeb6779103da4ca6d36d0b9376ae8736df400981f1" ], "transactionsRoot": "0xf2d437c28d18b60f97ee4c887384f9878e2b7a6559562c9c19921b16fd4566da", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x17A451", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x17", "blobGasUsed": "0x0", "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0xd883010002846765746888676f312e32322e30856c696e7578", "gasLimit": "0x2255100", "gasUsed": "0x21d23d", "hash": "0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "logsBloom": "0x00000000000000000000000200014000400000000000000000000000000000400000000000000020804000600400400100000000100020000800000000200000008000001000040800000808000000000020000000000000004000008000040010020020220000800000000200008800800000021000000000001030000800000000600000008000020000000000004401000001000000108004400000000000020000000000001000006004040000000000008000000000000200000010000200000012000005000000000800000000000000020000800004000000000020008210000000040008000020000001000008000008000000400200400000000000", "miner": "0xeb41755f941b11fc6787de9e6a78dbd56523e3f1", "mixHash": "0xed49f2818f6e5ac3978cc8ae02c58a5a2b28a969bbefbbb4f18d2dd7db1b4787", "nonce": "0x0000000000000000", "number": "0x17a451", "parentBeaconBlockRoot": "0xbe4c142a85d6600a895dc64711968ccc5641998d7d662fead5db1ba90ad87d3d", "parentHash": "0xed49f2818f6e5ac3978cc8ae02c58a5a2b28a969bbefbbb4f18d2dd7db1b4787", "receiptsRoot": "0xe22cffc179a07467b33ed479de0a166ea9eb4d26a679136f86ba19584c6b7eeb", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x2ec1", "stateRoot": "0xfd7238851c9ec7b19059898d8dcff6f652be5aa52df5543bce19f9854816b3df", "timestamp": "0x67c6edab", "totalDifficulty": "0x20000", "transactions": [ "0x21502a06cfb5e5716ba265d5aff956ed234a875494a7bd36e71236ec62a511ae", "0x606fea1252215d2c6391f947c9c3e323127b66d950ba604bf53edcb5931c3f95", "0xd848f9bfe8716211fd248edeb6779103da4ca6d36d0b9376ae8736df400981f1" ], "transactionsRoot": "0xf2d437c28d18b60f97ee4c887384f9878e2b7a6559562c9c19921b16fd4566da", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x39236ef3cce52631e3868a0e5f4beab3da67e5f908912e7dc44507cd864cad6a"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "blockNumber": "0x17a451", "from": "0x9d495db8db2bf68101e17aa9edf2de009b0c473e", "gas": "0x7f653", "gasPrice": "0xf4257", "maxFeePerGas": "0xf4259", "maxPriorityFeePerGas": "0xf4240", "hash": "0x39236ef3cce52631e3868a0e5f4beab3da67e5f908912e7dc44507cd864cad6a", "input": "0xa694fc3a000000000000000000000000000000000000000000000000000000000000123e", "nonce": "0x19", "to": "0x673078b6fc5d570629f416e200588421545017d9", "transactionIndex": "0x4", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x5ea", "v": "0x1", "r": "0x73e0371e7c1740b2c9f4dd2b26f40e133da7f18fc28a6ccd5049d5cb69edc1c6", "s": "0x22279fe145cc2b5e532a371f8b3113d51ddaac804d2fc03fa9fdfdd6d53bfdf4", "yParity": "0x1" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "0x2"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "blockNumber": "0x17a451", "from": "0xcadf24d9c0311deb36e554b1fa55af9943cc2340", "gas": "0x1e3d16", "gasPrice": "0xf4257", "hash": "0xd848f9bfe8716211fd248edeb6779103da4ca6d36d0b9376ae8736df400981f1", "input": "0xb771524200000000000000000000000000000000000000000000001043561b70fdd51000000000000000000000000000000000000000000000000000000000000000006f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x46f9", "to": "0x8bcf524385e6e3afe36e8c3ad0bdd8dea030dad4", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x5ea", "v": "0xbf7", "r": "0xeb720322ad907c7ff3d66c1bc05bc20a7faead4c90a5262fb5a2c800311588f7", "s": "0x60b22d3ac43522e742d2ba40e9396c1b70a5630ce3ff0272f08555752806e777" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x17A451", "0x2"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "blockNumber": "0x17a451", "from": "0xcadf24d9c0311deb36e554b1fa55af9943cc2340", "gas": "0x1e3d16", "gasPrice": "0xf4257", "hash": "0xd848f9bfe8716211fd248edeb6779103da4ca6d36d0b9376ae8736df400981f1", "input": "0xb771524200000000000000000000000000000000000000000000001043561b70fdd51000000000000000000000000000000000000000000000000000000000000000006f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x46f9", "to": "0x8bcf524385e6e3afe36e8c3ad0bdd8dea030dad4", "transactionIndex": "0x2", "value": "0x0", "type": "0x0", "chainId": "0x5ea", "v": "0xbf7", "r": "0xeb720322ad907c7ff3d66c1bc05bc20a7faead4c90a5262fb5a2c800311588f7", "s": "0x60b22d3ac43522e742d2ba40e9396c1b70a5630ce3ff0272f08555752806e777" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/story/web3-p3/ title: Story — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/story/web3-p3.mdx --- # Story — web3, net, eth (3/3) > API reference for [Story](/rpc-service/chains/chains-api/story/). [All methods ->](/rpc-service/chains/chains-api/story/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/story/web3/) · [2](/rpc-service/chains/chains-api/story/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x39236ef3cce52631e3868a0e5f4beab3da67e5f908912e7dc44507cd864cad6a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "blockNumber": "0x17a451", "contractAddress": null, "cumulativeGasUsed": "0x15c0c4", "effectiveGasPrice": "0xf4257", "from": "0x9d495db8db2bf68101e17aa9edf2de009b0c473e", "gasUsed": "0x5bb46", "logs": [ { "address": "0x700722d24f9256be288f56449e8ab1d27c4a70ca", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000009d495db8db2bf68101e17aa9edf2de009b0c473e", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000123e" ], "data": "0x", "blockNumber": "0x17a451", "transactionHash": "0x39236ef3cce52631e3868a0e5f4beab3da67e5f908912e7dc44507cd864cad6a", "transactionIndex": "0x4", "blockHash": "0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "logIndex": "0x1", "removed": false }, { "address": "0x700722d24f9256be288f56449e8ab1d27c4a70ca", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009d495db8db2bf68101e17aa9edf2de009b0c473e", "0x000000000000000000000000673078b6fc5d570629f416e200588421545017d9", "0x000000000000000000000000000000000000000000000000000000000000123e" ], "data": "0x", "blockNumber": "0x17a451", "transactionHash": "0x39236ef3cce52631e3868a0e5f4beab3da67e5f908912e7dc44507cd864cad6a", "transactionIndex": "0x4", "blockHash": "0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "logIndex": "0x2", "removed": false } ], "logsBloom": "0x00000000000000000000000200004000000000000000000000000000000000000000000000000000800000000400000000000000000000000000000000200000008000000000000000000008000000000000000000000000004000000000000010000000020000800000000000008800000000001000000000001030000000000000000000008000000000000000000000000000000000008004000000000000020000000000001000004000040000000000000000000000000200000000000000000002000001000000000800000000000000000000000004000000000020000010000000040000000020000000000000000000000000000000000000000000", "status": "0x1", "to": "0x673078b6fc5d570629f416e200588421545017d9", "transactionHash": "0x39236ef3cce52631e3868a0e5f4beab3da67e5f908912e7dc44507cd864cad6a", "transactionIndex": "0x4", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x17A451", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0x17A451", "toBlock": "0x17A452" }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0x82dc0ec7d058ab7053a75c8a35ea34705cf6788d", "topics": [ "0x24073d699b5c164d11eaef97cdabe1bcd2e867d1806aad0cbffd0fff9293643a", "0x0000000000000000000000000000000000000000000000003c565593273b4b01", "0x00000000000000000000000000000000000000000000000000000000000003f7" ], "data": "0x000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000072a8167c68bac00000000000000000000000000e1c19b3dff3c64b35ac522c683c98d749d1237f30000000000000000000000000000000000000000000000000000000067c6ee7e", "blockNumber": "0x17a451", "transactionHash": "0x21502a06cfb5e5716ba265d5aff956ed234a875494a7bd36e71236ec62a511ae", "transactionIndex": "0x0", "blockHash": "0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "logIndex": "0x0", "removed": false }, { "address": "0x700722d24f9256be288f56449e8ab1d27c4a70ca", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x0000000000000000000000009d495db8db2bf68101e17aa9edf2de009b0c473e", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000123e" ], "data": "0x", "blockNumber": "0x17a451", "transactionHash": "0x39236ef3cce52631e3868a0e5f4beab3da67e5f908912e7dc44507cd864cad6a", "transactionIndex": "0x4", "blockHash": "0xe5641831d82b517d30bb1223dab0fade03b1371d3100bcf83c8732d4fce9299c", "logIndex": "0x1", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/story/web3/ title: Story — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/story/web3.mdx --- # Story — web3, net, eth (1/3) > API reference for [Story](/rpc-service/chains/chains-api/story/). [All methods ->](/rpc-service/chains/chains-api/story/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/story/web3-p2/) · [3](/rpc-service/chains/chains-api/story/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v1.0.2-stable-3daeb0c8/linux-amd64/go1.22.0", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1514" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xf4257" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x17a293" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x7e093BA1474b79481f9B87D66c99a819F25e82E2", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5c36f37eca7b2758" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x7e093BA1474b79481f9B87D66c99a819F25e82E2", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x7e093BA1474b79481f9B87D66c99a819F25e82E2", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x372e" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x8f5aa2b8fe133b35789ca4916782a464e95813034a040f3c603b2b0088f16a9e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x17A30B"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x8f5aa2b8fe133b35789ca4916782a464e95813034a040f3c603b2b0088f16a9e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x17A30B"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x8bcF524385e6E3AFE36E8C3AD0bDD8dEa030dAD4", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x60806040526004361061024c575f3560e01c80637427e28f11610134578063b0bf05ab116100b3578063de5472e711610078578063de5472e7146105b8578063df9aee6814610289578063e2da6f0a146105cd578063e4dd2fec14610289578063eeae400e146105e..." } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/story/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x9994F1d8a6A086C0022f72913DcB1B4c4A744F90", "data": "0x70a08231000000000000000000000000000000000000000000000000A0737Bb3f7F87f58A8D0532c3E4D2fB9E8Ddee23" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sui/graphql/ title: Sui GraphQL description: Sui GraphQL API is available on Web3 API platform. source: docs/rpc-service/chains/chains-api/sui/graphql.mdx --- # Sui GraphQL > API reference for [Sui](/rpc-service/chains/chains-api/sui/). [All methods ->](/rpc-service/chains/chains-api/sui/)
> Sui GraphQL API is available on [Web3 API platform](https://www.ankr.com/rpc/sui). The Sui GraphQL RPC provides a flexible query interface for interacting with the Sui blockchain. Unlike JSON-RPC, GraphQL lets you request exactly the data you need in a single call — reducing overfetching and round trips. With GraphQL, you can compose queries that combine objects, transactions, balances, checkpoints, and more into a single request. It supports pagination, filtering, and nested lookups, making it well suited for frontends, dashboards, and analytics tools. ## Endpoint | Network | Endpoint | |---------|----------| | Mainnet | `https://rpc.ankr.com/http/sui_graphql` | For Premium users, append your token to the URL: `https://rpc.ankr.com/http/sui_graphql/YOUR_ANKR_API_KEY` --- ## Request example Query the latest checkpoint: ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/sui_graphql \ -H 'Content-Type: application/json' \ -d '{ "query": "{ checkpoint { sequenceNumber digest timestamp } }" }' ``` ## Response example ```json { "data": { "checkpoint": { "sequenceNumber": 214225619, "digest": "GNSviTUX6DXkiCPKYDo1uihJsm5oRcjtvrkT8mVQyay8", "timestamp": "2025-03-24T12:00:00Z" } } } ``` --- ## Query examples ### Get object by ID ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/sui_graphql \ -H 'Content-Type: application/json' \ -d '{ "query": "{ object(address: \"0x5\") { address version digest owner { __typename } } }" }' ``` ### Get address balances ```shell curl -X POST https://rpc.ankr.com/http/YOUR_ANKR_API_KEY/sui_graphql \ -H 'Content-Type: application/json' \ -d '{ "query": "{ address(address: \"0xYOUR_ADDRESS\") { balance { totalBalance coinType { repr } } } }" }' ``` --- ## Key features - **Composable queries** — request multiple related resources in a single call. - **Pagination** — default 50 items per page, up to 200 for multi-get operations. - **Filtering** — narrow results by type, owner, checkpoint range, and more. - **No overfetching** — get only the fields you need. ## Further reading - [Sui GraphQL reference](https://docs.sui.io/references/sui-graphql) - [Sui GraphQL RPC concepts](https://docs.sui.io/concepts/data-access/graphql-rpc) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sui/grpc-p2/ title: Sui gRPC (2/3) description: Sui gRPC API is available on Web3 API platform. source: docs/rpc-service/chains/chains-api/sui/grpc-p2.mdx --- # Sui gRPC (2/3) > API reference for [Sui](/rpc-service/chains/chains-api/sui/). [All methods ->](/rpc-service/chains/chains-api/sui/) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/sui/grpc/) · 2 · [3](/rpc-service/chains/chains-api/sui/grpc-p3/) ## Methods list ### `GetDatatype` > Retrieves metadata about a Move struct/type. #### Parameters * `package_id` (string; required): The storage ID (`storage_id`) of the package that defines the datatype. * `module_name` (string; required): The name of the module where the datatype is defined. * `name` (string; required): The name of the datatype to retrieve. #### Returns * `datatype` (object; optional): Information about the requested Move datatype. * `typeName` (string): Fully qualified name (`::::`). * `definingId` (string): Package ID of the version where this datatype was first introduced. * `module` (string): Name of the defining module. * `name` (string): Name of the datatype. * `abilities` (array): List of abilities (e.g., `COPY`, `DROP`, `STORE`, `KEY`). * `typeParameters` (array): Type parameter descriptors. * `constraints` (array): Ability constraints. * `isPhantom` (boolean): Whether the type parameter is phantom. * `kind` (string): Either `STRUCT` or `ENUM`. * `fields` (array; optional): Field descriptors (only for struct types). * `name` (string): Field name. * `position` (number): Field position in the struct definition. * `type` (object): Field type signature. * `type` (string): Primitive or composite type (e.g., `U64`, `ADDRESS`, `VECTOR`, `DATATYPE`, etc.). * `typeName` (string; optional): Fully qualified datatype name (when `type` is `DATATYPE`). * `typeParameterInstantiation` (array; optional): Applied generic parameters. * `typeParameter` (number; optional): Index of the type parameter (when applicable). * `variants` (array; optional): Enum variant descriptors (only for enum types). * `name` (string): Variant name. * `position` (number): Variant order. * `fields` (array): Field descriptors for this variant. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "package_id": "0x2", "module_name": "coin", "name": "Coin" }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.MovePackageService.GetDatatype ``` #### Response example ```json { "datatype": { "typeName": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin", "definingId": "0x0000000000000000000000000000000000000000000000000000000000000002", "module": "coin", "name": "Coin", "abilities": [ "STORE", "KEY" ], "typeParameters": [ { "isPhantom": true } ], "kind": "STRUCT", "fields": [ { "name": "id", "position": 0, "type": { "type": "DATATYPE", "typeName": "0x0000000000000000000000000000000000000000000000000000000000000002::object::UID" } }, { "name": "balance", "position": 1, "type": { "type": "DATATYPE", "typeName": "0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance", "typeParameterInstantiation": [ { "type": "TYPE_PARAMETER", "typeParameter": 0 } ] } } ] } } ``` --- ### `GetFunction` > Retrieves metadata about a Move function. #### Parameters * `package_id` (string; required): The storage ID (`storage_id`) of the package that defines the function. * `module_name` (string; required): The name of the module where the function is defined. * `name` (string; required): The name of the function to retrieve. #### Returns * `function` (object; optional): Metadata describing the requested Move function. * `name` (string): The function name. * `visibility` (string): One of `PRIVATE`, `PUBLIC`, or `FRIEND`. * `isEntry` (boolean): Whether the function is marked as `entry`. * `typeParameters` (array): Type parameter descriptors. * `constraints` (array): Ability constraints required by this type parameter. * `isPhantom` (boolean): Indicates whether this type parameter is phantom. * `parameters` (array): Function parameter type descriptors. * `reference` (string): Reference kind (`IMMUTABLE`, `MUTABLE`, or `UNKNOWN`). * `body` (object): Type signature. * `type` (string): Primitive or composite type (`U64`, `ADDRESS`, `VECTOR`, `DATATYPE`, etc.). * `typeName` (string; optional): Fully qualified datatype name (when applicable). * `typeParameterInstantiation` (array; optional): Applied type parameters (for generics). * `typeParameter` (number; optional): Index of the type parameter. * `returns` (array): Function return type descriptors. * Same structure as `parameters`. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "package_id": "0x2", "module_name": "coin", "name": "mint" }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.MovePackageService.GetFunction ``` #### Response example ```json { "function": { "name": "mint", "visibility": "PUBLIC", "isEntry": false, "typeParameters": [ {} ], "parameters": [ { "reference": "MUTABLE", "body": { "type": "DATATYPE", "typeName": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::TreasuryCap", "typeParameterInstantiation": [ { "type": "TYPE_PARAMETER", "typeParameter": 0 } ] } }, { "body": { "type": "U64" } }, { "reference": "MUTABLE", "body": { "type": "DATATYPE", "typeName": "0x0000000000000000000000000000000000000000000000000000000000000002::tx_context::TxContext" } } ], "returns": [ { "body": { "type": "DATATYPE", "typeName": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin", "typeParameterInstantiation": [ { "type": "TYPE_PARAMETER", "typeParameter": 0 } ] } } ] } } ``` --- ### `GetPackage` > Retrieves information about a Move package. #### Parameters * `package_id` (string; required): The storage ID (`storage_id`) of the package to retrieve. #### Returns * `package` (object; optional): Metadata describing the requested Move package. * `storageId` (string): The on-chain ObjectId for this specific package version. * `originalId` (string): The package’s original ID (the first published version). Stable across upgrades. * `version` (number): The version number of this package. * `modules` (array): List of Move modules defined in the package. * `name` (string): Module name. * `contents` (string): Base64-encoded compiled bytecode. * `datatypes` (array): Datatype descriptors defined in the module. * `functions` (array): Function descriptors defined in the module. * `typeOrigins` (array): Mapping of datatypes to the package version that first defined them. * `moduleName` (string) * `datatypeName` (string) * `packageId` (string) * `linkage` (array): Mapping of dependency package IDs. * `originalId` (string): Runtime ID used by dependent packages. * `upgradedId` (string): Storage ID used for loading. * `upgradedVersion` (number): Version corresponding to `upgraded_id`. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "package_id": "0x2" }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.MovePackageService.GetPackage ``` #### Response example Below is a truncated example: ```json { "package": { "storageId": "0x2", "originalId": "0x2", "version": "1", "modules": [ { "name": "coin", "contents": "BASE64_BYTECODE...", "datatypes": [ { "typeName": "0x2::coin::Coin", "definingId": "0x2", "module": "coin", "name": "Coin", "abilities": ["COPY", "DROP", "STORE"], "typeParameters": [], "kind": "STRUCT", "fields": [ { "name": "value", "position": 0, "type": { "type": "U64" } } ] } ], "functions": [ { "name": "mint", "visibility": "FRIEND", "isEntry": false, "typeParameters": [], "parameters": [], "returns": [] } ] } ], "typeOrigins": [ { "moduleName": "coin", "datatypeName": "Coin", "packageId": "0x2" } ], "linkage": [ { "originalId": "0x1", "upgradedId": "0x1", "upgradedVersion": "1" } ] } } ``` --- ### `ListPackageVersions` > Lists the published versions of a package. #### Parameters * `package_id` (string; required): The storage ID (`storage_id`) of any version of the package. * `page_size` (number; optional): Maximum number of versions to return. Defaults to `1000`, maximum is `10000`. * `page_token` (string; optional): Token from a previous response used to fetch the next page. Must match the original request parameters. #### Returns * `versions` (array): List of available package versions, ordered by version. * `packageId` (string): Storage ID of this package version. * `version` (number): Version number. * `nextPageToken` (string; optional): Token to retrieve the next page. Omitted if no more versions are available. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "package_id": "0x2", "page_size": 5 }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.MovePackageService.ListPackageVersions ``` #### Response example ```json { "versions": [ { "packageId": "0x0000000000000000000000000000000000000000000000000000000000000002", "version": "38" }, { "packageId": "0x0000000000000000000000000000000000000000000000000000000000000002", "version": "39" }, { "packageId": "0x0000000000000000000000000000000000000000000000000000000000000002", "version": "40" }, { "packageId": "0x0000000000000000000000000000000000000000000000000000000000000002", "version": "41" }, { "packageId": "0x0000000000000000000000000000000000000000000000000000000000000002", "version": "42" } ], "nextPageToken": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIrAAAAAAAAAA==" } ``` --- **Signature Verification Service**: Performs cryptographic verification for signatures, proofs, and signed messages. ### `VerifySignature` > Validates a signature against a message and public key. #### Parameters * `message` (object; required): BCS-encoded message to verify. * `name` (string; required): Message type identifier (for example: `"PersonalMessage"`, `"TransactionData"`). * `value` (string; required): Base64-encoded BCS bytes of the message. * `signature` (object; required): Signature to verify, represented as a `UserSignature`. * May contain one of the following depending on the scheme: * `simple` → ED25519 / SECP256K1 / SECP256R1 signatures * `multisig` → multisig aggregated signature * `zklogin` → zkLogin authenticator * `passkey` → passkey authenticator * `scheme` (string; optional): Signature scheme identifier (e.g., `"ED25519"`). * `address` (string; optional): Expected address derived from the signature. Verification fails unless the derived address matches this value. * `jwks` (array; optional): List of JSON Web Keys used to verify zkLogin signatures. If omitted, the node uses the active on-chain JWK set. * Each entry: * `kty` (string): Key type (e.g., `"RSA"`). * `e` (string): RSA public exponent. * `n` (string): RSA modulus. * `alg` (string): Algorithm (e.g., `"RS256"`). #### Returns * `isValid` (boolean): Indicates whether the provided signature is valid for the given message. * `reason` (string; optional): Error explanation when `isValid` is `false`. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "message": { "name": "PersonalMessage", "value": "BASE64_BCS_MESSAGE" }, "signature": { "scheme": "ED25519", "simple": { "scheme": "ED25519", "signature": "BASE64_SIGNATURE", "publicKey": "BASE64_PUBLIC_KEY" } }, "address": "0xREPLACE_WITH_EXPECTED_ADDRESS", "jwks": [ { "kty": "RSA", "e": "AQAB", "n": "BASE64URL_RSA_MODULUS", "alg": "RS256" } ] }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.SignatureVerificationService.VerifySignature ``` #### Response example ```json { "isValid": true } ``` --- **State Service**: Provides access to detailed on-chain state including objects, balances, ownership, object layouts, dynamic fields, and protocol configuration. This is the main service for querying Sui state data. ### `GetBalance` > Retrieves balance for a specific coin type. #### Parameters * `owner` (string; required): Sui address whose balance you want to query. * `coin_type` (string; required): Fully qualified coin type (for example: `0x2::sui::SUI`). #### Returns * `balance` (object; optional): Balance information for the requested coin type. * `coinType` (string): Coin type identifier. * `balance` (string): Total balance in the smallest unit of the coin. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "owner": "0x0000000000000000000000000000000000000000000000000000000000000000", "coin_type": "0x2::sui::SUI" }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.StateService.GetBalance ``` #### Response example ```json { "balance": { "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", "balance": "2044869853603" } } ``` --- ### `GetCoinInfo` > Retrieves metadata for a coin type. #### Parameters * `coin_type` (string; required): Fully qualified coin type to query (example: `0x2::sui::SUI`). #### Returns * `coinType` (string): The coin type returned by the node. * `metadata` (object; optional): Standard metadata for this coin type. * `id` (string): ObjectId of the metadata object. * `decimals` (number): Number of decimal places. * `name` (string): Human-readable token name. * `symbol` (string): Token symbol. * `description` (string): Token description. * `iconUrl` (string; optional): URL to the coin icon. * `metadataCapId` (string; optional): If claimed, ID of MetadataCap. * `metadataCapState` (string): State of the MetadataCap. * `treasury` (object; optional): Information about the coin’s TreasuryCap object. * `id` (string): TreasuryCap object ID. * `totalSupply` (string): Total supply (smallest unit). * `supplyState` (string): Whether supply is FIXED, BURN_ONLY, etc. * `regulatedMetadata` (object; optional): Applies only to regulated coins. * `id` (string): RegulatedCoinMetadata object ID. * `coinMetadataObject` (string): Linked metadata object ID. * `denyCapObject` (string): Deny list controller object. * `allowGlobalPause` (boolean): Whether coin can be globally paused. * `variant` (number): Variant of regulated metadata. * `coinRegulatedState` (string): REGULATED / UNREGULATED / UNKNOWN. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "coin_type": "0x2::sui::SUI" }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.StateService.GetCoinInfo ``` #### Response example ```json { "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", "metadata": { "id": "0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc", "decimals": 9, "name": "Sui", "symbol": "SUI", "description": "", "iconUrl": "", "metadataCapState": "UNCLAIMED" }, "treasury": { "totalSupply": "10000000000000000000", "supplyState": "FIXED" }, "regulatedMetadata": { "coinRegulatedState": "UNREGULATED" } } ``` --- ### `ListBalances` > Lists all coin balances for an address. #### Parameters * `owner` (string; required): Address whose balances to list. * `page_size` (uint32; optional): Maximum number of entries to return (default: `50`; max: `1000`). * `page_token` (bytes; optional): Token for fetching the next page. #### Returns * `balances` (array): List of balances for each coin type. * `coinType` (string): Fully qualified coin type. * `balance` (string): Total balance in the smallest unit. * `nextPageToken` (bytes; optional): Token for retrieving the next page. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "owner": "0x123456789abcdef123456789abcdef123456789abcdef123456789abcdef1234", "page_size": 20 }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.StateService.ListBalances ``` #### Response example ```json { "balances": [ { "coinType": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI", "balance": "1048533540" }, { "coinType": "0x022cac18d673c28bb29a69bf1cc4b86344d81e1ae29d9bd2220745f75e4c980c::mat::MAT", "balance": "1000000000000" }, { "coinType": "0x03cbd6eac52f4e6a98cd8ee44e1d7c8960ccc94cb48fcd94b45846df2c58ce07::mat::MAT", "balance": "1000000000000" }, { "coinType": "0x25bb6dda13a9e44f0a5eef5edf6967e551f3c8e57e3495f2f1da1285a2d45955::mat::MAT", "balance": "1000000000000" }, { "coinType": "0x49b3e7b2b7f3fec982c1c40d4acfcc55361e0925d1b689b643251b01ee6e635c::mat::MAT", "balance": "1000000000000" }, { "coinType": "0x7e21166ee1ae31652cdbbac427d4830e172a0b8a65eb1c2f37e6b7c9fc24bd53::mat::MAT", "balance": "1000000000000" } ] } ``` --- ### `ListDynamicFields` > Lists dynamic fields under an object. #### Parameters * `parent` (string; required): The UID/ObjectId of the parent that owns the dynamic fields. * `page_size` (uint32; optional): Maximum number of entries to return (default: `50`; max: `1000`). * `page_token` (bytes; optional): Token for fetching the next page. * `read_mask` (object; optional): Field mask specifying which fields to include. * `paths` (array of strings): Protobuf field names to return (for example: `"parent"`, `"field_id"`, `"field_object"`, `"name"`, `"value"`, `"value_type"`, `"child_id"`, `"child_object"`). Some implementations accept `"*"` to request all available fields. #### Returns * `dynamicFields` (array): Page of dynamic fields under the parent. Each entry may contain: * `kind` (string): `"FIELD"` or `"OBJECT"`. * `parent` (string): Parent ObjectId. * `fieldId` (string): ObjectId representing this dynamic field. * `fieldObject` (object; optional): The Object when the field is stored as an object. * `name` (object; optional): BCS-encoded dynamic field name. * `value` (object; optional): BCS-encoded dynamic field value. * `valueType` (string; optional): Type of the value or child object. * `childId` (string; optional): ObjectId of a child object (when `kind = OBJECT`). * `childObject` (object; optional): The dynamic child object itself. * `nextPageToken` (bytes; optional): Token for retrieving the next results page. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "parent": "0xREAL_PARENT_WITH_DYNAMIC_FIELDS", "page_size": 10 }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.StateService.ListDynamicFields ``` #### Response example ```json { "dynamicFields": [ { "kind": "FIELD", "parent": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd", "fieldId": "0xa1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1", "name": { "name": "u64", "value": "AAAAAAE=" }, "value": { "name": "u64", "value": "AAAH6A==" }, "valueType": "u64" }, { "kind": "OBJECT", "parent": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd", "fieldId": "0x99ffeeddccbbaa99887766554433221100ffeeddccbbaa9988776655443322", "childId": "0x22ee11ddccbb0099887766554433221100ffeeccbb22aa9988776655443300", "childObject": { "objectId": "0x22ee11ddccbb0099887766554433221100ffeeccbb22aa9988776655443300", "version": "5", "digest": "B9k7QJ4twQ6nB8c6jZpTZxB6TcvG6YtM2h5b2j2G5mTf", "objectType": "0x2::my_module::MyStruct", "owner": { "kind": "AddressOwner", "addressOwner": "0x87654321abcdef00112233445566778899aabbccddeeff0011223344556677" } }, "valueType": "0x2::my_module::MyStruct" } ], "nextPageToken": "CgYIARAA" } ``` --- ### `ListOwnedObjects` > Lists the objects owned by an address. #### Parameters * `owner` (string; required): The Sui address whose owned objects should be listed. * `page_size` (uint32; optional): Maximum number of objects to return (default: `50`; max: `1000`). * `page_token` (bytes; optional): Token from a previous response to fetch the next page. * `read_mask` (object; optional): Field mask selecting which object fields to include. If omitted, defaults to: `object_id, version, object_type`. * `paths` (array of strings): Field names to include (e.g., `"object_id"`, `"version"`, `"owner"`, `"object_type"`, `"digest"`, `"bcs"`, `"json"`). * `object_type` (string; optional): Optional type filter: * `"0x2::coin::Coin"` → returns all `Coin` objects. * `"0x2::coin::Coin<0x2::sui::SUI>"` → returns only `Coin`. * Any Move struct tag is accepted. #### Returns * `objects` (array): List of owned objects with fields requested via `read_mask`. Each object may include fields such as: * `objectId` (string): Object identifier. * `version` (string): Object version. * `digest` (string): Object digest. * `owner` (object): Ownership details. * `objectType` (string): Move type or `"package"`. * `bcs` (object): BCS-encoded value (if requested). * `json` (object): JSON representation (if requested). * Additional fields depending on the mask. * `nextPageToken` (bytes; optional): Returned if more pages are available. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "owner": "0xd8908c165dee785924e7421a0fd0418a19d5daeec395fd505a92a0fd3117e428", "read_mask": { "paths": ["object_id", "version", "owner", "digest", "object_type"] } }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.StateService.ListOwnedObjects ``` #### Response example ```json { "objects": [ { "objectId": "0x5b52d6863faad645692a0928fe7bc35df999ecfcf2ad029e471b42a4abbecec6", "version": "527071929", "digest": "DigX1wVS5xGHCELdhG1BSzHULNkF5sM3aPpS9Q1ZfHri", "owner": { "kind": "ADDRESS", "address": "0xd8908c165dee785924e7421a0fd0418a19d5daeec395fd505a92a0fd3117e428" }, "objectType": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin\u003c0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI\u003e" }, { "objectId": "0x4fb01474fd465cf97e36f6e758b9f3f47c56d4907ea74552fc0027c9318b354a", "version": "527071928", "digest": "4WohPFhmhq1ezPh7XqP8AexG9bg5nEXcY82VoKBVaL15", "owner": { "kind": "ADDRESS", "address": "0xd8908c165dee785924e7421a0fd0418a19d5daeec395fd505a92a0fd3117e428" }, "objectType": "0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin\u003c0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI\u003e" } ] } ``` --- **Subscription Service**: Supports server-side streaming for real-time updates. Use it to subscribe to events, transactions, checkpoints, or other continuous data feeds. --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sui/grpc-p3/ title: Sui gRPC (3/3) description: Sui gRPC API is available on Web3 API platform. source: docs/rpc-service/chains/chains-api/sui/grpc-p3.mdx --- # Sui gRPC (3/3) > API reference for [Sui](/rpc-service/chains/chains-api/sui/). [All methods ->](/rpc-service/chains/chains-api/sui/) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/sui/grpc/) · [2](/rpc-service/chains/chains-api/sui/grpc-p2/) · 3 ## Methods list ### `SubscribeCheckpoints` > Subscribes to a stream of newly produced checkpoints. #### Parameters * `read_mask` (object; optional): Field mask specifying which fields of the streamed response to include. If omitted, all default fields are returned. * `paths` (array of strings; optional): Protobuf field names to include in each `SubscribeCheckpointsResponse` message (for example: `cursor`, `checkpoint`, `checkpoint.sequence_number`, `checkpoint.digest`, `checkpoint.summary`, `checkpoint.transactions`). Some implementations accept `"*"` to return all available fields. #### Returns Stream of `SubscribeCheckpointsResponse` messages: * `cursor` (string): Checkpoint sequence number representing the current position in the checkpoint stream. * `checkpoint` (object; optional): Details of the checkpoint at the current cursor. * `sequenceNumber` (string): Height of this checkpoint. * `digest` (string): Digest of the checkpoint’s summary. * `summary` (object; optional): High-level checkpoint summary (epoch, total transactions, content digest, timestamp, etc.). * `signature` (object; optional): Validator aggregated signature that certified this checkpoint. * `contents` (object; optional): Committed transaction digests and signatures for this checkpoint. * `transactions` (array; optional): Executed transactions included in this checkpoint. * `objects` (object; optional): Objects referenced or produced by transactions in this checkpoint. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{}' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.SubscriptionService.SubscribeCheckpoints ``` #### Reponse example ```json { "cursor": "213938636", "checkpoint": { "sequenceNumber": "213938636", "digest": "6mSsq3PjZc4rK2aFT3eK6oRxmM6DPo7LcFFo7z1Doq9H", "summary": { "epoch": "951", "sequenceNumber": "213938636", "totalNetworkTransactions": "1254933841", "contentDigest": "9B7kLz8F8svuZ8mFyKqutMAyCcwR1R2uF3xTjv7p9QyE", "previousDigest": "3JfxNefB6DmSaJMj1iJXqZF4KA3VjsoUUP1gHnN9LaMR", "timestamp": "2025-11-19T17:42:30.554Z" } } } ``` --- **Transaction Execution Service**: Lets you simulate and execute transactions, fetch execution effects, run dry-runs, and retrieve transaction metadata. This is the primary service for write operations and transaction analysis. ### `ExecuteTransaction` > Executes a signed transaction on-chain. #### Parameters * `transaction` (object; required): The transaction to execute. * `bcs` (object; optional): BCS-encoded transaction data. * `name` (string): Expected to be `"TransactionData"`. * `value` (string): Base64-encoded BCS bytes of the transaction. * `digest` (string; optional): Transaction digest, if already known. * `version` (int32; optional): Transaction version. * `kind` (object; optional): Transaction kind and data (for example, programmable transaction, system transaction). * `sender` (string; optional): Sui address of the transaction sender. * `gas_payment` (object; optional): Gas payment configuration. * `expiration` (object; optional): Transaction expiration settings (for example, epoch-based). Note: In practice, most clients construct the transaction using SDKs/wallets and send it via the `bcs` field, rather than manually building all nested fields. * `signatures` (array; required): Set of `UserSignature` objects authorizing execution of the transaction. Typically, contains one or more signatures depending on the scheme (`ED25519`, multisig, zkLogin, passkey, etc.). * `read_mask` (object; optional): Field mask specifying which parts of the executed transaction to return. If omitted, defaults to: `effects.status, checkpoint`. * `paths` (array of strings; optional): Names of fields to include in the `ExecutedTransaction` result (for example: `"digest"`, `"transaction"`, `"signatures"`, `"effects"`, `"effects.status"`, `"effects.gas_used"`, `"checkpoint"`, `"timestamp"`, `"objects"`). Some implementations accept `"*"` to return all available fields. #### Returns * `transaction` (object; optional): Executed transaction result (`ExecutedTransaction`). * `digest` (string): Digest of the executed transaction. * `transaction` (object; optional): Original transaction data (if requested). * `signatures` (array; optional): User signatures used to authorize execution. * `effects` (object; optional): Execution effects (status, gas used, changed objects, dependencies, etc.). * `events` (object; optional): Events emitted by the transaction. * `checkpoint` (string; optional): Checkpoint sequence number that includes this transaction. * `timestamp` (string; optional): Timestamp of the checkpoint containing the transaction. * `balanceChanges` (array; optional): Balance changes resulting from execution. * `objects` (object; optional): Objects referenced or produced by this transaction. Note: The exact fields present depend on the `read_mask` you provide. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "transaction": { "bcs": { "name": "TransactionData", "value": "BASE64_BCS_TRANSACTION" } }, "signatures": [ { "scheme": "ED25519", "simple": { "scheme": "ED25519", "signature": "BASE64_SIGNATURE", "publicKey": "BASE64_PUBLIC_KEY" } } ], "read_mask": { "paths": [ "digest", "effects.status", "effects.gas_used", "checkpoint" ] } }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.TransactionExecutionService.ExecuteTransaction ``` #### Response example ```json { "transaction": { "digest": "H3m2oZ4aJx9t8fV6vG3Z9KQ9XkqD4zTqLk2oQZ2V7pU", "transaction": { "sender": "0x8a1f2c1e4b3d9a55678900112233445566778899aa11223344556677889900ff", "gasPayment": { "objects": [ { "objectId": "0x4e1b...02f1", "version": "12345", "digest": "Gp3qz9Ck1B4Hd8xF3vZtYc9tK1p9V5mQm29L6gC48zdK" } ], "owner": "0x8a1f2c1e4b3d9a55678900112233445566778899aa11223344556677889900ff", "price": "1000", "budget": "50000000" } }, "signatures": [ { "scheme": "ED25519", "simple": { "scheme": "ED25519", "signature": "AAAAAAAAAAAAAAAAAAAAAA==", "publicKey": "BBBBBBBBBBBBBBBBBBBBBB==" } } ], "effects": { "digest": "7rFqL4y8Bv4mMZ1HjX89U8C4o5JkF9wN1u5NQ3p4zXq", "version": 2, "status": { "success": true }, "epoch": "951", "gasUsed": { "computationCost": "5000", "storageCost": "3000", "storageRebate": "1500", "nonRefundableStorageFee": "200" }, "transactionDigest": "H3m2oZ4aJx9t8fV6vG3Z9KQ9XkqD4zTqLk2oQZ2V7pU", "changedObjects": [ { "objectId": "0x0000000000000000000000000000000000000000000000000000000000000006", "inputState": "INPUT_OBJECT_STATE_EXISTS", "outputState": "OUTPUT_OBJECT_STATE_OBJECT_WRITE", "outputVersion": "631418222", "objectType": "0x2::coin::Coin<0x2::sui::SUI>" } ] }, "checkpoint": "213906807", "timestamp": "2025-11-19T15:34:37.980Z" } } ``` --- ### `SimulateTransaction` > Simulates a transaction without executing it. #### Parameters * `transaction` (object; required): The transaction to simulate (not executed on-chain). * `bcs` (object; optional): BCS-encoded transaction data. * `name` (string): Usually `"TransactionData"`. * `value` (string): Base64-encoded BCS bytes of the transaction. * Other fields (`digest`, `version`, `kind`, `sender`, `gas_payment`, `expiration`) may be present, but most clients rely on `bcs`. * `read_mask` (object; optional): Field mask specifying which parts of the simulated `ExecutedTransaction` to include. * `paths` (array of strings; optional): Field names to include in the response (for example: `"digest"`, `"effects"`, `"effects.status"`, `"effects.gas_used"`, `"checkpoint"`, `"objects"`). Some implementations accept `"*"` to return all available fields. * `checks` (string; optional): Controls whether validation checks are applied during simulation. * `"ENABLED"` (default): Run full transaction checks (recommended). * `"DISABLED"`: Skip checks; useful for low-level analysis but may produce unrealistic results. * `do_gas_selection` (boolean; optional): When `true`, the node estimates gas usage, selects appropriate gas coins, and includes the chosen gas payment and budget in the response. Ignored if `checks` is set to `"DISABLED"`. #### Returns * `transaction` (object; optional): Simulated execution result in the `ExecutedTransaction` format. * `digest` (string): Simulated transaction digest. * `transaction` (object; optional): Transaction data (may include updated gas payment when `do_gas_selection` is `true`). * `effects` (object; optional): Simulated execution effects (status, gas usage, changed objects, dependencies, etc.). * `events` (object; optional): Events that would be emitted by this transaction. * `checkpoint` (string; optional): Simulated checkpoint position, if applicable. * `timestamp` (string; optional): Simulated timestamp. * `balanceChanges` (array; optional): Estimated balance changes. * `objects` (object; optional): Objects that would be read/changed. * `command_outputs` (array): Per-command intermediate outputs from executing the programmable transaction. * Each entry is a `CommandResult`: * `return_values` (array): Outputs returned by a command. * `argument` (object): Reference to the argument this output corresponds to (kind: `GAS`, `INPUT`, or `RESULT`, plus index). * `value` (object): BCS-encoded value. * `json` (object): JSON rendering of the output, when available. * `mutated_by_ref` (array): Outputs for values mutated via mutable references, with the same shape as `return_values`. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "transaction": { "bcs": { "name": "TransactionData", "value": "AAm3AwAAAAAAADUiEgAAAAAAAJziwJyaAQAAIM2OI+iSHv7wsCz6HJ2NdpMelfuJGh/nlMWzDYH8lHAvAQAgefKIMDsHD3If7IXj/emWCPFZEQDIwG7nmVTP+j3M/SoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA==" } } }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.TransactionExecutionService.SimulateTransaction ``` #### Response example ```json { "transaction": { "digest": "9JvPyz9pLRuCrN8WUyj4q7LZ4E8xRCqUj9Dj3m7JrT3", "transaction": { "digest": "9JvPyz9pLRuCrN8WUyj4q7LZ4E8xRCqUj9Dj3m7JrT3", "sender": "0xabc...123", "kind": { "kind": "PROGRAMMABLE_TRANSACTION" } }, "effects": { "status": { "success": true }, "gasUsed": { "computationCost": "20000", "storageCost": "5000", "storageRebate": "1200", "nonRefundableStorageFee": "0" }, "version": 1, "digest": "5tuFT5NmrFh4u9w1SwQLuRY1fJ5r93R4cdE9eWHK8n8", "changedObjects": [], "dependencies": [] }, "balanceChanges": [], "checkpoint": null, "timestamp": null }, "command_outputs": [ { "return_values": [ { "argument": { "kind": "INPUT", "input": 0 }, "value": { "name": "u64", "value": "AAAAAA==" }, "json": 42 } ], "mutated_by_ref": [] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sui/grpc/ title: Sui gRPC (1/3) description: Sui gRPC API is available on Web3 API platform. source: docs/rpc-service/chains/chains-api/sui/grpc.mdx --- # Sui gRPC (1/3) > API reference for [Sui](/rpc-service/chains/chains-api/sui/). [All methods ->](/rpc-service/chains/chains-api/sui/) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/sui/grpc-p2/) · [3](/rpc-service/chains/chains-api/sui/grpc-p3/)
> Sui gRPC API is available on [Web3 API platform](https://www.ankr.com/rpc/sui). The Sui gRPC API provides a fast, type-safe, and efficient interface for interacting with the Sui blockchain. Designed for power users, indexers, explorers, and decentralized apps, this API enables access to Sui data with high performance and low latency. gRPC offers a high-performance communication protocol that uses [Protocol Buffers](https://protobuf.dev/overview/) for fast, compact data serialization. Protocol Buffers enforce strict request and response schemas that match Sui’s RPC definitions exactly — reducing runtime errors, improving compatibility, and enabling automatic client generation. With built-in support for code generation, you can scaffold clients in TypeScript, Go, Rust, and more, making it ideal for scalable backend systems such as indexers, blockchain explorers, and data-intensive decentralized apps. In addition to standard request–response calls, gRPC supports server-side streaming, enabling real-time data delivery without constant polling. This is especially useful when tracking events, checkpoints, or transactions live. The binary format used by Protocol Buffers is significantly faster and more bandwidth-efficient than JSON. The Sui gRPC server fully supports server reflection, allowing tools like `grpcurl` to discover available services and methods at runtime without requiring local `.proto` files. ## Endpoints | Network | Endpoint | Description | |---------|----------|-------------| | Mainnet | `sui.grpc.ankr.com:443` | Standard gRPC | | Testnet | `sui-testnet.grpc.ankr.com:443` | Testnet gRPC | | Mainnet Archive | `archive.sui.grpc.ankr.com:443` | Historical data access | For Premium users, pass your token via the `x-token` header (e.g., `-H "x-token: your-token"`). ### Regions Sui gRPC services are served from Ankr's standard regions — **New York, Los Angeles, Frankfurt, Tokyo, and Singapore** — and each request is routed to the closest healthy region automatically. You connect to the single global endpoint above; there's no region-specific hostname to choose. For the full, canonical list of serving regions and how routing and failover work, see [Regions & Routing](/rpc-service/regions/). **Archive endpoint** — provides access to historical Sui data that standard full nodes may have pruned. It exposes the same `LedgerService` API, so you can use the same client code. Use it when querying older transactions, checkpoints, or objects that are no longer available on current nodes. ## Methods list **Ledger Service**: Provides read access to global ledger metadata such as chain identifiers, epochs, checkpoints, timestamps, and system-level information. * [`BatchGetObjects`](/rpc-service/chains/chains-api/sui/grpc#batchgetobjects) — Retrieves multiple objects in one request. * [`BatchGetTransactions`](/rpc-service/chains/chains-api/sui/grpc#batchgettransactions) — Retrieves multiple transactions by digest. * [`GetCheckpoint`](/rpc-service/chains/chains-api/sui/grpc#getcheckpoint) — Retrieves a checkpoint by sequence or digest. * [`GetEpoch`](/rpc-service/chains/chains-api/sui/grpc#getepoch) — Retrieves details for a specific epoch. * [`GetObject`](/rpc-service/chains/chains-api/sui/grpc#getobject) — Retrieves a single object by ID. * [`GetServiceInfo`](/rpc-service/chains/chains-api/sui/grpc#getserviceinfo) — Retrieves node, chain, and service metadata. * [`GetTransaction`](/rpc-service/chains/chains-api/sui/grpc#gettransaction) — Retrieves a single transaction by digest. --- **Move Package Service**: Exposes Move package metadata, allowing you to query on-chain modules and published Move code. * [`GetDatatype`](/rpc-service/chains/chains-api/sui/grpc#getdatatype) — Retrieves metadata about a Move struct/type. * [`GetFunction`](/rpc-service/chains/chains-api/sui/grpc#getfunction) — Retrieves metadata about a Move function. * [`GetPackage`](/rpc-service/chains/chains-api/sui/grpc#getpackage) — Retrieves information about a Move package. * [`ListPackageVersions`](/rpc-service/chains/chains-api/sui/grpc#listpackageversions) — Lists the published versions of a package. --- **Signature Verification Service**: Performs cryptographic verification for signatures, proofs, and signed messages. * [`VerifySignature`](/rpc-service/chains/chains-api/sui/grpc#verifysignature): Validates a signature against a message and public key. --- **State Service**: Provides access to detailed on-chain state including objects, balances, ownership, object layouts, dynamic fields, and protocol configuration. This is the main service for querying Sui state data. * [`GetBalance`](/rpc-service/chains/chains-api/sui/grpc#getbalance) — Retrieves balance for a specific coin type. * [`GetCoinInfo`](/rpc-service/chains/chains-api/sui/grpc#getcoininfo) — Retrieves metadata for a coin type. * [`ListBalances`](/rpc-service/chains/chains-api/sui/grpc#listbalances) — Lists all coin balances for an address. * [`ListDynamicFields`](/rpc-service/chains/chains-api/sui/grpc#listdynamicfields) — Lists dynamic fields under an object. * [`ListOwnedObjects`](/rpc-service/chains/chains-api/sui/grpc#listownedobjects) — Lists objects owned by an address. --- **Subscription Service**: Supports server-side streaming for real-time updates. Use it to subscribe to events, transactions, checkpoints, or other continuous data feeds. * [`SubscribeCheckpoints`](/rpc-service/chains/chains-api/sui/grpc#subscribecheckpoints) — Subscribes to a stream of newly produced checkpoints. **Transaction Execution Service**: Lets you simulate and execute transactions, fetch execution effects, run dry-runs, and retrieve transaction metadata. This is the primary service for write operations and transaction analysis. * [`ExecuteTransaction`](/rpc-service/chains/chains-api/sui/grpc#executetransaction) — Executes a signed transaction on-chain. * [`SimulateTransaction`](/rpc-service/chains/chains-api/sui/grpc#simulatetransaction) — Simulates a transaction without executing it. --- **Ledger Service** Provides read access to global ledger metadata such as chain identifiers, epochs, checkpoints, timestamps, and system-level information. ### `BatchGetObjects` > Retrieves multiple objects in one request. #### Parameters * `requests` (array; required): List of objects to retrieve. Each entry is a `GetObjectRequest`. * `object_id` (string; required): ID of the object to fetch. * `version` (uint64; optional): Specific version to return. Latest version is used if omitted. * `read_mask` (object; optional): Field mask for this specific request. * `read_mask` (object; optional): Field mask specifying which object fields to include. * `paths` (array of strings; optional): Protobuf field names to include (for example: `object_id`, `version`, `digest`, `owner`, `object_type`, `previous_transaction`, `storage_rebate`, `json`). Some implementations accept `"*"` to return all available fields. #### Returns * `objects` (array): Results for each requested object, in the same order as `requests`. * `object` (object; optional): Object data when the lookup succeeds. * `objectId` (string): Unique identifier of the object. * `version` (string): Version of the object at the time it was fetched. * `digest` (string): Digest of this object state. * `owner` (object; optional): Ownership information. * `kind` (string; optional): Ownership kind (e.g., `ADDRESS`, `OBJECT`, `SHARED`, `IMMUTABLE`, `CONSENSUS_ADDRESS`). * `address` (string; optional): Owner or consensus address, when applicable. * `version` (string; optional): Version marker associated with ownership (mainly for shared objects). * `objectType` (string; optional): Type of the object (e.g., fully qualified Move struct type or `package`). * `storageRebate` (string; optional): Storage rebate amount returned if the object is deleted. * `balance` (string; optional): Balance value for coin objects (e.g., `0x2::coin::Coin`), when applicable. * `bcs` (object; optional): BCS-encoded representation of the object. * `name` (string; optional): Label of the BCS payload. * `value` (string; optional): Base64-encoded BCS bytes. * `contents` (object; optional): BCS-encoded contents of the underlying Move struct for non-package objects. * `name` (string; optional): Type name of the contents. * `value` (string; optional): Base64-encoded serialized data. * `package` (object; optional): Package metadata when the object is a Move package. * `json` (object; optional): JSON rendering of the object’s data, when available. * `error` (object; optional): Error information if the object could not be retrieved. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "requests": [ { "object_id": "0x0000000000000000000000000000000000000000000000000000000000000006"} ], "read_mask": { "paths": ["*"] } }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.LedgerService.BatchGetObjects ``` #### Response example ```json { "objects": [ { "object": { "bcs": { "name": "Object", "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgVjbG9jawVDbG9jawAAcUe1JQAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbyXYShmgEAAAIBAAAAAAAAACDB7K0J+aEqTtdTNV6fyXp81uAAUxcbRAl2UsKvtr/TigAAAAAAAAAA" }, "objectId": "0x0000000000000000000000000000000000000000000000000000000000000006", "version": "632637297", "digest": "GZ4vSjvoMLXj9BoiBsmJ52YKCR4nRTK2oEYMjMyCvBMk", "owner": { "kind": "SHARED", "version": "1" }, "objectType": "0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock", "hasPublicTransfer": false, "contents": { "name": "0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock", "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbyXYShmgEAAA==" }, "previousTransaction": "E411BJgW1RbuBePFkJ4BYaWVgF7g87wC46TjjYzH5Z1B", "storageRebate": "0", "json": { "id": "0x0000000000000000000000000000000000000000000000000000000000000006", "timestamp_ms": "1763646397938" } } } ] } ``` --- ## Methods list ### `BatchGetTransactions` > Retrieves multiple transactions by digest. #### Parameters * `digests` (array of strings; required): List of transaction digests to retrieve. * `read_mask` (object; optional): Field mask specifying which transaction fields to include. * `paths` (array of strings; optional): Protobuf field names to include (for example: `digest`, `transaction`, `transaction.sender`, `transaction.kind`, `effects`, `effects.status`, `effects.changed_objects`, `events`, `balance_changes`, `checkpoint`, `timestamp`). Some implementations accept `"*"` to return all available fields. #### Returns * `transactions` (array): Results for each requested digest, in the same order as `digests`. * `transaction` (object; optional): Full transaction data when the lookup succeeds. * `digest` (string): Digest of the transaction. * `transaction` (object; optional): The transaction payload, including sender, gas settings, and transaction kind. * `sender` (string; optional): Address of the sender. * `gasPayment` (object; optional): Gas payment details (objects used to pay gas, owner, price, budget). * `kind` (object; optional): High-level transaction kind (e.g., `ProgrammableTransaction`, `ConsensusCommitPrologue`, etc.). * `signatures` (array; optional): User signatures authorizing the transaction. * Each entry may contain `scheme`, `signature`, `publicKey`, or a multisig/zkLogin/passkey structure. * `effects` (object; optional): Execution effects. * `status` (object; optional): Execution status, typically `{ success: true }` or `{ success: false }`. * `changedObjects` (array; optional): Objects created, mutated, or deleted by the transaction. * `gasUsed` (object; optional): Breakdown of gas usage (computation, storage, rebate). * `transactionDigest` (string; optional): Digest of the executed transaction. * `dependencies` (array of strings; optional): Digests of dependency transactions. * `events` (object; optional): Events generated by this transaction, if any. * `balanceChanges` (array; optional): Per-address balance updates produced by the transaction. * `checkpoint` (string; optional): Checkpoint sequence number containing this transaction. * `timestamp` (string; optional): Timestamp of the checkpoint (ISO-8601 format). * `objects` (object; optional): Objects referenced or produced by this transaction (may be omitted when returned at checkpoint level). * `error` (object; optional): Error information if the transaction could not be retrieved. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "digests": ["hSwNywhBjUhHvSsZT5PhVFz5iZgMR24onKQKFSyubVu"], "read_mask": { "paths": ["*"] } }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.LedgerService.BatchGetTransactions ``` #### Response example ```json { "transactions": [ { "transaction": { "digest": "hSwNywhBjUhHvSsZT5PhVFz5iZgMR24onKQKFSyubVu", "transaction": { "digest": "hSwNywhBjUhHvSsZT5PhVFz5iZgMR24onKQKFSyubVu", "version": 1, "kind": { "kind": "CONSENSUS_COMMIT_PROLOGUE_V4", "consensusCommitPrologue": { "epoch": "951", "round": "1188405", "commitTimestamp": "2025-11-19T15:34:37.980Z", "consensusCommitDigest": "EqQHgXytDRK7Api3bw9AmwSaJ26s81bMBYY7Hs4gQJ2i" } }, "sender": "0x0000000000000000000000000000000000000000000000000000000000000000", "gasPayment": { "objects": [ { "objectId": "0x0000000000000000000000000000000000000000000000000000000000000000", "version": "0", "digest": "11111111111111111111111111111111" } ], "owner": "0x0000000000000000000000000000000000000000000000000000000000000000", "price": "1", "budget": "0" }, "expiration": { "kind": "NONE" } }, "effects": { "digest": "75dAW4QrYV6Vt9ngQA4g14DDnmCCWF5BgE3dsgvtgzwy", "version": 2, "status": { "success": true }, "epoch": "951", "gasUsed": { "computationCost": "0", "storageCost": "0", "storageRebate": "0", "nonRefundableStorageFee": "0" }, "transactionDigest": "hSwNywhBjUhHvSsZT5PhVFz5iZgMR24onKQKFSyubVu", "dependencies": [ "FRS9rMUZ2ycrVYFdtS2wiWE12JMwuVWKSZy3wpFd5ifD" ], "changedObjects": [ { "objectId": "0x0000000000000000000000000000000000000000000000000000000000000006", "inputState": "INPUT_OBJECT_STATE_EXISTS", "outputState": "OUTPUT_OBJECT_STATE_OBJECT_WRITE", "objectType": "0x2::clock::Clock" } ] }, "checkpoint": "213906807", "timestamp": "2025-11-19T15:34:37.980Z" } } ] } ``` --- ### `GetCheckpoint` > Retrieves a checkpoint by sequence or digest. #### Parameters * `sequence_number` (uint64; optional): Sequence number of the checkpoint to fetch. If both `sequence_number` and `digest` are omitted, the latest checkpoint is returned. * `digest` (string; optional): Digest of the checkpoint to fetch. * `read_mask` (object; optional): Field mask specifying which checkpoint fields to include in the response. * `paths` (array of strings; optional): Protobuf field names to include (for example: `sequence_number`, `digest`, `summary`, `summary.timestamp`, `summary.epoch`, `transactions`, `objects`). Some implementations accept `"*"` to return all available fields. #### Returns * `checkpoint` (object; optional): Checkpoint data for the requested identifier, or the latest checkpoint if no identifier was provided. * `sequenceNumber` (string): Height of this checkpoint. * `digest` (string): Digest of this checkpoint’s summary. * `summary` (object; optional): Compact header describing the checkpoint. * `epoch` (string; optional): Epoch that this checkpoint belongs to. * `totalNetworkTransactions` (string; optional): Total number of transactions committed since genesis, including this checkpoint. * `contentDigest` (string; optional): Digest of the checkpoint contents. * `previousDigest` (string; optional): Digest of the previous checkpoint summary (empty for genesis). * `timestamp` (string; optional): Timestamp of the checkpoint (ISO-8601). * `signature` (object; optional): Aggregated validator signature certifying this checkpoint. * `epoch` (string; optional): Epoch in which the aggregated signature was produced. * `signature` (string; optional): Aggregated BLS signature bytes (base64-encoded). * `contents` (object; optional): Committed contents of this checkpoint. * `digest` (string; optional): Digest of the checkpoint contents. * `transactions` (array; optional): List of transaction/effects digests included in this checkpoint. * `transactions` (array; optional): Executed transactions included in this checkpoint. Each entry has the same structure as `ExecutedTransaction` returned by transaction-related methods. * `objects` (object; optional): Set of objects referenced or produced by transactions in this checkpoint, returned as a collection of object records when requested. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "read_mask": { "paths": [ "sequence_number", "digest", "summary" ] } }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.LedgerService.GetCheckpoint ``` #### Response example ```json { "checkpoint": { "sequenceNumber": "214225619", "digest": "GNSviTUX6DXkiCPKYDo1uihJsm5oRcjtvrkT8mVQyay8", "summary": { "bcs": { "name": "CheckpointSummary", "value": "uAMAAAAAAADT0sQMAAAAADnoOwgBAAAAIPstfiDnwCpkcFlrp8nRs5js5xXtg0tbEcIIcaE+c+ldASDIgYxj9sUG3w0UPAMjIBpRGWeo4PV/1D5fw6pQLRm0VefE2UCSBwAAcCuegkRtAAC8pNR6PmsAABT/ZlEVAQAA/fdQoZoBAAAAAAoAAdn2AQAAAAAA" }, "digest": "GNSviTUX6DXkiCPKYDo1uihJsm5oRcjtvrkT8mVQyay8", "epoch": "952", "sequenceNumber": "214225619", "totalNetworkTransactions": "4433111097", "contentDigest": "HuVZqNZXeitWwTsHdNKT5JcjcsHZfT28CJAgpCFxy3kg", "previousDigest": "EVh7YWQnfvF89gg48v7tYDtX12SVyWSWQb5YtbCzJaxc", "epochRollingGasCostSummary": { "computationCost": "8324734633191", "storageCost": "120141016607600", "storageRebate": "117916092900540", "nonRefundableStorageFee": "1191071645460" }, "timestamp": "2025-11-20T12:50:29.501Z", "versionSpecificData": "AAHZ9gEAAAAAAA==" } } } ``` --- ### `GetEpoch` > Retrieves details for a specific epoch. #### Parameters * `epoch` (uint64; optional): The epoch number to fetch. If omitted, the service returns the current epoch. * `read_mask` (object; optional): Field mask specifying which epoch fields to include in the response. * `paths` (array of strings; optional): Protobuf field names to include (for example: `epoch`, `protocol_version`, `reference_gas_price`, `validator_set`, `validator_set.members`, `system_state`). Some implementations accept `"*"` to return all available fields. #### Returns * `epoch` (object; optional): Information about the requested epoch. * `epoch` (string): Epoch number. * `firstCheckpoint` (string; optional): Sequence number of the first checkpoint in this epoch. * `lastCheckpoint` (string; optional): Sequence number of the last checkpoint in this epoch. * `start` (string; optional): Start timestamp of the epoch (ISO-8601 format). * `end` (string; optional): End timestamp of the epoch (ISO-8601 format). * `referenceGasPrice` (string; optional): Reference gas price for this epoch. * `protocolConfig` (object; optional): Protocol configuration active in this epoch. * `protocolVersion` (string; optional): Protocol version number. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "epoch": "951" }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.LedgerService.GetEpoch ``` #### Response example ```json { "epoch": { "epoch": "951", "firstCheckpoint": "213579473", "lastCheckpoint": "213938636", "start": "2025-11-18T17:42:29.619Z", "end": "2025-11-19T17:42:30.554Z", "referenceGasPrice": "500", "protocolConfig": { "protocolVersion": "101" } } } ``` --- ### `GetObject` > Retrieves a single object by ID. #### Parameters * `object_id` (string; required): The `ObjectId` of the object to retrieve. * `version` (uint64; optional): The specific version of the object to return. If omitted and the object is live, the latest version is returned. * `read_mask` (object; optional): Field mask specifying which object fields to include in the response. * `paths` (array of strings; optional): Protobuf field names to include (for example: `object_id`, `version`, `digest`, `owner`, `object_type`, `previous_transaction`, `storage_rebate`, `json`). Some implementations accept `"*"` to return all available fields. #### Returns * `object` (object; optional): The returned object data if the lookup succeeds. * `objectId` (string): ID of the object. * `version` (string): Version of the object. * `digest` (string): Digest of this object state. * `owner` (object; optional): Ownership information. * May include fields such as `address`, `version`, or ownership `kind` (shared, immutable, object, etc.). * `objectType` (string): Type of the object (e.g., Move struct tag or `package`). * `bcs` (object; optional): Raw BCS representation of the object. * `name` (string): Name of the BCS-encoded type. * `value` (string): Base64-encoded BCS bytes. * `contents` (object; optional): BCS bytes of a Move struct value. * `package` (object; optional): Package information (present for Move packages). * `previousTransaction` (string; optional): Digest of the transaction that last mutated this object. * `storageRebate` (string; optional): Storage rebate amount associated with this object. * `json` (object; optional): JSON rendering of the object. * `balance` (string; optional): Current balance if the object is a `0x2::coin::Coin`. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "object_id": "0x0000000000000000000000000000000000000000000000000000000000000006" }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.LedgerService.GetObject ``` #### Response example ```json { "object": { "objectId": "0x0000000000000000000000000000000000000000000000000000000000000006", "version": "632658683", "digest": "H7BP9CsjCWqWdV459C7bAzECD5ozmFBfhSgb1KxXb5L7" } } ``` --- ### `GetServiceInfo` > Retrieves node, chain, and service metadata. #### Parameters None. #### Returns * `chainId` (string): Chain identifier (digest of the genesis checkpoint). * `chain` (string): Human-readable chain name (e.g., `"mainnet"`). * `epoch` (string): Current epoch of the node. * `checkpointHeight` (string): Height of the most recently executed checkpoint. * `timestamp` (string): Timestamp of the latest executed checkpoint (ISO-8601 format). * `lowestAvailableCheckpoint` (string): Lowest checkpoint height for which checkpoint and transaction data are available. * `lowestAvailableCheckpointObjects` (string): Lowest checkpoint height for which object data is available. * `server` (string): Software version string for this service. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{}' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.LedgerService.GetServiceInfo ``` #### Response example ```json { "chainId": "4btiuiMPvEENsttpZC7CZ53DruC3MAgfznDbASZ7DR6S", "chain": "mainnet", "epoch": "952", "checkpointHeight": "214248984", "timestamp": "2025-11-20T14:23:54.546Z", "lowestAvailableCheckpoint": "130842232", "lowestAvailableCheckpointObjects": "213684741", "server": "sui-node/1.60.1-49d95e90e36e" } ``` --- ### `GetTransaction` > Retrieves a single transaction by digest. #### Parameters * `digest` (string; required): Digest of the transaction to retrieve. * `read_mask` (object; optional): Field mask specifying which transaction fields to include in the response. * `paths` (array of strings; optional): Protobuf field names to include (for example: `digest`, `transaction`, `transaction.sender`, `transaction.kind`, `effects`, `effects.status`, `effects.changed_objects`, `events`, `balance_changes`, `checkpoint`, `timestamp`, `objects`). Some implementations accept `"*"` to return all available fields. #### Returns * `transaction` (object; optional): Executed transaction data if the lookup succeeds. * `digest` (string): Digest of the transaction. * `transaction` (object; optional): Transaction payload. * `sender` (string; optional): Address of the transaction sender. * `gasPayment` (object; optional): Gas payment configuration (gas objects, owner, price, budget). * `kind` (object; optional): Transaction kind (for example, programmable transaction, consensus commit prologue). * `signatures` (array; optional): User signatures authorizing the transaction. * `effects` (object; optional): Execution effects for this transaction. * `status` (object; optional): Execution status (for example, `success: true`). * `changedObjects` (array; optional): Objects created, mutated, or deleted by the transaction. * `gasUsed` (object; optional): Gas usage breakdown (computation, storage, rebate). * `transactionDigest` (string; optional): Digest of the executed transaction. * `dependencies` (array of strings; optional): Digests of dependency transactions. * `events` (object; optional): Events emitted during transaction execution, if any. * `balanceChanges` (array; optional): Per-address, per-coin-type balance updates caused by this transaction. * `checkpoint` (string; optional): Checkpoint sequence number containing this transaction. * `timestamp` (string; optional): Timestamp of the checkpoint that includes this transaction (ISO-8601 format). * `objects` (object; optional): Objects referenced as inputs or produced as outputs by this transaction. #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "digest": "hSwNywhBjUhHvSsZT5PhVFz5iZgMR24onKQKFSyubVu", "read_mask": { "paths": ["*"] } }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.LedgerService.GetTransaction ``` #### Response example ```json { "transaction": { "digest": "hSwNywhBjUhHvSsZT5PhVFz5iZgMR24onKQKFSyubVu", "effects": { "bcs": { "name": "TransactionEffects", "value": "AQC3AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIApcj2B2cnBzLKo2O9lBRpzwZh0U+NBGVIDtATtFaKEUAAABINZF/xw55sjHgk8nWetzMPXVfvvmQQQazN0LJEwBiOfMbq2iJQAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYBba2iJQAAAAAgA4c8QzpRZ3K7ARu5evaUjapDn2phY9m2brwDZ7zIfAwCAQAAAAAAAAABIF4Fipa86aBJjMYj9zfd72ecY9o6PfR0Z6iy8mAtZEAEAgEAAAAAAAAAAAAA" }, "digest": "75dAW4QrYV6Vt9ngQA4g14DDnmCCWF5BgE3dsgvtgzwy", "version": 2, "status": { "success": true }, "epoch": "951", "gasUsed": { "computationCost": "0", "storageCost": "0", "storageRebate": "0", "nonRefundableStorageFee": "0" }, "transactionDigest": "hSwNywhBjUhHvSsZT5PhVFz5iZgMR24onKQKFSyubVu", "dependencies": [ "FRS9rMUZ2ycrVYFdtS2wiWE12JMwuVWKSZy3wpFd5ifD" ], "lamportVersion": "631418222", "changedObjects": [ { "objectId": "0x0000000000000000000000000000000000000000000000000000000000000006", "inputState": "INPUT_OBJECT_STATE_EXISTS", "inputVersion": "631418221", "inputDigest": "EmpuZ8vHkphwFnaH6NuC3cPsK58aWtdmJWCUpFZosNK", "inputOwner": { "kind": "SHARED", "version": "1" }, "outputState": "OUTPUT_OBJECT_STATE_OBJECT_WRITE", "outputVersion": "631418222", "outputDigest": "7L2E1st8zEP7QTaEyKYurMYmMBR1NV5WmYcS3QEsC63d", "outputOwner": { "kind": "SHARED", "version": "1" }, "idOperation": "NONE", "objectType": "0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock" } ] } } } ``` --- **Move Package Service**: Exposes Move package metadata, allowing you to query on-chain modules and published Move code. --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sui/ title: Sui description: Sui API on Ankr Web3 platform: three transports (JSON-RPC, gRPC, GraphQL), public + Premium tiers. source: docs/rpc-service/chains/chains-api/sui/index.mdx --- # Sui
:::warning **JSON-RPC deprecation notice: migrate by 30 September 2026.** The Sui JSON-RPC interface is being retired network-wide during 2026, and the Sui Foundation asks every RPC provider, Ankr included, to have customers migrated **by the end of September 2026**. Migrate existing integrations to **gRPC** (for indexers and backend services) or **GraphQL** (for frontends and analytics). Because Ankr runs its own Sui full nodes, Ankr's JSON-RPC endpoints keep serving until JSON-RPC is removed from the Sui node software (**mid-October 2026**). Treat that as a hard ceiling rather than a migration buffer: historical and pruned-data queries may start returning incomplete results **from the end of September 2026**, and the final two weeks are reserved by the Sui Foundation for codebase removal. See the [JSON-RPC page](/rpc-service/chains/chains-api/sui/json-rpc) for the full timeline. ::: :::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Sui API is available on [Web3 API platform](https://www.ankr.com/rpc/sui). *Sui* is the first permissionless Layer 1 blockchain designed from the ground up to enable creators and developers to build experiences that cater to the next billion users in Web3. Sui is horizontally scalable to support a wide range of application development with unrivaled speed at low cost. Ankr provides multiple interfaces for interacting with Sui — JSON-RPC, gRPC, and GraphQL — across mainnet, testnet, and archival data. --- ## Endpoints | Interface | Network | Endpoint | Auth | |-----------|---------|----------|------| | JSON-RPC *(deprecated, migrate by 30 Sep 2026)* | Mainnet | `https://rpc.ankr.com/sui` | Token for Premium | | JSON-RPC *(deprecated, migrate by 30 Sep 2026)* | Testnet | `https://rpc.ankr.com/sui_testnet` | Token for Premium | | gRPC | Mainnet | `sui.grpc.ankr.com:443` | `x-token` header for Premium | | gRPC | Testnet | `sui-testnet.grpc.ankr.com:443` | `x-token` header for Premium | | gRPC Archive | Mainnet | `archive.sui.grpc.ankr.com:443` | `x-token` header for Premium | | GraphQL | Mainnet | `https://rpc.ankr.com/http/sui_graphql` | Token for Premium | For Premium endpoints, append your token to the URL (for HTTP-based APIs) or pass it via the `x-token` header (for gRPC). --- ## Regions Sui gRPC services are deployed across multiple regions for low-latency access. Requests are routed to the closest healthy region automatically. | Service | High-level coverage | |---------|---------------------| | Mainnet gRPC | EU, Americas, APAC | | Mainnet Archive gRPC | EU, Americas, APAC | | Testnet gRPC | EU, Americas, APAC | See the [gRPC page](/rpc-service/chains/chains-api/sui/grpc#regions) for the full list of cities per service. --- ## Interfaces ### JSON-RPC *(deprecated)* :::warning **Migrate by 30 September 2026.** Sunset on Ankr's nodes follows the removal of JSON-RPC from the Sui full-node software in **mid-October 2026**, but the Sui Foundation's archival fallback disconnects at the end of September and the final two weeks are reserved for codebase removal. Sui Foundation public-good endpoints were turned off earlier, in July 2026. Migrate existing integrations to gRPC or GraphQL. ::: The standard [JSON-RPC 2.0](https://www.jsonrpc.org/specification) interface for reading blockchain data and sending transactions. Historically the most common entry point for Sui dApps; superseded by gRPC and GraphQL going forward. [View JSON-RPC methods →](/rpc-service/chains/chains-api/sui/json-rpc) ### gRPC A high-performance interface using [Protocol Buffers](https://protobuf.dev/overview/) for fast, type-safe, and bandwidth-efficient communication. gRPC supports server-side streaming for real-time data delivery and automatic client generation in TypeScript, Go, Rust, and more. Ideal for indexers, explorers, and backend systems. [View gRPC methods →](/rpc-service/chains/chains-api/sui/grpc) ### GraphQL A flexible query language that lets you request exactly the data you need in a single call. Sui's GraphQL RPC provides composable queries for on-chain state — objects, transactions, balances, checkpoints — without overfetching. It supports pagination, filtering, and nested lookups. [View GraphQL documentation →](/rpc-service/chains/chains-api/sui/graphql) --- ## gRPC Archive The gRPC Archive endpoint (`archive.sui.grpc.ankr.com:443`) provides access to historical Sui network data that standard full nodes may have pruned. It exposes the same `LedgerService` gRPC API as the standard gRPC endpoint, so you can use the same client code and methods. Use the Archive endpoint when you need to query older transactions, checkpoints, or objects that are no longer available on current full nodes. A common pattern is to first query the standard endpoint and fall back to the Archive endpoint if the data is not found. --- ## Getting started 1. **Get your API token** — Sign up at [ankr.com/rpc](https://www.ankr.com/rpc/sui) to get a Premium token, or use the public endpoints without authentication. 2. **Choose your interface** — Pick gRPC or GraphQL based on your use case (JSON-RPC is deprecated; see notice above). 3. **Connect** — Use the endpoints from the table above with your preferred client library or tool. Official Sui links: [Website](https://sui.io/), [Docs](https://docs.sui.io/), [GitHub](https://github.com/MystenLabs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sui/json-rpc-p2/ title: Sui JSON-RPC *(deprecated)* (2/5) description: Sui JSON-RPC API on Ankr: full method coverage, public and Premium endpoints, multi-region routing. source: docs/rpc-service/chains/chains-api/sui/json-rpc-p2.mdx --- # Sui JSON-RPC *(deprecated)* (2/5) > API reference for [Sui](/rpc-service/chains/chains-api/sui/). [All methods ->](/rpc-service/chains/chains-api/sui/) > > Part 2 of 5: [1](/rpc-service/chains/chains-api/sui/json-rpc/) · 2 · [3](/rpc-service/chains/chains-api/sui/json-rpc-p3/) · [4](/rpc-service/chains/chains-api/sui/json-rpc-p4/) · [5](/rpc-service/chains/chains-api/sui/json-rpc-p5/) ## Methods supported ### `sui_getEvents` > Retrieves transaction events. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string): the event query criteria. #### Returns * `Vec`: a Sui event. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getEvents", "params": [ "11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "data": [ { "id": { "txDigest": "11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX", "eventSeq": "0" }, "packageId": "0xc54ab30a3d9adc07c1429c4d6bbecaf9457c9af77a91f631760853934d383634", "transactionModule": "test_module", "sender": "0xbcf7c32655009a61f1de0eae420a2e4ae1bb772ab2dd5d5a7dfa949c0ef06908", "type": "0x0000000000000000000000000000000000000000000000000000000000000009::test::TestEvent", "parsedJson": { "test": "example value" }, "bcs": "" } ], "nextCursor": { "txDigest": "11a72GCQ5hGNpWGh2QhQkkusTEGS6EDqifJqxr7nSYX", "eventSeq": "5" }, "hasNextPage": false } } ``` --- ### `sui_getLatestCheckpointSequenceNumber` > Retrieves the sequence number of the latest checkpoint that has been executed. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * `BigInt`: the sequence number for the latest checkpoint. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getLatestCheckpointSequenceNumber", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "507021" } ``` --- ### `sui_getLoadedChildObjects` > Retrieves loaded child objects. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: transaction digest. #### Returns * ``: loaded child objects associated with the transaction the request provides. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getLoadedChildObjects", "params": [ "6hpz6Qxv6t5VkNT5rcBKQS2Jootr6WHuSuRMLmmN13Jg" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "loadedChildObjects": [ { "objectId": "0xb6a23efeb7298cf0a8d0b837b78749c2cfc711c42036cc6b76211639f3606a53", "sequenceNumber": "2462820" }, { "objectId": "0xf61f3a566963b3eac49fe3bb57d304a454ed2f4859b44f4e49180047d5fa0a82", "sequenceNumber": "2462820" }, { "objectId": "0xd55c32b09995a0ae1eedfee9c7b1354e805ed10ee3d0800105867da4655eca6d", "sequenceNumber": "2164186" }, { "objectId": "0x258bfd1ad92af329a07781ee71e60065e00f2de961630d3505f8905a0f4d42c6", "sequenceNumber": "3350147" }, { "objectId": "0xa78a6ba2b28f68a3299ec3417bbabc6717dcc95b9e341bc3aba1654bdbad707d", "sequenceNumber": "3560717" }, { "objectId": "0xcd773bd6309363447ef3fe58a960de92aa9377b3482580ee8d5bdc5b824808df", "sequenceNumber": "3560717" } ] } } ``` --- ### `sui_getMoveFunctionArgTypes` > Retrieves the argument types of a Move function, based on normalized Type. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: an object ID. * `` (string) * `function` (string) #### Returns * `Vec`: the argument types for the package and function the request provides. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getMoveFunctionArgTypes", "params": [ "0x007efb0f94f1e64d2e8090c619a39299d87ee8070b5f56bb10bafa0e2261d819", "suifrens", "mint" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "Object": "ByMutableReference" }, "Pure", "Pure", { "Object": "ByValue" }, { "Object": "ByImmutableReference" }, { "Object": "ByValue" }, { "Object": "ByMutableReference" } ] } ``` --- ### `sui_getNormalizedMoveFunction` > Retrieves a structured representation of Move function. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: an object ID. * `` (string) * `function_name` (string) #### Returns * `SuiMoveNormalizedFunction`: * `isEntry` * `parameters`: Sui Move normalized type. * `return` : Sui Move normalized type. * `typeParameters` : Sui Move ability set. * `visibility` : Sui Move visibility. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getNormalizedMoveFunction", "params": [ "0xb2582f82ab308bf9c96dfb22ec7345db1b5f14fdb2b9538efb160d31842e3a17", "moduleName", "functionName" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "visibility": "Public", "isEntry": false, "typeParameters": [ { "abilities": [ "Store", "Key" ] } ], "parameters": [ "U64" ], "return": [ "U64" ] } } ``` --- ### `sui_getNormalizedMoveModule` > Retrieves a structured representation of Move module. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: an object ID. * `` (string) #### Returns * `SuiMoveNormalizedModule`: * `address` * `exposedFunctions` * `fileFormatVersion` * `friends`: Sui Move module ID. * `name` * `structs` #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getNormalizedMoveModule", "params": [ "0x16dc6797cf787c839a07edc03e633842109123618df6438d21a48040e6bb568c", "module" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "fileFormatVersion": 6, "address": "0x43cc4c24010dafad05b12619b275649741cc9060d87664c26a3f9a509228c21b", "name": "module", "friends": [], "structs": {}, "exposedFunctions": {} } } ``` --- ### `sui_getNormalizedMoveModulesByPackage` > Retrieves structured representations of all modules in the given package. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: an object ID. #### Returns * `BTreeMap`: structured representations of all the modules for the package in the request. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getNormalizedMoveModulesByPackage", "params": [ "0xece356d10d89e75f565b0934851ba8d5bc59462a46078b90f1f508a1e4fd4eed" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "fileFormatVersion": 6, "address": "0xafc13246bd847c60448160e0358cac4a11345594d02890c986dbf328d28d21ac", "name": "module", "friends": [], "structs": {}, "exposedFunctions": {} } } ``` --- ### `sui_getNormalizedMoveStruct` > Retrieves a structured representation of Move struct. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: an object ID. * `` (string): a module name. * `` (string): a struct name. #### Returns * `abilities`: Sui Move ability set. * `fields`: Sui Move normalized field. * `typeParameters`: Sui Move struct type parameter #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getNormalizedMoveStruct", "params": [ "0x46c25c211cb35c05d801c769b78770474957b37379c527753c5c8ab783f697e7", "module", "StructName" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "abilities": { "abilities": [ "Store", "Key" ] }, "typeParameters": [], "fields": [] } } ``` --- ### `sui_getObject` > Retrieves the object information for a specified object. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the ID of the queried object. * `` (array of boolean): specifies the object info to show. #### Returns * ``: object data. * ``: object response error. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getObject", "params": [ "0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809", { "showType": true, "showOwner": true, "showPreviousTransaction": true, "showDisplay": false, "showContent": true, "showBcs": false, "showStorageRebate": true } ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "data": { "objectId": "0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809", "version": "1", "digest": "33K5ZXJ3RyubvYaHuEnQ1QXmmbhgtrFwp199dnEbL4n7", "type": "0x2::coin::Coin<0x2::sui::SUI>", "owner": { "AddressOwner": "0xc8ec1d5b84dd6289e193b9f88de4a994358c9f856135236c3e75a925e1c77ac3" }, "previousTransaction": "5PLgmQye6rraDYqpV3npV6H1cUXoJZgJh1dPCyRa3WCv", "storageRebate": "100", "content": { "dataType": "moveObject", "type": "0x2::coin::Coin<0x2::sui::SUI>", "hasPublicTransfer": true, "fields": { "balance": "100000000", "id": { "id": "0x53e4567ccafa5f36ce84c80aa8bc9be64e0d5ae796884274aef3005ae6733809" } } } } } } ``` --- ### `sui_getProtocolConfig` > Retrieves the protocol config table for the given version number. If the version number is not specified, If none is specified, the node uses the version of the latest epoch it has processed. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (BigInt_for_uint64; optional): protocol version specifier. If omitted, the latest protocol config table for the node will be returned. #### Returns * `ProtocolConfigResponse`: the protocol config for the given protocol version. If none is specified, the node uses the version of the latest epoch it has processed. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getProtocolConfig", "params": [ 6 ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "minSupportedProtocolVersion": "1", "maxSupportedProtocolVersion": "12", "protocolVersion": "6", "featureFlags": { "advance_epoch_start_time_in_safe_mode": true, "advance_to_highest_supported_protocol_version": false, "ban_entry_init": false, "commit_root_state_digest": false, "consensus_order_end_of_epoch_last": true, "disable_invariant_violation_check_in_swap_loc": false, "disallow_adding_abilities_on_upgrade": false, "disallow_change_struct_type_params_on_upgrade": false, "loaded_child_objects_fixed": true, "missing_type_is_compatibility_error": true, "no_extraneous_module_bytes": false, "package_digest_hash_module": false, "package_upgrades": true, "scoring_decision_with_validity_cutoff": true }, "attributes": { } } } ``` --- ### `sui_getTotalTransactionBlocks` > Retrieves the total number of transactions known to the server. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * `BigInt`: total number of transactions on the network. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getTotalTransactionBlocks", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "2451485" } ``` --- ### `sui_getTransactionBlock` > Retrieves the transaction response object. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the digest of the queried transaction. * ``: options for specifying the content to be returned. #### Returns * ``: the transaction response object for specified transaction digest. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getTransactionBlock", "params": [ "oKtFZjL99EZ2K3TLPRarpZN8gz9xReMkiNf4Tjja2no", { "showInput": true, "showRawInput": false, "showEffects": true, "showEvents": true, "showObjectChanges": false, "showBalanceChanges": false } ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "digest": "oKtFZjL99EZ2K3TLPRarpZN8gz9xReMkiNf4Tjja2no", "transaction": { "data": { "messageVersion": "v1", "transaction": { "kind": "ProgrammableTransaction", "inputs": [ { "type": "pure", "valueType": "address", "value": "0x8196d048b7a6d04c8edc89579d86fd3fc90c52f9a14c6b812b94fe613c5bcebb" }, { "type": "object", "objectType": "immOrOwnedObject", "objectId": "0x5eeb1d449e2516166d57d71fdeb154d0dc9ecdb7b30057d0a932684cac352cdc", "version": "2", "digest": "GK4NxEKSrK88XkPNeuBqtJYPmU9yMTWMD7K9TdU4ybKN" } ], "transactions": [ { "TransferObjects": [ [ { "Input": 1 } ], { "Input": 0 } ] } ] }, "sender": "0x82179c57d5895babfb655cd62e8e886a53334b5e7be9be658eb759cc35e3fc66", "gasData": { "payment": [ { "objectId": "0x1a3e898029d024eec1d44c6af5e2facded84d03b5373514f16e3d66e00081051", "version": 2, "digest": "7nDZ5J4VyvYGUbX2f6mQdhkr3RFrb3vZqui1ogoyApD9" } ], "owner": "0x82179c57d5895babfb655cd62e8e886a53334b5e7be9be658eb759cc35e3fc66", "price": "10", "budget": "20000000" } }, "txSignatures": [ "ABTTP4JUSxqOQTlysdS30HzkMc3DOwJqlBJstqn2EwW0SKtvoGIoxFEbmTqIS+UYSemveVGJ+S6BijQQVS97cwxtCxWrqsEEHAdxoMDwblU5hyWJ8H3zFvk20E2fO5bzHA==" ] }, "rawTransaction": "AQAAAAAAAgAggZbQSLem0EyO3IlXnYb9P8kMUvmhTGuBK5T+YTxbzrsBAF7rHUSeJRYWbVfXH96xVNDcns23swBX0KkyaEysNSzcAgAAAAAAAAAg43+UGkUe+CCaD7+/G1SbK7Jrjq7giJUUbfJ7w88mEMEBAQEBAQABAACCF5xX1Ylbq/tlXNYujohqUzNLXnvpvmWOt1nMNeP8ZgEaPomAKdAk7sHUTGr14vrN7YTQO1NzUU8W49ZuAAgQUQIAAAAAAAAAIGS7c6HtWLLBiwy/N3eS4gbmuA1NXupk4ucFY7FYkCbEghecV9WJW6v7ZVzWLo6IalMzS1576b5ljrdZzDXj/GYKAAAAAAAAAAAtMQEAAAAAAAFhABTTP4JUSxqOQTlysdS30HzkMc3DOwJqlBJstqn2EwW0SKtvoGIoxFEbmTqIS+UYSemveVGJ+S6BijQQVS97cwxtCxWrqsEEHAdxoMDwblU5hyWJ8H3zFvk20E2fO5bzHA==", "effects": { "messageVersion": "v1", "status": { "status": "success" }, "executedEpoch": "0", "gasUsed": { "computationCost": "100", "storageCost": "100", "storageRebate": "10", "nonRefundableStorageFee": "0" }, "transactionDigest": "6AyFnAuKAKCqm1cD94EyGzBqJCDDJ716ojjmsKF2rqoi", "mutated": [ { "owner": { "AddressOwner": "0x82179c57d5895babfb655cd62e8e886a53334b5e7be9be658eb759cc35e3fc66" }, "reference": { "objectId": "0x1a3e898029d024eec1d44c6af5e2facded84d03b5373514f16e3d66e00081051", "version": 2, "digest": "7nDZ5J4VyvYGUbX2f6mQdhkr3RFrb3vZqui1ogoyApD9" } }, { "owner": { "AddressOwner": "0x8196d048b7a6d04c8edc89579d86fd3fc90c52f9a14c6b812b94fe613c5bcebb" }, "reference": { "objectId": "0x5eeb1d449e2516166d57d71fdeb154d0dc9ecdb7b30057d0a932684cac352cdc", "version": 2, "digest": "GK4NxEKSrK88XkPNeuBqtJYPmU9yMTWMD7K9TdU4ybKN" } } ], "gasObject": { "owner": { "ObjectOwner": "0x82179c57d5895babfb655cd62e8e886a53334b5e7be9be658eb759cc35e3fc66" }, "reference": { "objectId": "0x1a3e898029d024eec1d44c6af5e2facded84d03b5373514f16e3d66e00081051", "version": 2, "digest": "7nDZ5J4VyvYGUbX2f6mQdhkr3RFrb3vZqui1ogoyApD9" } }, "eventsDigest": "9BQobwxQvJ1JxSXNn8v8htZPTu8FEzJJGgcD4kgLUuMd" }, "objectChanges": [ { "type": "transferred", "sender": "0x82179c57d5895babfb655cd62e8e886a53334b5e7be9be658eb759cc35e3fc66", "recipient": { "AddressOwner": "0x8196d048b7a6d04c8edc89579d86fd3fc90c52f9a14c6b812b94fe613c5bcebb" }, "objectType": "0x2::example::Object", "objectId": "0x5eeb1d449e2516166d57d71fdeb154d0dc9ecdb7b30057d0a932684cac352cdc", "version": "2", "digest": "64UQ3a7m1mjWuzgyGoH8RnMyPGDN4XYTC9dS4qiSfdK4" } ] } } ``` --- ### `sui_multiGetObjects` > Retrieves the object data for a list of objects. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the IDs of the queried objects. * ``: options for specifying the content to be returned. #### Returns * `Vec`: Sui object response. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_multiGetObjects", "params": [ [ "0xb61439368cd75ebe63d633af32ffb4a022d18b95b4eaa9fd3b22b43f6b2c8e92", "0x6ea7bed8f6c3d80f2a595c2305e12dd6d07c3fbbd3ebef7dbcc7b02346cdf056", "0x75da5e934f672d3da3e003d989075efaecc79b5cd5df0df2a168259b7115a41c", "0x38554a9ff7b4f6b59f9426c321c8013afed093481dd4ef1267c67a8e9a0d074f", "0xe74d1b250d5df2cb5170782a8a438fbf681eded4d1e0a2cd7dfb27e784493fb1" ], { "showType": true, "showOwner": true, "showPreviousTransaction": true, "showDisplay": false, "showContent": true, "showBcs": false, "showStorageRebate": true } ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "data": { "objectId": "0xb61439368cd75ebe63d633af32ffb4a022d18b95b4eaa9fd3b22b43f6b2c8e92", "version": "1", "digest": "6D2MGzZN1DnALrbg6y9nQWwuipCa6fJERLXAwNGuGtKQ", "type": "0x2::coin::Coin<0x2::sui::SUI>", "owner": { "AddressOwner": "0x090bd6d16522a6fd4fa83ec70a5f197ad656da104dde1de9880be827a1a753e5" }, "previousTransaction": "CQN1aMpZRYrVHByFfPFceCXzv5kT7bNM4Uzoe2jbZvM", "storageRebate": "100", "content": { "dataType": "moveObject", "type": "0x2::coin::Coin<0x2::sui::SUI>", "hasPublicTransfer": true, "fields": { "balance": "100000000", "id": { "id": "0xb61439368cd75ebe63d633af32ffb4a022d18b95b4eaa9fd3b22b43f6b2c8e92" } } } } } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sui/json-rpc-p3/ title: Sui JSON-RPC *(deprecated)* (3/5) description: Sui JSON-RPC API on Ankr: full method coverage, public and Premium endpoints, multi-region routing. source: docs/rpc-service/chains/chains-api/sui/json-rpc-p3.mdx --- # Sui JSON-RPC *(deprecated)* (3/5) > API reference for [Sui](/rpc-service/chains/chains-api/sui/). [All methods ->](/rpc-service/chains/chains-api/sui/) > > Part 3 of 5: [1](/rpc-service/chains/chains-api/sui/json-rpc/) · [2](/rpc-service/chains/chains-api/sui/json-rpc-p2/) · 3 · [4](/rpc-service/chains/chains-api/sui/json-rpc-p4/) · [5](/rpc-service/chains/chains-api/sui/json-rpc-p5/) ## Methods supported ### `sui_multiGetTransactionBlocks` > Retrieves an ordered list of transaction responses. The method will throw an error if the input contains any duplicate or the input size exceeds `QUERY_MAX_RESULT_LIMIT`. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: a list of transaction digests. * ``: config options to control which fields to fetch. #### Returns * `Vec`: the transaction data for specified digest. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_multiGetTransactionBlocks", "params": [ [ "Gd2vRA1pRwWu8j7KQe6fzHS4mMChq1JHJpi9KGnVJMtV", "73FjSYzymaz1UWPu4bMW191cyxSxziKXJm2MyTQMjeur", "7TxdfBqwTPYgG4hztwiQdeQcdWgeqpZKF7EJpyjDojFd" ], { "showInput": true, "showRawInput": false, "showEffects": true, "showEvents": true, "showObjectChanges": false, "showBalanceChanges": false } ] }' ``` --- ### `sui_tryGetPastObject` > Retrieves the object information for a specified version. There is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. The result may vary across nodes depending on their pruning policies. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: a list of transaction digests. * `` (sequence number): the version of the queried object. If None, default to the latest known version. * ``: options for specifying the content to be returned. #### Returns * `SuiPastObjectResponse`: past object data. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_tryGetPastObject", "params": [ "0x11af4b844ff94b3fbef6e36b518da3ad4c5856fa686464524a876b463d129760", 4, { "showType": true, "showOwner": true, "showPreviousTransaction": true, "showDisplay": false, "showContent": true, "showBcs": false, "showStorageRebate": true } ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "status": "VersionFound", "details": { "objectId": "0x11af4b844ff94b3fbef6e36b518da3ad4c5856fa686464524a876b463d129760", "version": "4", "digest": "5VPAwDXy3BL72ehFc7gSJoz27ahMd6spUg5YwYc4ibcv", "type": "0x2::coin::Coin<0x2::sui::SUI>", "owner": { "AddressOwner": "0x3568c40e814d9d5396d23087a0fd641e91e0e00df6c012cded9ef9ba5e5bf042" }, "previousTransaction": "5jQByoouHBwaico5pQB73GdbzerC2StjTiHh5garBjiV", "storageRebate": "100", "content": { "dataType": "moveObject", "type": "0x2::coin::Coin<0x2::sui::SUI>", "hasPublicTransfer": true, "fields": { "balance": "10000", "id": { "id": "0x11af4b844ff94b3fbef6e36b518da3ad4c5856fa686464524a876b463d129760" } } } } } } ``` --- ### `sui_tryMultiGetPastObjects` > Retrieves the object information for a specified version. There is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. The result may vary across nodes depending on their pruning policies. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: a vector of object and versions to be queried. * ``: options for specifying the content to be returned. #### Returns * `SuiPastObjectResponse`: past object data. --- ### `suix_getAllBalances` > Retrieves the total coin balance for all coin types owned by the address owner. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the owner's Sui address. #### Returns * `Vec`: all balances for the address in the request. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getAllBalances", "params": [ "0x94f1a597b4e8f709a396f7f6b1482bdcd65a673d111e49286c527fab7c2d0961" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "coinType": "0x2::sui::SUI", "coinObjectCount": 15, "totalBalance": "3000000000", "lockedBalance": {} } ] } ``` --- ### `suix_getAllCoins` > Retrieves all Coin objects owned by an address. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the owner's Sui address. * `cursor` (optional): a page cursor. * `limit` (uint): max number of items per page. #### Returns * `CoinPage`: all coins for the address in the request body. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getAllCoins", "params": [ "0x41f5975e3c6bd5c95f041a8493ad7e9934be26e69152d2c2e86d8a9bdbd242b3", "0x2564cd31a71cf9833609b111436d8f0f47b7f8b9927ec3f8975a1dcbf9b25564", 3 ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "data": [ { "coinType": "0x2::sui::SUI", "coinObjectId": "0x91825debff541cf4e08b5c5f7296ff9840e6f0b185af93984cde8cf3870302c0", "version": "103626", "digest": "7dp5WtTmtGp83EXYYFMzjBJRFeSgR67AzqMETLrfgeFx", "balance": "200000000", "previousTransaction": "9WfFUVhjbbh4tWkyUse1QxzbKX952cyXScH7xJNPB2vQ" }, { "coinType": "0x2::sui::SUI", "coinObjectId": "0x48a53f22e2e901ea2a5bf44fdd5bb94a1d83b6efc4dd779f0890ca3b1f6ba997", "version": "103626", "digest": "9xLdMXezY8d1yRA2TtN6pYjapyy2EVKHWNriGPFGCFvd", "balance": "200000000", "previousTransaction": "Byq9SyV7x6fvzaf88YRA9JM8vLbVLJAqUX8pESDmKcgw" }, { "coinType": "0x2::sui::SUI", "coinObjectId": "0x6867fcc63161269c5c0c73b02229486bbaff319209dfb8299ced3b8609037997", "version": "103626", "digest": "5xexWFq6QpGHBQyC9P2cbAJXq9qm2EjzfuRM9NwS1uyG", "balance": "200000000", "previousTransaction": "CEjwHmo98nAiYhSMfKoSDvUMtfKJ6ge6Uj4wKotK4MPZ" } ], "nextCursor": "0x861c5e055605b2bb1199faf653a8771e448930bc95a0369fad43a9870a2e5878", "hasNextPage": true } } ``` --- ### `suix_getBalance` > Retrieves the total coin balance for one coin type owned by the address owner. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the owner's Sui address. * `` (string, optional): type names for the coin (example `0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC`), defaults to `0x2::sui::SUI` if not specified. #### Returns * `coinObjectCount` * `coinType` * `lockedBalance` * `totalBalance` #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getBalance", "params": [ "0x51ceab2edc89f74730e683ebee65578cb3bc9237ba6fca019438a9737cf156ae", "0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "coinType": "0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC", "coinObjectCount": 15, "totalBalance": "15", "lockedBalance": {} } } ``` --- ### `suix_getCoinMetadata` > Retrieves metadata (as symbol or decimals) for a coin. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string): type names for the coin (example `0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC`). #### Returns * `decimals`: the number of decimal places the coin uses. * `description`: token description. * `iconUrl`: URL for the token logo. * `id`: an object ID for the CoinMetadata object. * `name`: a token name. * `symbol`: a token symbol. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "result": { "id": { "id": "0x6d907beaa3a49db57bdfdb3557e6d405cbf01c293a53e01457d65e92b5d8dd68" }, "decimals": 9, "name": "Usdc", "symbol": "USDC", "description": "Stable coin.", "icon_url": null } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "id": { "id": "0x6d907beaa3a49db57bdfdb3557e6d405cbf01c293a53e01457d65e92b5d8dd68" }, "decimals": 9, "name": "Usdc", "symbol": "USDC", "description": "Stable coin.", "icon_url": null } } ``` --- ### `suix_getCoins` > Retrieves all coin type objects owned by an address. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the owner's Sui address. * `` (string): type names for the coin (example `0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC`), defaults to `0x2::sui::SUI` if not specified. * `` (optional): a page cursor. * `` (uint): max number of items per page. #### Returns * `CoinPage`: all SUI coins owned by the address provided. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getCoins", "params": [ "0xd62ca040aba24f862a763851c54908cd2a0ee7d709c11b93d4a2083747b76856", "0x2::sui::SUI", "0xe5c651321915b06c81838c2e370109b554a448a78d3a56220f798398dde66eab", 3 ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "data": [ { "coinType": "0x2::sui::SUI", "coinObjectId": "0xa5a8e30db5a798a7354340b6ea78a66f50921841ab5359ec7a3dc01f282420ae", "version": "103626", "digest": "tw5DzJTfdxTn4f3rekFrhN7dQTUezBgsEhycDobTBLb", "balance": "200000000", "previousTransaction": "HSein75AFXgdsnbABWLQ5mvjFmPFWrBFi9CMVsNn7gJr" }, { "coinType": "0x2::sui::SUI", "coinObjectId": "0x47dfa99496428c65b2054ad7db1872b87ff05b1047bb5e3adf5257cceb08ecb4", "version": "103626", "digest": "AfgFe7ZfjJ5dWV6VAy2LbtvBFhcABkvdvwEjLrRcFqtr", "balance": "200000000", "previousTransaction": "5WHnm9jUZEtDvSvsj7HBrP5BoxA3UY6R57qqumXJXboV" }, { "coinType": "0x2::sui::SUI", "coinObjectId": "0xd4f062dbcfc3bf73f5861945592222ff7b090ac21c8a3cf840abdc5b743da778", "version": "103626", "digest": "9er6jxigfuQEKsn9gtPV2oW1zGQRcFtKNijHVe88GUJD", "balance": "200000000", "previousTransaction": "H3gwoKE2FSLx3BwvNTTKqCsNHmg6ARzm345icHhXUAEW" } ], "nextCursor": "0xd4f062dbcfc3bf73f5861945592222ff7b090ac21c8a3cf840abdc5b743da778", "hasNextPage": true } } ``` --- ### `suix_getCommitteeInfo` > Retrieves the committee information for the epoch specified. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (BigInt_for_uint64): the epoch of interest. If None, default to the latest epoch. #### Returns * `SuiCommittee`: committee information. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getCommitteeInfo", "params": [ "5000" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "epoch": "5000", "validators": [ [ "jc/20VUECmVvSBmxMRG1LFdGqGunLzlfuv4uw4R9HoFA5iSnUf32tfIFC8cgXPnTAATJCwx0Cv/TJs5nPMKyOi0k1T4q/rKG38Zo/UBgCJ1tKxe3md02+Q0zLlSnozjU", "2500" ], [ "mfJe9h+AMrkUY2RgmCxcxvE07x3a52ZX8sv+wev8jQlzdAgN9vzw3Li8Sw2OCvXYDrv/K0xZn1T0LWMS38MUJ2B4wcw0fru+xRmL4lhRPzhrkw0CwnSagD4jMJVevRoQ", "2500" ], [ "rd7vlNiYyI5A297/kcXxBfnPLHR/tvK8N+wD1ske2y4aV4z1RL6LCTHiXyQ9WbDDDZihbOO6HWzx1/UEJpkusK2zE0sFW+gUDS218l+wDYP45CIr8B/WrJOh/0152ljy", "2500" ], [ "s/1e+1yHJAOkrRPxGZUTYG0jNUqEUkmuoVdWTCP/PBXGyeZSty10DoysuTy8wGhrDsDMDBx2C/tCtDZRn8WoBUt2UzqXqfI5h9CX75ax8lJrsgc/oQp3GZQXcjR+8nT0", "2500" ] ] } } ``` --- ### `suix_getDynamicFieldObject` > Retrieves the dynamic field object information for a specified object. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the ID of the queried parent object. * ``: the name of the dynamic field. #### Returns * `data`: object data. * `error`: object response error. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getDynamicFieldObject", "params": [ "0xc8359b6b5e3bfeab524e5edaad3a204b4053745b2d45d1f00cd8d24e5b697607", { "type": "0x0000000000000000000000000000000000000000000000000000000000000009::test::TestField", "value": "some_value" } ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "data": { "objectId": "0xc8359b6b5e3bfeab524e5edaad3a204b4053745b2d45d1f00cd8d24e5b697607", "version": "1", "digest": "2VivvkBoFVwEg8oXq3tK9r3d3ybvMACtk9QwpFnkM6v2", "type": "0x0000000000000000000000000000000000000000000000000000000000000009::test::TestField", "owner": { "AddressOwner": "0xc055d5c23e2f6c69e6aacf5b4664b570cb20d4feace07fc863a2eef286c3e95e" }, "previousTransaction": "FJjAr8fdpuQvVZgd9VswXxz9jZcFGEAgKgdi8d6zXE3S", "storageRebate": "100", "content": { "dataType": "moveObject", "type": "0x0000000000000000000000000000000000000000000000000000000000000009::test::TestField", "hasPublicTransfer": true, "fields": {} } } } } ``` --- ### `suix_getDynamicFields` > Retrieves the list of dynamic field objects owned by an object. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string, hex): the ID of the parent object. * `` (optional): a page cursor. If provided, the query will start from the next item after the specified cursor. Defaults to start from the first item if not specified. * `` (uint): max items returned per page; defaults to `[QUERY_MAX_RESULT_LIMIT]` if not specified. #### Returns * `DynamicFieldPage`: dynamic fields for the object the request provides. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getDynamicFields", "params": [ "0xe15bb8de6dadd21835dfe44f4973139c15f93ddea0f8c3da994d9ead562ce76e", "0xa9334aeacc435c70ab9635e47a277d8f8dd9d87765d1aadec2db8cc24c312542", 3 ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "data": [ { "name": { "type": "0x0000000000000000000000000000000000000000000000000000000000000009::test::TestField", "value": "some_value" }, "bcsName": "2F1KQ3miNpBx1RzoRr1MVYMraK7RV", "type": "DynamicField", "objectType": "test", "objectId": "0x36fdef6a382da344930c73d1298b0e9644b85ea6f7a348f4a7bd1a9ab069eb7f", "version": 1, "digest": "7hWCQjKfZf7oNLpSrhFJZEmYnpmSPzVLwJfFuHmMD9ct" }, { "name": { "type": "0x0000000000000000000000000000000000000000000000000000000000000009::test::TestField", "value": "some_value" }, "bcsName": "2F1KQ3miNpBx1RzoRr1MVYMraK7RV", "type": "DynamicField", "objectType": "test", "objectId": "0xfe41671856fd3450dc5574abd53c793c9f22d8a72d5550df8d2d64a9155d126c", "version": 1, "digest": "CxuC9uMcWLk8oMg7QGaJSqUE4hwP6cMUQ94ipiN53jr3" }, { "name": { "type": "0x0000000000000000000000000000000000000000000000000000000000000009::test::TestField", "value": "some_value" }, "bcsName": "2F1KQ3miNpBx1RzoRr1MVYMraK7RV", "type": "DynamicField", "objectType": "test", "objectId": "0x1edb2df5ea5d55c96a611371d22799d268270cd4bb4d4f520fe9bbf0cf1cebe3", "version": 1, "digest": "HJxTwLy4oE1Aoy3PocGfL9oHystQiyssHfmyE8YaPrw4" } ], "nextCursor": "0x8a25d8876ea3c60e345ac3861444136b4a1b0b37a91692359a98496738a58c17", "hasNextPage": true } } ``` --- ### `suix_getLatestSuiSystemState` > Retrieves the latest SUI system state object on-chain. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * `activeValidators`: the list of active validators in the current epoch. * `atRiskValidators`: the map storing the number of epochs for which each validator has been below the low stake threshold. * `epoch`: the current epoch ID, starting from 0. * `epochDurationMs`: the duration of an epoch, in milliseconds. * `epochStartTimestampMs`: the Unix timestamp of the current epoch start. * `inactivePoolsId`: the ID of the object that maps from a staking pool ID to the inactive validator that has that pool as its staking pool. * `inactivePoolsSize`: the of inactive staking pools. * `maxValidatorCount`: the max number of active validators at any moment. We do not allow the number of validators in any epoch to go above this. * `minValidatorJoiningStake`: the lower bound on the amount of stake required to become a validator. * `pendingActiveValidatorsId`: the ID of the object that contains the list of new validators that will join at the end of the epoch. * `pendingActiveValidatorsSize`: the number of new validators that will join at the end of the epoch. * `pendingRemovals`: the removal of requests from the validators. Each element is an index pointing to `active_validators`. * `protocolVersion`: the current protocol version, starting from 1. * `referenceGasPrice`: the reference gas price for the current epoch. * `safeMode`: whether the system is running in a downgraded safe mode due to a non-recoverable bug. This is set whenever we failed to execute `advance_epoch`, and ended up executing advance_epoch_safe_mode. It can be reset once we are able to successfully execute `advance_epoch`. * `safeModeComputationRewards`: the amount of computation rewards accumulated (and not yet distributed) during safe mode. * `safeModeNonRefundableStorageFee`: the amount of non-refundable storage fee accumulated during safe mode. * `safeModeStorageRebates`: the amount of storage rebates accumulated (and not yet burned) during safe mode. * `safeModeStorageRewards`: the amount of storage rewards accumulated (and not yet distributed) during safe mode. * `stakeSubsidyBalance`: the balance of SUI set aside for stake subsidies that will be drawn down over time. * `stakeSubsidyCurrentDistributionAmount`: the amount of stake subsidy to be drawn down per epoch. This amount decays and decreases over time. * `stakeSubsidyDecreaseRate`: the rate at which the distribution amount decays at the end of each period. Expressed in basis points. * `stakeSubsidyDistributionCounter`: this counter may be different from the current epoch number if in some epochs it is decided to skip the subsidy. * `stakeSubsidyPeriodLength`: the number of distributions to occur before the distribution amount decays. * `stakeSubsidyStartEpoch`: the starting epoch in which stake subsidies start being paid out. * `stakingPoolMappingsId`: the ID of the object that maps from staking pool's ID to the sui address of a validator. * `stakingPoolMappingsSize`: the number of staking pool mappings. * `storageFundNonRefundableBalance`: the non-refundable portion of the storage fund coming from storage reinvestment, non-refundable storage rebates and any leftover staking rewards. * `storageFundTotalObjectStorageRebates`: the storage rebates of all the objects on-chain stored in the storage fund. * `systemStateVersion`: the current version of the system state data structure type. * `totalStake`: the total amount of stake from all active validators at the beginning of the epoch. * `validatorCandidatesId`: the ID of the object that stores proactive validators, mapping their addresses to their `Validator` structs. * `validatorCandidatesSize`: the number of proactive validators. * `validatorLowStakeGracePeriod`: the validator can have stake below `validator_low_stake_threshold` for this many epochs before being kicked out. * `validatorLowStakeThreshold`: validators with stake amount below `validator_low_stake_threshold` are considered to have low stake and will be escorted out of the validator set after being below this threshold for more than `validator_low_stake_grace_period` number of epochs. * `validatorReportRecords`: a map storing the records of validator reporting each other. * `validatorVeryLowStakeThreshold`: validators with stake below `validator_very_low_stake_threshold` will be removed immediately at epoch change, no grace period. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getLatestSuiSystemState", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "some_system_state" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sui/json-rpc-p4/ title: Sui JSON-RPC *(deprecated)* (4/5) description: Sui JSON-RPC API on Ankr: full method coverage, public and Premium endpoints, multi-region routing. source: docs/rpc-service/chains/chains-api/sui/json-rpc-p4.mdx --- # Sui JSON-RPC *(deprecated)* (4/5) > API reference for [Sui](/rpc-service/chains/chains-api/sui/). [All methods ->](/rpc-service/chains/chains-api/sui/) > > Part 4 of 5: [1](/rpc-service/chains/chains-api/sui/json-rpc/) · [2](/rpc-service/chains/chains-api/sui/json-rpc-p2/) · [3](/rpc-service/chains/chains-api/sui/json-rpc-p3/) · 4 · [5](/rpc-service/chains/chains-api/sui/json-rpc-p5/) ## Methods supported ### `suix_getOwnedObjects` > Retrieves the list of objects owned by an address. Note that if the address owns more than `QUERY_MAX_RESULT_LIMIT` objects, the pagination is not accurate, because previous page may have been updated when the next page is fetched. Please use `suix_queryObjects` if this is a concern. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `
` (BigInt_for_uint64): the owner's Sui address. * `` (object): the objects query criteria. * `` (objectID): the page cursor. If provided, the query will start from the next item after the specified cursor. Defaults to start from the first item if not specified. * `` (uint): the max number of items returned per page; defaults to `[QUERY_MAX_RESULT_LIMIT]` if not specified. #### Returns * `ObjectsPage`: all the objects the address provided in the request owns and that match the filter. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getOwnedObjects", "params": [ "0xa69bb635dcee0f33643b4729ae81730d55e5e26860fac6839ce2d7ed7e6f29d2", { "filter": { "MatchAll": [ { "StructType": "0x2::coin::Coin<0x2::sui::SUI>" }, { "AddressOwner": "0xa69bb635dcee0f33643b4729ae81730d55e5e26860fac6839ce2d7ed7e6f29d2" }, { "Version": "13488" } ] }, "options": { "showType": true, "showOwner": true, "showPreviousTransaction": true, "showDisplay": false, "showContent": false, "showBcs": false, "showStorageRebate": false } }, "0x76a1b4c23f2d9a9b6f0d8b2c17beace292b72aea16d6fb49b7d1ae51f33b01ed", 3 ] }' ``` "},{"AddressOwner":"0xa69bb635dcee0f33643b4729ae81730d55e5e26860fac6839ce2d7ed7e6f29d2"},{"Version":"13488"}]},"options":{"showType":true,"showOwner":true,"showPreviousTransaction":true,"showDisplay":false,"showContent":false,"showBcs":false,"showStorageRebate":false}},"0x76a1b4c23f2d9a9b6f0d8b2c17beace292b72aea16d6fb49b7d1ae51f33b01ed",3]} /> #### Response example ```json { "jsonrpc": "2.0", "result": { "data": [ { "data": { "objectId": "0x3d6255ff8223c12b0fd985c49d5777a0d65ad3d707164b2a378eee639ebc2690", "version": "13488", "digest": "A6v9pFTLH3PkDSvEGgVjW1JhL7CtcUQKwGmgXK8SQNsc", "type": "0x2::coin::Coin<0x2::sui::SUI>", "owner": { "AddressOwner": "0xa69bb635dcee0f33643b4729ae81730d55e5e26860fac6839ce2d7ed7e6f29d2" }, "previousTransaction": "AZiaEnge9YnawyLosmuxd8grpoiYasfpvBEjSLFUmJ8m", "storageRebate": "100" } }, { "data": { "objectId": "0x1a6e30f43933bbf40f5f5b6ce1f44957337dcb28f32e0355326f8c7d932bd54d", "version": "13488", "digest": "Fn1HG7LyUcLDps6bhYQkPWXpeUXgisznxRJ2qvn7Q1JN", "type": "0x2::coin::Coin<0x2::sui::SUI>", "owner": { "AddressOwner": "0xa69bb635dcee0f33643b4729ae81730d55e5e26860fac6839ce2d7ed7e6f29d2" }, "previousTransaction": "5EZjpdpApGGb48UZtuRgXuTRDBgkFDYaiNUtUNg7788k", "storageRebate": "100" } }, { "data": { "objectId": "0x28628a24386298faa98850887f64da841b87279efd098d59a66a3d9adc87cce8", "version": "13488", "digest": "39aXGAwHaY3CiqWwLiBZ7JRaGSvnpvPbHxMSJAwAUY5i", "type": "0x2::coin::Coin<0x2::sui::SUI>", "owner": { "AddressOwner": "0xa69bb635dcee0f33643b4729ae81730d55e5e26860fac6839ce2d7ed7e6f29d2" }, "previousTransaction": "CnBDiCrxWcJCCU1LHoda6XwwRaCSRfva8HZzfmR3p8Ag", "storageRebate": "100" } } ], "nextCursor": "0x28628a24386298faa98850887f64da841b87279efd098d59a66a3d9adc87cce8", "hasNextPage": true } } ``` --- ### `suix_getReferenceGasPrice` > Retrieves the reference gas price for the network. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns * `BigInt`: reference gas price information for the network. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getReferenceGasPrice", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": 1000 } ``` --- ### `suix_getStakes` > Retrieves all `DelegatedStake`. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: Sui address. #### Returns * `Vec` --- ### `suix_getStakesByIds` > Retrieves one or more `DelegatedStake`s. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: object ID. #### Returns * `Vec` --- ### `suix_getTotalSupply` > Retrieves total supply for a coin. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string): a type name for the coin (example: `0x168da5bf1f48dafc111b0a488fa454aca95e0b5e::usdc::USDC`). #### Returns * `value`: total supply for the type of coin provided. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getTotalSupply", "params": [ "0x0a52124e2d53af3bef7959609efa51761ad155441a1b73bdaeecce7c56488b13::acoin::ACOIN" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "value": "12023692" } } ``` --- ### `suix_getValidatorsApy` > Retrieves the validator APY. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none #### Returns * `apys`: validator APYs. * `epoch`: the epoch. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_getValidatorsApy", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "apys": [ { "address": "0xb7d1cb695b9491893f88a5ae1b9d4f235b3c7e00acf5386662fa062483ba507b", "apy": 0.06 }, { "address": "0x1e9e3039750f0a270f2e12441ad7f611a5f7fd0b2c4326c56b1fec231d73038d", "apy": 0.02 }, { "address": "0xba0f0885b97982f5fcac3ec6f5c8cae16743671832358f25bfacde706e528df4", "apy": 0.05 } ], "epoch": "420" } } ``` --- ### `suix_queryEvents` > Retrieves the list of events for a specified query criteria. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (EventFilter): the event query criteria. * `` (EventID, optional): the page cursor. * `` (uint): the max number of items per page, defaults to `QUERY_MAX_RESULT_LIMIT` if not specified. * `` (boolean): the query results order; defaults to false (ascending order), oldest record first. #### Returns * `EventPage`: the events for a specified query criteria. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "suix_queryEvents", "params": [ { "MoveModule": { "package": "0x30651d6e8f93e0fb79b4bc65a512beb5b9f3378423de90ed03b694cecf443c72", "module": "test" } }, { "txDigest": "Nb5kW8n655ApSBA19d2K8UVFGtMnJHa1mJQRH1h5N9L", "eventSeq": "1" }, 100, false ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "data": [ { "id": { "txDigest": "8WecQq8Qd79MmrHRXYudNG7e6vjWC9HtGAT4XZFyyWRM", "eventSeq": "1" }, "packageId": "0x28f9c59f430eaba84b8bee9b43a30f9cc83fa395759ca37c6e1ffc179184e98a", "transactionModule": "test", "sender": "0xc5db76052ab656e5f81853d0cf701cdbc8ebf27ab513fc6ef8c344406c78da3d", "type": "0x3::test::Test<0x3::test::Test>", "parsedJson": "some_value", "bcs": "" }, { "id": { "txDigest": "CNLhn3qWzHhfmmLQTdinbFDd2DuXFPN9z77UUqsC4Z4A", "eventSeq": "1" }, "packageId": "0x28f9c59f430eaba84b8bee9b43a30f9cc83fa395759ca37c6e1ffc179184e98a", "transactionModule": "test", "sender": "0x5ad3a5fcc295dc8803c15989a62d33ee859014cfd5e91c13a481370240e39246", "type": "0x3::test::Test<0x3::test::Test>", "parsedJson": "some_value", "bcs": "" }, { "id": { "txDigest": "FEhceVx5a6mkeZH8dPxthQkEEPkWfjWN3w1e6uTB5rFm", "eventSeq": "1" }, "packageId": "0x28f9c59f430eaba84b8bee9b43a30f9cc83fa395759ca37c6e1ffc179184e98a", "transactionModule": "test", "sender": "0x4c329a203fb9f0a8158aaab9b2a90044b26e14cc7fee4100fdcabda6d15c63c4", "type": "0x3::test::Test<0x3::test::Test>", "parsedJson": "some_value", "bcs": "" }, { "id": { "txDigest": "Nb5kW8n655ApSBA19d2K8UVFGtMnJHa1mJQRH1h5N9L", "eventSeq": "1" }, "packageId": "0x28f9c59f430eaba84b8bee9b43a30f9cc83fa395759ca37c6e1ffc179184e98a", "transactionModule": "test", "sender": "0xb49c45ae23f2b936495cd38b1a4b04010295baa75ac72e548aeecf2ce8b4e885", "type": "0x3::test::Test<0x3::test::Test>", "parsedJson": "some_value", "bcs": "" } ], "nextCursor": { "txDigest": "Nb5kW8n655ApSBA19d2K8UVFGtMnJHa1mJQRH1h5N9L", "eventSeq": "1" }, "hasNextPage": false } } ``` --- ### `suix_queryTransactionBlocks` > Retrieves list of transactions for a specified query criteria. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (TransactionBlockResponseQuery): the transaction query criteria. * `` (TransactionDigest; optional): the page cursor. If provided, the query will start from the next item after the specified cursor. Defaults to start from the first item if not specified. * `` (uint): the max items returned per page, default to `QUERY_MAX_RESULT_LIMIT` if not specified. * `` (boolean): the query results order; defaults to false (ascending order), oldest record first. #### Returns * `TransactionBlocksPage`: the transaction digest for specified query criteria. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "result": { "data": [ { "digest": "GUPcK4cmRmgsTFr52ab9f6fnzNVg3Lz6hF2aXFcsRzaD" }, { "digest": "B2iV1SVbBjgTKfbJKPQrvTT6F3kNdekFuBwY9tQcAxV2" }, { "digest": "8QrPa4x9iNG5r2zQfmeH8pJoVjjtq9AGzp8rp2fxi8Sk" }, { "digest": "3nek86HEjXZ7K3EtrAcBG4wMrCS21gqr8BqwwC6M6P7F" } ], "nextCursor": "3nek86HEjXZ7K3EtrAcBG4wMrCS21gqr8BqwwC6M6P7F", "hasNextPage": false } }' ``` --- ### `suix_resolveNameServiceAddress` > Retrieves the resolved address given the resolver and name. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string): the name to resolve. #### Returns * `SuiAddress` --- ### `suix_resolveNameServiceNames` > Retrieves the resolved names given an address. If multiple names are resolved, the first one is the primary name. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `
` (SuiAddress): the address to resolve. * `` (ObjectID): starting position. * `` (uint): max number per page. #### Returns * `Page` --- ### `unsafe_batchTransaction` > Creates an unsigned batched transaction. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (RPCTransactionRequestParams): the list of transaction request parameters. * `` (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided. * `` (BigInt_for_uint64): the gas budget, the transaction will fail if the gas cost exceed the budget. * `` (SuiTransactionBlockBuilderMode): whether this is a regular transaction or a Dev Inspect Transaction. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_mergeCoins` > Creates an unsigned transaction to merge multiple coins into one coin. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (ObjectID): the coin object to merge into, this coin will remain after the transaction. * `` (ObjectID): the coin object to be merged, this coin will be destroyed, the balance will be added to `primary_coin`. * `` (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided. * `` (BigInt_for_uint64): the gas budget, the transaction will fail if the gas cost exceed the budget. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: the objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_moveCall` > Creates an unsigned transaction to execute a Move call on the network by calling the specified function in the module of a given package. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address * `` (ObjectID): the Move package ID (example: `0x2`). * `` (string): the Move module name (example: `pay`). * `` (string): the Move function name (example: `split`). * `` (TypeTag): the type arguments of the Move function. * `` (SuiJsonValue): the arguments to be passed into the Move function, in [SuiJson](https://docs.sui.io/build/sui-json) format. * `` (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided. * `gas_budget` (BigInt_for_uint64): the gas budget, the transaction will fail if the gas cost exceed the budget. * `` (SuiTransactionBlockBuilderMode): whether this is a Normal transaction or a Dev Inspect Transaction. Defaults to be `SuiTransactionBlockBuilderMode::Commit` when it's None. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_pay` > Sends `Coin` to a list of addresses. `T` can be any coin type, following a list of amounts, The object specified in the `gas` field will be used to pay the gas fee for the transaction. The gas object can not appear in `input_coins`. If the gas object is not specified, the RPC server will auto-select one. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (ObjectID): the Sui coins to be used in this transaction. * `` (SuiAddress): the recipients' addresses, the length of this vector must be the same as amounts. * `amounts` (BigInt_for_uint64): the amounts to be transferred to recipients, following the same order. * `gas` (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided. * `gas_budget` (BigInt_for_uint64): the gas budget, the transaction will fail if the gas cost exceed the budget. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_payAllSui` > Sends all SUI coins to one recipient. This is for SUI coin only and does not require a separate gas coin object. Specifically, what pay_all_sui does are: 1. accumulate all SUI from input coins and deposit all SUI to the first input coin 2. transfer the updated first coin to the recipient and also use this first coin as gas coin object. 3. the balance of the first input coin after tx is sum(input_coins) - actual_gas_cost. 4. all other input coins other than the first are deleted. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (ObjectID): the Sui coins to be used in this transaction, including the coin for gas payment. * `` (SuiAddress): the recipient address. * `` (BigInt_for_uint64): the gas budget, the transaction will fail if the gas cost exceed the budget. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sui/json-rpc-p5/ title: Sui JSON-RPC *(deprecated)* (5/5) description: Sui JSON-RPC API on Ankr: full method coverage, public and Premium endpoints, multi-region routing. source: docs/rpc-service/chains/chains-api/sui/json-rpc-p5.mdx --- # Sui JSON-RPC *(deprecated)* (5/5) > API reference for [Sui](/rpc-service/chains/chains-api/sui/). [All methods ->](/rpc-service/chains/chains-api/sui/) > > Part 5 of 5: [1](/rpc-service/chains/chains-api/sui/json-rpc/) · [2](/rpc-service/chains/chains-api/sui/json-rpc-p2/) · [3](/rpc-service/chains/chains-api/sui/json-rpc-p3/) · [4](/rpc-service/chains/chains-api/sui/json-rpc-p4/) · 5 ## Methods supported ### `unsafe_paySui` > Sends SUI coins to a list of addresses, following a list of amounts. This is for SUI coin only and does not require a separate gas coin object. Specifically, what pay_sui does are: 1. debit each input_coin to create new coin following the order of amounts and assign it to the corresponding recipient. 2. accumulate all residual SUI from input coins left and deposit all SUI to the first input coin, then use the first input coin as the gas coin object. 3. the balance of the first input coin after tx is sum(input_coins) - sum(amounts) - actual_gas_cost. 4. all other input coints other than the first one are deleted. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (ObjectID): the Sui coins to be used in this transaction, including the coin for gas payment. * `` (SuiAddress): the recipients' addresses, the length of this vector must be the same as amounts. * `` (BigInt_for_uint64): the amounts to be transferred to recipients, following the same order. * `` (BigInt_for_uint64): the gas budget, the transaction will fail if the gas cost exceed the budget. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_publish` > Creates an unsigned transaction to publish a Move package. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (Base64): the compiled bytes of a Move package. * `` (ObjectID): a list of transitive dependency addresses that this set of modules depends on. * `` (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided. * `` (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_requestAddStake` > Adds the stake to a validator's staking pool using multiple coins and amount. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (ObjectID): the coin object to stake. * `` (BigInt_for_uint64): the stake amount. * `` (SuiAddress): the validator's Sui address. * `` (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided. * `` (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_requestWithdrawStake` > Withdraws the stake from a validator's staking pool. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (ObjectID): the StakedSui object ID. * `` (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided. * `` (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_splitCoin` > Creates an unsigned transaction to split a coin object into multiple coins. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (ObjectID): the coin object to be spilt. * `` (BigInt_for_uint64): the amounts to split out from the coin. * `` (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided. * `` (BigInt_for_uint64): the gas budget, the transaction will fail if the gas cost exceed the budget. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_splitCoinEqual` > Creates an unsigned transaction to split a coin object into multiple equal-size coins. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (ObjectID): the coin object to be spilt. * `` (BigInt_for_uint64): the number of coins to split into. * `` (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided. * `` (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_transferObject` > Creates an unsigned transaction to transfer an object from one address to another. The object's type must allow public transfers #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (ObjectID): the ID of the object to be transferred. * `` (ObjectID): the gas object to be used in this transaction, node will pick one from the signer's possession if not provided. * `` (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget. * `` (SuiAddress): the recipient's Sui address. #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- ### `unsafe_transferSui` > Creates an unsigned transaction to send a SUI coin object to a Sui address. The SUI object is also used as the gas object. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (SuiAddress): the transaction signer's Sui address. * `` (ObjectID): the Sui coin object to be used in this transaction. * `` (BigInt_for_uint64): the gas budget; the transaction will fail if the gas cost exceed the budget. * `` (SuiAddress): the recipient's Sui address. * `` (BigInt_for_uint64): the amount to be split out and transferred #### Returns * `gas`: the gas objects to be used. * `inputObjects`: objects to be used in this transaction. * `txBytes`: BCS serialized transaction data bytes without its type tag, as base-64 encoded string. --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/sui/json-rpc/ title: Sui JSON-RPC *(deprecated)* (1/5) description: Sui JSON-RPC API on Ankr: full method coverage, public and Premium endpoints, multi-region routing. source: docs/rpc-service/chains/chains-api/sui/json-rpc.mdx --- # Sui JSON-RPC *(deprecated)* (1/5) > API reference for [Sui](/rpc-service/chains/chains-api/sui/). [All methods ->](/rpc-service/chains/chains-api/sui/) > > Part 1 of 5: 1 · [2](/rpc-service/chains/chains-api/sui/json-rpc-p2/) · [3](/rpc-service/chains/chains-api/sui/json-rpc-p3/) · [4](/rpc-service/chains/chains-api/sui/json-rpc-p4/) · [5](/rpc-service/chains/chains-api/sui/json-rpc-p5/)
:::warning **Deprecation notice: JSON-RPC is being retired. Complete your migration by 30 September 2026.** Per the Sui Foundation's phased deprecation plan, JSON-RPC is being removed network-wide through 2026. The Sui Foundation asks every RPC provider, Ankr included, to have customers migrated **by the end of September 2026**. Migrate existing integrations to: - **[gRPC](/rpc-service/chains/chains-api/sui/grpc)** for indexers, backend services, and most dApp use cases. - **[GraphQL](/rpc-service/chains/chains-api/sui/graphql)** for frontends, dashboards, and analytics tools. **Sui Foundation timeline:** - **July 2026.** Sui Foundation public-good JSON-RPC endpoints were turned off (Testnet: week of 6 July; Mainnet: week of 27 July). This affects apps pointing at Sui Foundation public endpoints, including for dev and test. - **End of August 2026.** The Sui Foundation stops publishing JSON-RPC snapshots, so new JSON-RPC full nodes can no longer be bootstrapped from them. - **End of September 2026.** The implicit fallback to the Sui Foundation archival service is disconnected. Requests for pruned historical data over JSON-RPC may return incomplete results from this point. - **Mid-October 2026.** JSON-RPC support is removed from the Sui full-node software. After this point JSON-RPC is not available from any Sui full node. **Do not plan to migrate during the last two weeks.** The Sui Foundation has reserved the window between end of September and mid-October for removing the JSON-RPC codebase, and results may already be unreliable during it. Treat **30 September 2026** as your deadline. **On Ankr:** Ankr operates its own Sui full nodes, so the JSON-RPC endpoints (`https://rpc.ankr.com/sui`, `https://rpc.ankr.com/sui_testnet`) were **not** affected by the July public-good shutdown and keep serving until the mid-October 2026 software removal. That is a hard ceiling, not a migration buffer: historical and pruned-data queries may start returning incomplete results from the end of September 2026. For historical data, use the [gRPC Archive endpoint](/rpc-service/chains/chains-api/sui/grpc) (`archive.sui.grpc.ankr.com:443`). Your existing Premium token works on gRPC and GraphQL, so no new credentials are needed. If you are unsure which interface replaces a specific JSON-RPC method you rely on, contact support and we will map it for you. This page is preserved for reference until JSON-RPC is removed. ::: > Sui API is available on [Web3 API platform](https://www.ankr.com/rpc/sui). *Sui* is the first permissionless Layer 1 blockchain designed from the ground up to enable creators and developers to build experiences that cater to the next billion users in Web3. Sui is horizontally scalable to support a wide range of application development with unrivaled speed at low cost. In order for your Web3 application to interact with Sui — either by reading blockchain data or sending transactions to the network — it must connect to a Sui node. Historically, Sui developers have used JSON-RPC for this; going forward we recommend gRPC or GraphQL (see the deprecation notice above). The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported * [`sui_devInspectTransactionBlock`](/rpc-service/chains/chains-api/sui/json-rpc#sui_devinspecttransactionblock) — runs the transaction in dev-inspect mode. * [`sui_dryRunTransactionBlock`](/rpc-service/chains/chains-api/sui/json-rpc#sui_dryruntransactionblock) — retrieves transaction execution effects including the gas cost summary, while the effects are not committed to the chain. * [`sui_executeTransactionBlock`](/rpc-service/chains/chains-api/sui/json-rpc#sui_executetransactionblock) — executes the transaction and wait for results if desired. * [`sui_getChainIdentifier`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getchainidentifier) — retrieves the chain's identifier. * [`sui_getCheckpoint`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getcheckpoint) — retrieves a checkpoint. * [`sui_getCheckpoints`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getcheckpoints) — retrieves a paginated list of checkpoints. * [`sui_getEvents`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getevents) — retrieves transaction events. * [`sui_getLatestCheckpointSequenceNumber`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getlatestcheckpointsequencenumber) — retrieves the sequence number of the latest checkpoint that has been executed. * [`sui_getLoadedChildObjects`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getloadedchildobjects) — retrieves loaded child objects. * [`sui_getMoveFunctionArgTypes`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getmovefunctionargtypes) — retrieves the argument types of a Move function, based on normalized Type. * [`sui_getNormalizedMoveFunction`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getnormalizedmovefunction) — retrieves a structured representation of Move function. * [`sui_getNormalizedMoveModule`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getnormalizedmovemodule) — retrieves a structured representation of Move module. * [`sui_getNormalizedMoveModulesByPackage`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getnormalizedmovemodulesbypackage) — retrieves structured representations of all modules in the given package. * [`sui_getNormalizedMoveStruct`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getnormalizedmovestruct) — retrieves a structured representation of Move struct. * [`sui_getObject`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getobject) — retrieves the object information for a specified object. * [`sui_getProtocolConfig`](/rpc-service/chains/chains-api/sui/json-rpc#sui_getprotocolconfig) — retrieves the protocol config table for the given version number. * [`sui_getTotalTransactionBlocks`](/rpc-service/chains/chains-api/sui/json-rpc#sui_gettotaltransactionblocks) — retrieves the total number of transactions known to the server. * [`sui_getTransactionBlock`](/rpc-service/chains/chains-api/sui/json-rpc#sui_gettransactionblock) — retrieves the transaction response object. * [`sui_multiGetObjects`](/rpc-service/chains/chains-api/sui/json-rpc#sui_multigetobjects) — retrieves the object data for a list of objects. * [`sui_multiGetTransactionBlocks`](/rpc-service/chains/chains-api/sui/json-rpc#sui_multigettransactionblocks) — retrieves an ordered list of transaction responses. * [`sui_tryGetPastObject`](/rpc-service/chains/chains-api/sui/json-rpc#sui_trygetpastobject) — retrieves the object information for a specified version. * [`sui_tryMultiGetPastObjects`](/rpc-service/chains/chains-api/sui/json-rpc#sui_tryMultigetpastobjects) — retrieves the object information for a specified version. * [`suix_getAllBalances`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getallbalances) — retrieves the total coin balance for all coin type, owned by the address owner. * [`suix_getAllCoins`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getallcoins) — retrieves all Coin objects owned by an address. * [`suix_getBalance`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getbalance) — retrieves the total coin balance for one coin type, owned by the address owner. * [`suix_getCoinMetadata`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getcoinmetadata) — retrieves metadata (as symbol or decimals) for a coin. * [`suix_getCoins`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getcoins) — retrieves all coin type objects owned by an address. * [`suix_getCommitteeInfo`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getcommitteeinfo) — retrieves the committee information for the epoch specified. * [`suix_getDynamicFieldObject`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getdynamicfieldobject) — retrieves the dynamic field object information for a specified object. * [`suix_getDynamicFields`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getdynamicfields) — retrieves the list of dynamic field objects owned by an object. * [`suix_getLatestSuiSystemState`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getlatestsuisystemstate) — retrieves the latest SUI system state object on-chain. * [`suix_getOwnedObjects`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getownedobjects) — retrieves the list of objects owned by an address. * [`suix_getReferenceGasPrice`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getreferencegasprice) — retrieves the reference gas price for the network. * [`suix_getStakes`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getstakes) — retrieves all `DelegatedStake`. * [`suix_getStakesByIds`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getstakesbyids) — retrieves one or more `DelegatedStake`s. * [`suix_getTotalSupply`](/rpc-service/chains/chains-api/sui/json-rpc#suix_gettotalsupply) — retrieves total supply for a coin. * [`suix_getValidatorsApy`](/rpc-service/chains/chains-api/sui/json-rpc#suix_getvalidatorsapy) — retrieves the validator APY. * [`suix_queryEvents`](/rpc-service/chains/chains-api/sui/json-rpc#suix_queryevents) — retrieves the list of events for a specified query criteria. * [`suix_queryTransactionBlocks`](/rpc-service/chains/chains-api/sui/json-rpc#suix_querytransactionblocks) — retrieves list of transactions for a specified query criteria. * [`suix_resolveNameServiceAddress`](/rpc-service/chains/chains-api/sui/json-rpc#suix_resolvenameserviceaddress) — retrieves the resolved address given the resolver and name. * [`suix_resolveNameServiceNames`](/rpc-service/chains/chains-api/sui/json-rpc#suix_resolvenameservicenames) — retrieves the resolved names given an address. * [`unsafe_batchTransaction`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_batchtransaction) — creates an unsigned batched transaction. * [`unsafe_mergeCoins`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_mergecoins) — creates an unsigned transaction to merge multiple coins into one coin. * [`unsafe_moveCall`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_movecall) — creates an unsigned transaction to execute a Move call on the network by calling the specified function in the module of a given package. * [`unsafe_pay`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_pay) — sends `Coin` to a list of addresses. * [`unsafe_payAllSui`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_payallsui) — sends all SUI coins to one recipient. * [`unsafe_paySui`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_paysui) — sends SUI coins to a list of addresses, following a list of amounts. * [`unsafe_publish`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_publish) — creates an unsigned transaction to publish a Move package. * [`unsafe_requestAddStake`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_requestaddstake) — adds the stake to a validator's staking pool using multiple coins and amount. * [`unsafe_requestWithdrawStake`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_requestwithdrawstake) — withdraws the stake from a validator's staking pool. * [`unsafe_splitCoin`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_splitcoin) — creates an unsigned transaction to split a coin object into multiple coins. * [`unsafe_splitCoinEqual`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_splitcoinequal) — creates an unsigned transaction to split a coin object into multiple equal-size coins. * [`unsafe_transferObject`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_transferobject) — creates an unsigned transaction to transfer an object from one address to another. * [`unsafe_transferSui`](/rpc-service/chains/chains-api/sui/json-rpc#unsafe_transfersui) — an unsigned transaction to send SUI coin object to a Sui address. --- ### `sui_devInspectTransactionBlock` > Runs the transaction in dev-inspect mode. This mode allows for nearly any transaction (or Move call) with any arguments. Detailed results are provided, including both the transaction effects and any return values. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: Sui address. * `` (Base64): a BCS encoded `TransactionKind` (as opposed to `TransactionData`, which include `gasBudget` and `gasPrice`). * `` (string): gas is not charged, but gas usage is still calculated. Defaults to using a reference gas price. * `` (string): the epoch to perform the call. Will be set from the system state object if not provided. #### Returns * `effects` (TransactionBlockEffects): the summary of effects that likely would be generated if the transaction is actually run. Note however, that not all dev-inspect transactions are actually usable as transactions, so it might not be possible actually to generate these effects from a normal transaction. * `error` (string, null): an execution error from executing the transactions. * `events` (Event): events that likely would be generated if the transaction is actually run. * `results` (SuiExecutionResult): execution results (including return values) from executing the transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_devInspectTransactionBlock", "params": [ "0xd70420418b84502e506794227f897237764dde8d79a01ab2104bf742a277a2ab", "AAACACBnxtMcbJcOVn8D72fYEaT4Q2ZbjePygvpIs+AQO6m77QEAagYVO5/EhuEB8OnicDrIZm0GrsxN3355JqNhlwxlpbECAAAAAAAAACDoQ3EipycU+/EOvBcDPFtMkZiSbdzWAw3CwdmQCAtBWAEBAQEBAAEAAC9cVD1xauQ9RT3rOxmbva8bxwMMdoL4dwPc5DEkj+3gASxDgF0Nb1QCp60Npb3sVJx83qBrxKHTOaIlIe6pM7iJAgAAAAAAAAAgnvsgc1pPauyCE27/c+aBnHN3fSsxRAWdEJYzYFOryNAvXFQ9cWrkPUU96zsZm72vG8cDDHaC+HcD3OQxJI/t4AoAAAAAAAAAAC0xAQAAAAAA", "1000", "8888" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "effects": { "messageVersion": "v1", "status": { "status": "success" }, "executedEpoch": "0", "gasUsed": { "computationCost": "100", "storageCost": "100", "storageRebate": "10", "nonRefundableStorageFee": "0" }, "transactionDigest": "76gyHCk7FRrGACRqXM7Ybj5uJLtAzgEMJ5P9CeEzxZSG", "mutated": [ { "owner": { "AddressOwner": "0x2f5c543d716ae43d453deb3b199bbdaf1bc7030c7682f87703dce431248fede0" }, "reference": { "objectId": "0x2c43805d0d6f5402a7ad0da5bdec549c7cdea06bc4a1d339a22521eea933b889", "version": 2, "digest": "BhbWpBeESxuRWvmvLMyb2JNUuFa6j4aG1T4WUiPgKAHm" } }, { "owner": { "AddressOwner": "0x67c6d31c6c970e567f03ef67d811a4f843665b8de3f282fa48b3e0103ba9bbed" }, "reference": { "objectId": "0x6a06153b9fc486e101f0e9e2703ac8666d06aecc4ddf7e7926a361970c65a5b1", "version": 2, "digest": "GdfET1avZReDftpJNB8LSuHJ2cKUheSbEaLMzuPVXHsM" } } ], "gasObject": { "owner": { "ObjectOwner": "0x2f5c543d716ae43d453deb3b199bbdaf1bc7030c7682f87703dce431248fede0" }, "reference": { "objectId": "0x2c43805d0d6f5402a7ad0da5bdec549c7cdea06bc4a1d339a22521eea933b889", "version": 2, "digest": "BhbWpBeESxuRWvmvLMyb2JNUuFa6j4aG1T4WUiPgKAHm" } }, "eventsDigest": "6kerMphN4S5QTfd9TAhwMiFq1q9c2YwfpheBfWm85vUq" }, "events": [] } } ``` --- ## Methods supported ### `sui_dryRunTransactionBlock` > Retrieves transaction execution effects including the gas cost summary, while the effects are not committed to the chain. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (Base64): a BCS encoded `TransactionKind` (as opposed to `TransactionData`, which include `gasBudget` and `gasPrice`). #### Returns * `balanceChanges`: balance change. * `effects`: transaction block effects. * `events`: an event. * `input`: transaction block data. * `objectChanges`: object change. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_dryRunTransactionBlock", "params": [ "AAACACB7qR3cfnF89wjJNwYPBASHNuwz+xdG2Zml5YzVxnftgAEAT4LxyFh7mNZMAL+0bDhDvYv2zPp8ZahhOGmM0f3Kw9wCAAAAAAAAACCxDABG4pPAjOwPQHg9msS/SrtNf4IGR/2F0ZGD3ufH/wEBAQEBAAEAAGH7tbTzQqQL2/h/5KlGueONGM+P/HsAALl1F1x7apV2AejYx86GPzE9o9vZKoPvJtEouI/ma/JuDg0Jza9yfR2EAgAAAAAAAAAgzMqpegLMOpgEFnDhYJ23FOmFjJbp5GmFXxzzv9+X6GVh+7W080KkC9v4f+SpRrnjjRjPj/x7AAC5dRdce2qVdgoAAAAAAAAAAC0xAQAAAAAA" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "digest": "Gm54bTY5F9KjiCw3kfKpkXPaEE3kx8ToJkYqTsuQDZ7q", "transaction": { "data": { "messageVersion": "v1", "transaction": { "kind": "ProgrammableTransaction", "inputs": [ { "type": "pure", "valueType": "address", "value": "0x7ba91ddc7e717cf708c937060f04048736ec33fb1746d999a5e58cd5c677ed80" }, { "type": "object", "objectType": "immOrOwnedObject", "objectId": "0x4f82f1c8587b98d64c00bfb46c3843bd8bf6ccfa7c65a86138698cd1fdcac3dc", "version": "2", "digest": "Cv7n2YaM7Am1ssZGu4khsFkcKHnpgVhwFCSs4kLjrtLW" } ], "transactions": [ { "TransferObjects": [ [ { "Input": 1 } ], { "Input": 0 } ] } ] }, "sender": "0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576", "gasData": { "payment": [ { "objectId": "0xe8d8c7ce863f313da3dbd92a83ef26d128b88fe66bf26e0e0d09cdaf727d1d84", "version": 2, "digest": "EnRQXe1hDGAJCFyF2ds2GmPHdvf9V6yxf24LisEsDkYt" } ], "owner": "0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576", "price": "10", "budget": "20000000" } }, "txSignatures": [ "AGLsaLe6fSvGG/YgrxirjhKqE21kVCcveOW9h0IiCZ1Ei/oAOmu95EnKjoBhLHcS2/2Ga2Ljw0BVnGrY6reYkwVDij1TvBYKLcfLNo8fq6GASb9yfo6uvuwNUBGkTf54wQ==" ] }, "rawTransaction": "AQAAAAAAAgAge6kd3H5xfPcIyTcGDwQEhzbsM/sXRtmZpeWM1cZ37YABAE+C8chYe5jWTAC/tGw4Q72L9sz6fGWoYThpjNH9ysPcAgAAAAAAAAAgsQwARuKTwIzsD0B4PZrEv0q7TX+CBkf9hdGRg97nx/8BAQEBAQABAABh+7W080KkC9v4f+SpRrnjjRjPj/x7AAC5dRdce2qVdgHo2MfOhj8xPaPb2SqD7ybRKLiP5mvybg4NCc2vcn0dhAIAAAAAAAAAIMzKqXoCzDqYBBZw4WCdtxTphYyW6eRphV8c87/fl+hlYfu1tPNCpAvb+H/kqUa5440Yz4/8ewAAuXUXXHtqlXYKAAAAAAAAAAAtMQEAAAAAAAFhAGLsaLe6fSvGG/YgrxirjhKqE21kVCcveOW9h0IiCZ1Ei/oAOmu95EnKjoBhLHcS2/2Ga2Ljw0BVnGrY6reYkwVDij1TvBYKLcfLNo8fq6GASb9yfo6uvuwNUBGkTf54wQ==", "effects": { "messageVersion": "v1", "status": { "status": "success" }, "executedEpoch": "0", "gasUsed": { "computationCost": "100", "storageCost": "100", "storageRebate": "10", "nonRefundableStorageFee": "0" }, "transactionDigest": "8UExPV121BEfWkbymSPDYhh23rVNh3MSWtC5juJ9JGMJ", "mutated": [ { "owner": { "AddressOwner": "0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576" }, "reference": { "objectId": "0xe8d8c7ce863f313da3dbd92a83ef26d128b88fe66bf26e0e0d09cdaf727d1d84", "version": 2, "digest": "EnRQXe1hDGAJCFyF2ds2GmPHdvf9V6yxf24LisEsDkYt" } }, { "owner": { "AddressOwner": "0x7ba91ddc7e717cf708c937060f04048736ec33fb1746d999a5e58cd5c677ed80" }, "reference": { "objectId": "0x4f82f1c8587b98d64c00bfb46c3843bd8bf6ccfa7c65a86138698cd1fdcac3dc", "version": 2, "digest": "Cv7n2YaM7Am1ssZGu4khsFkcKHnpgVhwFCSs4kLjrtLW" } } ], "gasObject": { "owner": { "ObjectOwner": "0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576" }, "reference": { "objectId": "0xe8d8c7ce863f313da3dbd92a83ef26d128b88fe66bf26e0e0d09cdaf727d1d84", "version": 2, "digest": "EnRQXe1hDGAJCFyF2ds2GmPHdvf9V6yxf24LisEsDkYt" } }, "eventsDigest": "55TNn3v5vpuXjQfjqamw76P9GZD522pumo4NuT7RYeFB" }, "objectChanges": [ { "type": "transferred", "sender": "0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576", "recipient": { "AddressOwner": "0x7ba91ddc7e717cf708c937060f04048736ec33fb1746d999a5e58cd5c677ed80" }, "objectType": "0x2::example::Object", "objectId": "0x4f82f1c8587b98d64c00bfb46c3843bd8bf6ccfa7c65a86138698cd1fdcac3dc", "version": "2", "digest": "B3xLC8EbyvTxy5pgiwTNUzHLa6kS7uwD6sZdErKB8F8f" } ] } } ``` --- ### `sui_executeTransactionBlock` > Executes the transaction and wait for results if desired. Request types: 1. `WaitForEffectsCert`: waits for `TransactionEffectsCert` and then return to client. This mode is a proxy for transaction finality. 2. `WaitForLocalExecution`: waits for `TransactionEffectsCert` and make sure the node executed the transaction locally before returning the client. The local execution makes sure this node is aware of this transaction when client fires subsequent queries. However, if the node fails to execute the transaction locally in a timely manner, a bool type in the response is set to `false` to indicate the case. `request_type` is default to be `WaitForEffectsCert` unless `options.show_events` or `options.show_effects` is `true`. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (Base64): a BCS encoded `TransactionKind` (as opposed to `TransactionData`, which include `gasBudget` and `gasPrice`). * `` (Base64): a list of signatures (`flag || signature || pubkey` bytes, as base-64 encoded string). Signature is committed to the intent message of the transaction data, as base-64 encoded string. * `` (TransactionBlockResponseOptions): options for specifying the content to be returned. * `` (ExecuteTransactionRequestType): a request type, derived from `SuiTransactionBlockResponseOptions` if None. #### Returns * `` #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_executeTransactionBlock", "params": [ "AAACACBqEB6aOvXIBwES+Ahkizbvv43uihqC3kbZUE6WoRCKFwEAjvdvVsOZYzousxC8qRJOXy84znOeqsu2YAaIgE4HhEgCAAAAAAAAACB9w3+ufZMpihJFwxtCBojBaGy00TVtFxgN2C6TpIPFqwEBAQEBAAEAAAS0l6kWtGVmCaf6gnoJGE1vR2gdO6dM4NejbGSysfiHAZ+Q9/hmzCnfsdpjc86U+dldylpA9OF2mRjuv5+64AvTAgAAAAAAAAAgjleHL0UiRGjh/BfIFHCJ3EMY/dQA22c2TvNQyVJnbYUEtJepFrRlZgmn+oJ6CRhNb0doHTunTODXo2xksrH4hwoAAAAAAAAAAC0xAQAAAAAA", [ "AEZc4UMAoxzWtp+i1dvyOgmy+Eeb/5ZNwO5dpHBqX5Rt36+HhYnBby8asFU4b0i7TjQZGgLahT8w3NQUfk0NUQnqvbuA0Q1Bqu4RHV3JPpqmH+C527hWJGUBOZN1j9sg8w==" ], { "showInput": true, "showRawInput": true, "showEffects": true, "showEvents": true, "showObjectChanges": true, "showBalanceChanges": true }, "WaitForLocalExecution" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "digest": "BgSFSEFYbCrVUJJtHFeoLmLJi8jDf1CpC2o8S33HjeDJ", "transaction": { "data": { "messageVersion": "v1", "transaction": { "kind": "ProgrammableTransaction", "inputs": [ { "type": "pure", "valueType": "address", "value": "0x6a101e9a3af5c8070112f808648b36efbf8dee8a1a82de46d9504e96a1108a17" }, { "type": "object", "objectType": "immOrOwnedObject", "objectId": "0x8ef76f56c399633a2eb310bca9124e5f2f38ce739eaacbb6600688804e078448", "version": "2", "digest": "9Tvs1pGrMbNv7kkr1PoKLsWamyQpaFz5UWbL2AQ1ezk2" } ], "transactions": [ { "TransferObjects": [ [ { "Input": 1 } ], { "Input": 0 } ] } ] }, "sender": "0x04b497a916b4656609a7fa827a09184d6f47681d3ba74ce0d7a36c64b2b1f887", "gasData": { "payment": [ { "objectId": "0x9f90f7f866cc29dfb1da6373ce94f9d95dca5a40f4e1769918eebf9fbae00bd3", "version": 2, "digest": "AaeJbTYkUuyromsivxzkoxSkHt7pCESTyQG7xz6nbQ2G" } ], "owner": "0x04b497a916b4656609a7fa827a09184d6f47681d3ba74ce0d7a36c64b2b1f887", "price": "10", "budget": "20000000" } }, "txSignatures": [ "AEZc4UMAoxzWtp+i1dvyOgmy+Eeb/5ZNwO5dpHBqX5Rt36+HhYnBby8asFU4b0i7TjQZGgLahT8w3NQUfk0NUQnqvbuA0Q1Bqu4RHV3JPpqmH+C527hWJGUBOZN1j9sg8w==" ] }, "rawTransaction": "AQAAAAAAAgAgahAemjr1yAcBEvgIZIs277+N7ooagt5G2VBOlqEQihcBAI73b1bDmWM6LrMQvKkSTl8vOM5znqrLtmAGiIBOB4RIAgAAAAAAAAAgfcN/rn2TKYoSRcMbQgaIwWhstNE1bRcYDdguk6SDxasBAQEBAQABAAAEtJepFrRlZgmn+oJ6CRhNb0doHTunTODXo2xksrH4hwGfkPf4Zswp37HaY3POlPnZXcpaQPThdpkY7r+fuuAL0wIAAAAAAAAAII5Xhy9FIkRo4fwXyBRwidxDGP3UANtnNk7zUMlSZ22FBLSXqRa0ZWYJp/qCegkYTW9HaB07p0zg16NsZLKx+IcKAAAAAAAAAAAtMQEAAAAAAAFhAEZc4UMAoxzWtp+i1dvyOgmy+Eeb/5ZNwO5dpHBqX5Rt36+HhYnBby8asFU4b0i7TjQZGgLahT8w3NQUfk0NUQnqvbuA0Q1Bqu4RHV3JPpqmH+C527hWJGUBOZN1j9sg8w==", "effects": { "messageVersion": "v1", "status": { "status": "success" }, "executedEpoch": "0", "gasUsed": { "computationCost": "100", "storageCost": "100", "storageRebate": "10", "nonRefundableStorageFee": "0" }, "transactionDigest": "9agZ3azEMgMqxrDVG8P4GddELfWag2HhimEkpjixHhGE", "mutated": [ { "owner": { "AddressOwner": "0x04b497a916b4656609a7fa827a09184d6f47681d3ba74ce0d7a36c64b2b1f887" }, "reference": { "objectId": "0x9f90f7f866cc29dfb1da6373ce94f9d95dca5a40f4e1769918eebf9fbae00bd3", "version": 2, "digest": "AaeJbTYkUuyromsivxzkoxSkHt7pCESTyQG7xz6nbQ2G" } }, { "owner": { "AddressOwner": "0x6a101e9a3af5c8070112f808648b36efbf8dee8a1a82de46d9504e96a1108a17" }, "reference": { "objectId": "0x8ef76f56c399633a2eb310bca9124e5f2f38ce739eaacbb6600688804e078448", "version": 2, "digest": "9Tvs1pGrMbNv7kkr1PoKLsWamyQpaFz5UWbL2AQ1ezk2" } } ], "gasObject": { "owner": { "ObjectOwner": "0x04b497a916b4656609a7fa827a09184d6f47681d3ba74ce0d7a36c64b2b1f887" }, "reference": { "objectId": "0x9f90f7f866cc29dfb1da6373ce94f9d95dca5a40f4e1769918eebf9fbae00bd3", "version": 2, "digest": "AaeJbTYkUuyromsivxzkoxSkHt7pCESTyQG7xz6nbQ2G" } }, "eventsDigest": "816hEv4WAW2reK9xkf11PeHiaZJrp7PQT9oGJZhdf9TN" }, "objectChanges": [ { "type": "transferred", "sender": "0x04b497a916b4656609a7fa827a09184d6f47681d3ba74ce0d7a36c64b2b1f887", "recipient": { "AddressOwner": "0x6a101e9a3af5c8070112f808648b36efbf8dee8a1a82de46d9504e96a1108a17" }, "objectType": "0x2::example::Object", "objectId": "0x8ef76f56c399633a2eb310bca9124e5f2f38ce739eaacbb6600688804e078448", "version": "2", "digest": "7PsBHpUW6yfGNov2WrbVafLjgT9nYziQ3gVDbRq6zTbF" } ] } } ``` --- ### `sui_getChainIdentifier` > Retrieves the chain's identifier. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. #### Returns A string identifier of a chain. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getChainIdentifier", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "4c78adac", "id": 1 } ``` --- ### `sui_getCheckpoint` > Retrieves a checkpoint. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: checkpoint identifier, can use either checkpoint digest, or checkpoint sequence number as input. #### Returns * `checkpointCommitments`: commitments to checkpoint state. * `digest`: checkpoint digest. * `endOfEpochData`: to be present only on the final checkpoint of the epoch. * `epoch`: checkpoint's epoch ID. * `epochRollingGasCostSummary`: the running total gas costs of all transactions included in the current epoch so far until this checkpoint. * `networkTotalTransactions`: total number of transactions committed since genesis, including those in this checkpoint. * `previousDigest`: digest of the previous checkpoint. * `sequenceNumber`: checkpoint sequence number. * `timestampMs`: timestamp of the checkpoint — number of milliseconds from the Unix epoch Checkpoint timestamps are monotonic, but not strongly monotonic — subsequent checkpoints can have same timestamp if they originate from the same underlining consensus commit * `transactions`: transaction digests. * `validatorSignature`: validator Signature. #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getCheckpoint", "params": [ "1000" ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "epoch": "5000", "sequenceNumber": "1000", "digest": "G6Dtzr1ZSfHFhotGsTE3cLENa7L1ooe1BBvknAUsARbV", "networkTotalTransactions": "792385", "previousDigest": "6tBy8RXZKrdrB4XkMQn7J3MNG4fQCo9XcRduFFvYrL5Z", "epochRollingGasCostSummary": { "computationCost": "0", "storageCost": "0", "storageRebate": "0", "nonRefundableStorageFee": "0" }, "timestampMs": "1676911928", "transactions": [ "mN8YNBgVR3wB7vfXmjVgDRF4oqxVRRjzmJ6U4mzbq77" ], "checkpointCommitments": [], "validatorSignature": "wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } } ``` --- ### `sui_getCheckpoints` > Retrieves a paginated list of checkpoints. Gets a paginated list of all checkpoints starting at the provided cursor organised in descending order. Each result page has a maximum number of checkpoints set by the provided limit. #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (BigInt_for_uint64): an optional paging cursor. If provided, the query will start from the next item after the specified cursor. By default, starts from the first item. * `` (uint): the maximum items returned per page; defaults to [QUERY_MAX_RESULT_LIMIT_CHECKPOINTS] if not specified. * `` (boolean): query result ordering, default to false (ascending order), oldest record first. #### Returns * CheckpointPage #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getCheckpoints", "params": [ "1004", 4, false ] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "data": [ { "epoch": "5000", "sequenceNumber": "1005", "digest": "9zA7Q9Ka1ykvYjSQGhQCdCf32FZkcWNWx7L22JczXGsk", "networkTotalTransactions": "792385", "previousDigest": "8BLFxLTjWZ2KqaGc3FjR1o9aL6kbyYrmhuNfJLU1ehYt", "epochRollingGasCostSummary": { "computationCost": "0", "storageCost": "0", "storageRebate": "0", "nonRefundableStorageFee": "0" }, "timestampMs": "1676911928", "transactions": [ "7RudGLkQDBNJyqrptkrNU66Zd3pvq8MHVAHYz9WpBm59" ], "checkpointCommitments": [], "validatorSignature": "wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "epoch": "5000", "sequenceNumber": "1006", "digest": "FAUWHyWacmb4Vg4QGi9a6gqeVb7ixAZiL73FaGd6WpoV", "networkTotalTransactions": "792385", "previousDigest": "6Pn25cieaE62AT6BwCeBoca13AGZuneucaaTGqt3gNCo", "epochRollingGasCostSummary": { "computationCost": "0", "storageCost": "0", "storageRebate": "0", "nonRefundableStorageFee": "0" }, "timestampMs": "1676911928", "transactions": [ "7r7tmP5hzgrusiN6cucFwfTveqDb7K75tMJ7oNCyoDmy" ], "checkpointCommitments": [], "validatorSignature": "wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "epoch": "5000", "sequenceNumber": "1007", "digest": "B3mzC6gy87SomUQwPsmVY7mtwkZLxfm5WwNi3kKyEb3x", "networkTotalTransactions": "792385", "previousDigest": "CnHTfdUJr1UUqwXkYUhbQjXeM16xR33UR62jE72toCis", "epochRollingGasCostSummary": { "computationCost": "0", "storageCost": "0", "storageRebate": "0", "nonRefundableStorageFee": "0" }, "timestampMs": "1676911928", "transactions": [ "Gb1UDqhmKMzMJ5FL37kBqCcuy4TtBL2ay3qec8tEUBLj" ], "checkpointCommitments": [], "validatorSignature": "wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "epoch": "5000", "sequenceNumber": "1008", "digest": "HunuJWKu7azBfS47rJTq9FHTMvUDNVo2SK4hQeh5brXp", "networkTotalTransactions": "792385", "previousDigest": "38fLUfuigyzLPEDrsmRhcQmhKtbEUohuFBP9NDcWBmFz", "epochRollingGasCostSummary": { "computationCost": "0", "storageCost": "0", "storageRebate": "0", "nonRefundableStorageFee": "0" }, "timestampMs": "1676911928", "transactions": [ "GWTS9QR7mjNz9fBWGkk4JZU3mrzMXrmj74uS59Cd5und" ], "checkpointCommitments": [], "validatorSignature": "wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } ], "nextCursor": "1008", "hasNextPage": true } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/swell/ title: Swell description: Swell is a non-custodial staking protocol with a mission to deliver the world’s best liquid staking and… 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/swell/index.mdx --- # Swell
> Swell API is available on [Web3 API platform](https://www.ankr.com/rpc/swell). *Swell* is a non-custodial staking protocol with a mission to deliver the world’s best liquid staking and restaking experience, simplify access to DeFi, while securing the future of Ethereum and restaking services. With Swell, users are able to earn passive income by staking or restaking ETH to earn both blockchain rewards and restaked AVS rewards, and in return be provided with a yield-bearing liquid token (LST or LRT) to hold or participate in the wider DeFi ecosystem to earn additional yield. In order for your Web3 application to interact with Swell — either by reading blockchain data or sending transactions to the network — it must connect to a Swell node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/swell/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/swell/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/swell/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/swell/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/swell/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/swell/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/swell/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/swell/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/swell/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/swell/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/swell/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/swell/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/swell/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/swell/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/swell/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/swell/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/swell/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/swell/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/swell/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/swell/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/swell/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/swell/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/swell/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/swell/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/swell/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/swell/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/swell/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/swell/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/swell/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/swell/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/swell/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/swell/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/swell/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/swell/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/swell/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/swell/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/swell/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/swell/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/swell/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/swell/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/swell/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/swell/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/swell/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/swell/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/swell/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/swell/web3-p2/ title: Swell — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/swell/web3-p2.mdx --- # Swell — web3, net, eth (2/3) > API reference for [Swell](/rpc-service/chains/chains-api/swell/). [All methods ->](/rpc-service/chains/chains-api/swell/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/swell/web3/) · 2 · [3](/rpc-service/chains/chains-api/swell/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "to": "0x1234567890abcdef1234567890abcdef12345678", "data": "0x70a08231000000000000000000000000abcdefabcdefabcdefabcdefabcdefabcd", "value": "0x0" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x542e" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x769826b11c626e76e7a0ec7a3291a84ae1aedad7cd3c15f77457883c037b3586", false], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "baseFeePerGas": "0xfb", "blobGasUsed": "0x0", "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0x", "gasLimit": "0x3938700", "gasUsed": "0xabae", "hash": "0x769826b11c626e76e7a0ec7a3291a84ae1aedad7cd3c15f77457883c037b3586", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0x9e9afe7303914b5bc097077e2be0857eab4216b64e6352f251125496749035df", "nonce": "0x0000000000000000", "number": "0x35f23", "parentBeaconBlockRoot": "0x7b06539c54dbd61653356c4d6c08fb3607d0449e98b72ff89d76b160f27f591c", "parentHash": "0xf10fa814903d0ef7228bfbcdccc96b0d525a86572ee8e6b2a38828cfed1f5c18", "receiptsRoot": "0x6d924b9af9cfeceb2e50af1eba38429fe3b70dc2760a40f0f5c394edca8bd9e2", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x347", "stateRoot": "0x634f29146c0fa964f512dc8f758dad1465f4897fee65f441e8c845b2ecedd2ae", "timestamp": "0x674d98c5", "transactions": [ "0xde6075fc8e8ce8bde41e8912de54be564e4cce7aec4cda4a985a10b4fb5f975c" ], "transactionsRoot": "0xa4e1a0b5ab0573b3b7225bb8048b36586710707f7071b5538ae3478774bdaee4", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", true], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "baseFeePerGas": "0xfb", "blobGasUsed": "0x0", "difficulty": "0x0", "excessBlobGas": "0x0", "extraData": "0x", "gasLimit": "0x3938700", "gasUsed": "0xaba2", "hash": "0x2b20a26bb658529221dfb50ebffe41b2b1f4ff39f05edf539cac01783cc20d5f", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x4200000000000000000000000000000000000011", "mixHash": "0xb3e0c9c39af6f6dfe601cd9b8572cd0e35938a36829e2fad16693afb24ac8fe4", "nonce": "0x0000000000000000", "number": "0x36153", "parentBeaconBlockRoot": "0x74b8d4358ebe4ec4ff1b2f55955b4fa49df3416561f9a1f7d18a4188bfb98a46", "parentHash": "0x6da3ab14e60e6b7a6877fb4ce9c280f246d0362d7b9fcf4d90d84b315eb34340", "receiptsRoot": "0xeb7140663802eceb3b94ca80013b126215cbadda40021996755ea8a3161bb34d", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x347", "stateRoot": "0x3de5e46eb5d377cc5728d079cbc3139f8496d371e6575810dd0cc13dbba2778b", "timestamp": "0x674d9d25", "transactions": [ { "blockHash": "0x2b20a26bb658529221dfb50ebffe41b2b1f4ff39f05edf539cac01783cc20d5f", "blockNumber": "0x36153", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0x78470f5ee366204f270ea885a75766bb2052b63ac85a25cd5b877e7860d465d0", "input": "0x440a5e2000000558000c5fc5000000000000000300000000674d9c5f0000000001453c150000000000000000000000000000000000000000000000000000000278f1173200000000000000000000000000000000000000000000000000000002325f0a24d25206ae1e32bf7993f8ade201b44bddb9543cca013e9deaaba9562a6d3dae00000000000000000000000000f854cd5b26bfd73d51236c0122798907ed65b1f2", "nonce": "0x36152", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0xbdae1a568841db7c8938d4c3bacb6a9e5065caf68c889d0d0831531b0d50f9b4", "mint": "0x0", "depositReceiptVersion": "0x1" } ], "transactionsRoot": "0xf09a2a740879a46d38a610333ec9f7d32ad4aa6c62b04bb8bd7300a2669765e7", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xde6075fc8e8ce8bde41e8912de54be564e4cce7aec4cda4a985a10b4fb5f975c"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x769826b11c626e76e7a0ec7a3291a84ae1aedad7cd3c15f77457883c037b3586", "blockNumber": "0x35f23", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0xde6075fc8e8ce8bde41e8912de54be564e4cce7aec4cda4a985a10b4fb5f975c", "input": "0x440a5e2000000558000c5fc5000000000000000100000000674d98030000000001453bba00000000000000000000000000000000000000000000000000000003ef584454000000000000000000000000000000000000000000000000000000018af8a63999c6722a30f5a0cdd7622716d9d815c1dbac2983a989b8f8538de98f0b496676000000000000000000000000f854cd5b26bfd73d51236c0122798907ed65b1f2", "nonce": "0x35f22", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x57913ce50e6f4dca31cf61369737e6d13271fc8d50fdf74e542437a16e1b8883", "mint": "0x0", "depositReceiptVersion": "0x1" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x769826b11c626e76e7a0ec7a3291a84ae1aedad7cd3c15f77457883c037b3586", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x769826b11c626e76e7a0ec7a3291a84ae1aedad7cd3c15f77457883c037b3586", "blockNumber": "0x35f23", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0xde6075fc8e8ce8bde41e8912de54be564e4cce7aec4cda4a985a10b4fb5f975c", "input": "0x440a5e2000000558000c5fc5000000000000000100000000674d98030000000001453bba00000000000000000000000000000000000000000000000000000003ef584454000000000000000000000000000000000000000000000000000000018af8a63999c6722a30f5a0cdd7622716d9d815c1dbac2983a989b8f8538de98f0b496676000000000000000000000000f854cd5b26bfd73d51236c0122798907ed65b1f2", "nonce": "0x35f22", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x57913ce50e6f4dca31cf61369737e6d13271fc8d50fdf74e542437a16e1b8883", "mint": "0x0", "depositReceiptVersion": "0x1" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x1b5eef1c675007f8939b68524bc6f38eb010cd2c695bdf89c1fdd72eeb0aa9c8", "blockNumber": "0x361ab", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gas": "0xf4240", "gasPrice": "0x0", "hash": "0xbbb818ceb584ce7b62b7a6c3b5d2ada60c0b49882cf5da282d87ec88fc5c0ec9", "input": "0x440a5e2000000558000c5fc5000000000000000000000000674d9d130000000001453c24000000000000000000000000000000000000000000000000000000025de66ed500000000000000000000000000000000000000000000000000000001f3e2b33dbe5e0a51b94dcd58e0451944be920baaf602c5f2ae01e88f57d08253d9a85895000000000000000000000000f854cd5b26bfd73d51236c0122798907ed65b1f2", "nonce": "0x361aa", "to": "0x4200000000000000000000000000000000000015", "transactionIndex": "0x0", "value": "0x0", "type": "0x7e", "v": "0x0", "r": "0x0", "s": "0x0", "sourceHash": "0x755da4065a732fd8cbf1599b00795c7ec8028bc8e2809fbcf7cee129db81da75", "mint": "0x0", "depositReceiptVersion": "0x1" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/swell/web3-p3/ title: Swell — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/swell/web3-p3.mdx --- # Swell — web3, net, eth (3/3) > API reference for [Swell](/rpc-service/chains/chains-api/swell/). [All methods ->](/rpc-service/chains/chains-api/swell/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/swell/web3/) · [2](/rpc-service/chains/chains-api/swell/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xde6075fc8e8ce8bde41e8912de54be564e4cce7aec4cda4a985a10b4fb5f975c"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x769826b11c626e76e7a0ec7a3291a84ae1aedad7cd3c15f77457883c037b3586", "blockNumber": "0x35f23", "contractAddress": null, "cumulativeGasUsed": "0xabae", "depositNonce": "0x35f22", "depositReceiptVersion": "0x1", "effectiveGasPrice": "0x0", "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001", "gasUsed": "0xabae", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x4200000000000000000000000000000000000015", "transactionHash": "0xde6075fc8e8ce8bde41e8912de54be564e4cce7aec4cda4a985a10b4fb5f975c", "transactionIndex": "0x0", "type": "0x7e" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x9ef9df0cb786de577e9d474b3eeb9e7bd795ebb740188ef2454ff3a70de8b4c1", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x36200", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAd0001"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/swell/web3/ title: Swell — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/swell/web3.mdx --- # Swell — web3, net, eth (1/3) > API reference for [Swell](/rpc-service/chains/chains-api/swell/). [All methods ->](/rpc-service/chains/chains-api/swell/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/swell/web3-p2/) · [3](/rpc-service/chains/chains-api/swell/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v1.101411.0-stable-d5a96613/linux-amd64/go1.23.2", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1923" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xf433b" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x35e0e" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x4200000000000000000000000000000000000015", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x4200000000000000000000000000000000000015", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000674d96e30000000001453ba2" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x4200000000000000000000000000000000000015", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x1482b3da285d0460baae28e5c104946f375fd6383f5a8c56e3f234da8130463a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x35E83"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x1482b3da285d0460baae28e5c104946f375fd6383f5a8c56e3f234da8130463a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x4200000000000000000000000000000000000015", "latest"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100be5780638f283970146100f8578063f851a440146101185761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61012d565b005b6..." } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/swell/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/swell/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x1234567890abcdef1234567890abcdef12345678", "data": "0x70a08231000000000000000000000000abcdefabcdefabcdefabcdefabcdefabcd" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/syscoin/ title: Syscoin description: Syscoin is a Proof-of-Work blockchain solution merge-mined with Bitcoin. 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/syscoin/index.mdx --- # Syscoin
> Syscoin API is available on [Web3 API platform](https://www.ankr.com/rpc/syscoin). *Syscoin* is a Proof-of-Work blockchain solution merge-mined with Bitcoin. At its base is a dual-chain Layer 1: the core is the Syscoin native blockchain, and running in tandem with it is an Ethereum Virtual Machine (EVM) chain called NEVM (Network-Enhanced Virtual Machine), which provides modularity, enhanced security, and full byte-for-byte Ethereum compatibility. In order for your Web3 application to interact with Syscoin — either by reading blockchain data or sending transactions to the network — it must connect to a Syscoin node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/syscoin/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/syscoin/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/syscoin/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/syscoin/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/syscoin/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/syscoin/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/syscoin/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/syscoin/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/syscoin/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/syscoin/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/syscoin/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/syscoin/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/syscoin/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/syscoin/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/syscoin/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/syscoin/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/syscoin/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/syscoin/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/syscoin/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/syscoin/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/syscoin/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/syscoin/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/syscoin/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/syscoin/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/syscoin/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/syscoin/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/syscoin/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/syscoin/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/syscoin/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/syscoin/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/syscoin/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/syscoin/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/syscoin/web3-p2/ title: Syscoin — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/syscoin/web3-p2.mdx --- # Syscoin — web3, net, eth (2/3) > API reference for [Syscoin](/rpc-service/chains/chains-api/syscoin/). [All methods ->](/rpc-service/chains/chains-api/syscoin/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/syscoin/web3/) · 2 · [3](/rpc-service/chains/chains-api/syscoin/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":"0x07f327929A3A3131EB4BE83f784DBD3E5C2698f8"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xcf08" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x32", "difficulty": "0x1", "extraData": "0xd883040300846765746888676f312e31372e32856c696e7578", "gasLimit": "0x7a1200", "gasUsed": "0x39f437", "hash": "0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "logsBloom": "0x04000000200000008000000000000000000000000000000000000000000800000000000000000000000000000000010000000000000000000000000000040000000000000000000000000008001000000000000001040000000000000000800000004000020000000000000000000800200004000000008100000010000000008004004000000000000000000000000000000000000000000000000002001010000000000000000000002100000000000000000000000000000003000000000000000002000008000000000000000800004004000000000000000000000060000000000000000000000000000000000000000000008000000000000100000000", "miner": "0x120a9f47697920227ede015c8d562d7264c1159d", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x3c962", "parentHash": "0x6ac2095f667e39477acdc6305059a032551ccddc49c035f67495261ad5975f67", "receiptsRoot": "0x15d3bac29504a847a18e1f08597f2017e4e303debb19c43624ebab7ed57a0990", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3f49", "stateRoot": "0x8a95618a24e193f11872174e10ae256b9e5e457cef6704b332907978559a4305", "timestamp": "0x63edf724", "totalDifficulty": "0x3c963", "transactions": [ "0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342", "0xcda46c162eed47278866023539faf51044c2ea5df3a1b77caf961a2e5434bcd0", "0xa29daff7029babe53b38ba0e6be7be913f86a8a0bf66c29dcced84f1ce9bb7a1", "0xf53ea8473b61598f152546abe40d0c3d6b721bc2eaf2e92f8ef21dd81c7bdfe6", "0xb5a15d13ddb32e5b66023a062559443f6875e7842fbade6b53b443368fcb632a", "0x147fa85bedd94e3b1973574e17850ed95d3737a45bf8460c72f368d66c2be2a0", "0x977c1642789c6de951a52088c78dbd70c7ed47e95bc4be3432afb0b93ec714c3", "0x28fac587887e5473ad6411f100bd2c282bb7090ff650e656c0ac0a399dbeb6e7", "0xa4cfe3cb941966d25c8c8a70c5cf74ae6fc1e399364d97616be979acc927095c", "0xbef61096fc8ab733ca8aeca381b0485336b4fad3ad728982404096e30ffa66e7", "0x1469cab00f5748d3bcbbc88fa203747a3b6a10814e5053fa6cf64755fd0eaf97", "0x16da8f0c9d8eb4bc4ef8107ee8f7ae735512edb6324fec02d956b73a5558a115", "0x86593f69db7fc4651615a32fd84006c8cae61a4e18f3b704339e801bb480c4d8", "0x6522fdfbc30b1aabf0b9288936c912679435d87c8562ae6b3cddb6aabb99f17f", "0x0fa19f1d04876427bf317385ce9b1db26a757e7df3ff99303802af7102709169" ], "transactionsRoot": "0xec70238f716e40e12db6286722c7ea46c13645f1800d60221440e6668637fb2e", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x3C962", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x32", "difficulty": "0x1", "extraData": "0xd883040300846765746888676f312e31372e32856c696e7578", "gasLimit": "0x7a1200", "gasUsed": "0x39f437", "hash": "0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "logsBloom": "0x04000000200000008000000000000000000000000000000000000000000800000000000000000000000000000000010000000000000000000000000000040000000000000000000000000008001000000000000001040000000000000000800000004000020000000000000000000800200004000000008100000010000000008004004000000000000000000000000000000000000000000000000002001010000000000000000000002100000000000000000000000000000003000000000000000002000008000000000000000800004004000000000000000000000060000000000000000000000000000000000000000000008000000000000100000000", "miner": "0x120a9f47697920227ede015c8d562d7264c1159d", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x3c962", "parentHash": "0x6ac2095f667e39477acdc6305059a032551ccddc49c035f67495261ad5975f67", "receiptsRoot": "0x15d3bac29504a847a18e1f08597f2017e4e303debb19c43624ebab7ed57a0990", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3f49", "stateRoot": "0x8a95618a24e193f11872174e10ae256b9e5e457cef6704b332907978559a4305", "timestamp": "0x63edf724", "totalDifficulty": "0x3c963", "transactions": [ "0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342", "0xcda46c162eed47278866023539faf51044c2ea5df3a1b77caf961a2e5434bcd0", "0xa29daff7029babe53b38ba0e6be7be913f86a8a0bf66c29dcced84f1ce9bb7a1", "0xf53ea8473b61598f152546abe40d0c3d6b721bc2eaf2e92f8ef21dd81c7bdfe6", "0xb5a15d13ddb32e5b66023a062559443f6875e7842fbade6b53b443368fcb632a", "0x147fa85bedd94e3b1973574e17850ed95d3737a45bf8460c72f368d66c2be2a0", "0x977c1642789c6de951a52088c78dbd70c7ed47e95bc4be3432afb0b93ec714c3", "0x28fac587887e5473ad6411f100bd2c282bb7090ff650e656c0ac0a399dbeb6e7", "0xa4cfe3cb941966d25c8c8a70c5cf74ae6fc1e399364d97616be979acc927095c", "0xbef61096fc8ab733ca8aeca381b0485336b4fad3ad728982404096e30ffa66e7", "0x1469cab00f5748d3bcbbc88fa203747a3b6a10814e5053fa6cf64755fd0eaf97", "0x16da8f0c9d8eb4bc4ef8107ee8f7ae735512edb6324fec02d956b73a5558a115", "0x86593f69db7fc4651615a32fd84006c8cae61a4e18f3b704339e801bb480c4d8" ], "transactionsRoot": "0xec70238f716e40e12db6286722c7ea46c13645f1800d60221440e6668637fb2e", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "blockNumber": "0x3c962", "from": "0x0639556f03714a74a5feeaf5736a4a64ff70d206", "gas": "0x5208", "gasPrice": "0x165a0bc00", "maxFeePerGas": "0x165a0bc00", "maxPriorityFeePerGas": "0x165a0bc00", "hash": "0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342", "input": "0x", "nonce": "0x188", "to": "0x279bc70bc870f55546639924a00e1b1e02f3b61d", "transactionIndex": "0x0", "value": "0x2a06487cbac738000", "type": "0x2", "accessList": [], "chainId": "0x39", "v": "0x1", "r": "0x4271c455b615ce98d036030b30cdfdc5e1c79420caaf3907cd65bbaa49b1889e", "s": "0x1c360f303a21b8df3dbb3b970925f07ba707046593015d30c820f617485d7683" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "blockNumber": "0x3c962", "from": "0x0639556f03714a74a5feeaf5736a4a64ff70d206", "gas": "0x5208", "gasPrice": "0x165a0bc00", "maxFeePerGas": "0x165a0bc00", "maxPriorityFeePerGas": "0x165a0bc00", "hash": "0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342", "input": "0x", "nonce": "0x188", "to": "0x279bc70bc870f55546639924a00e1b1e02f3b61d", "transactionIndex": "0x0", "value": "0x2a06487cbac738000", "type": "0x2", "accessList": [], "chainId": "0x39", "v": "0x1", "r": "0x4271c455b615ce98d036030b30cdfdc5e1c79420caaf3907cd65bbaa49b1889e", "s": "0x1c360f303a21b8df3dbb3b970925f07ba707046593015d30c820f617485d7683" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x3C962", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "blockNumber": "0x3c962", "from": "0x0639556f03714a74a5feeaf5736a4a64ff70d206", "gas": "0x5208", "gasPrice": "0x165a0bc00", "maxFeePerGas": "0x165a0bc00", "maxPriorityFeePerGas": "0x165a0bc00", "hash": "0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342", "input": "0x", "nonce": "0x188", "to": "0x279bc70bc870f55546639924a00e1b1e02f3b61d", "transactionIndex": "0x0", "value": "0x2a06487cbac738000", "type": "0x2", "accessList": [], "chainId": "0x39", "v": "0x1", "r": "0x4271c455b615ce98d036030b30cdfdc5e1c79420caaf3907cd65bbaa49b1889e", "s": "0x1c360f303a21b8df3dbb3b970925f07ba707046593015d30c820f617485d7683" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/syscoin/web3-p3/ title: Syscoin — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/syscoin/web3-p3.mdx --- # Syscoin — web3, net, eth (3/3) > API reference for [Syscoin](/rpc-service/chains/chains-api/syscoin/). [All methods ->](/rpc-service/chains/chains-api/syscoin/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/syscoin/web3/) · [2](/rpc-service/chains/chains-api/syscoin/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "blockNumber": "0x3c962", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x165a0bc00", "from": "0x0639556f03714a74a5feeaf5736a4a64ff70d206", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x279bc70bc870f55546639924a00e1b1e02f3b61d", "transactionHash": "0xc028c90e2727b130ecab4561e755f25bf7edb699d0e9d3bbd4883f1ba7ced342", "transactionIndex": "0x0", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x3C962", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either a hex of the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x1D220215ddBd0A9F525b56A400C24487Ed696000"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/syscoin/web3/ title: Syscoin — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/syscoin/web3.mdx --- # Syscoin — web3, net, eth (1/3) > API reference for [Syscoin](/rpc-service/chains/chains-api/syscoin/). [All methods ->](/rpc-service/chains/chains-api/syscoin/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/syscoin/web3-p2/) · [3](/rpc-service/chains/chains-api/syscoin/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v4.3.0-stable-1806d2e5/linux-amd64/go1.17.2", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "57" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x59682f4d" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3cbfc" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address to check for balance. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x1FEdCaf5b29259a24C79D3Dfec099b4766AD9ca4", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2353517713f8b5afc98" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address of the storage (hex encoded). 2. `` (quantity; required): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes; required): an address. 2. `` (quantity|tag; required): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x1FEdCaf5b29259a24C79D3Dfec099b4766AD9ca4", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4211" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x7eace4b2007fa0be67f0c555ff1b73d9ec246de2b9549d5bb451667d01df7d1e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x31" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x3CB3D"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x31" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block's hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x25acbbcaf2446cf8b15dfb0521448e68702cf11815bbd6f81bda56f3b527e47a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x3C962"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xb1398c4D958B97c181Df60148678f04eCEc62c69", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/syscoin/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/ title: TAC — Cosmos REST methods (2/4) source: docs/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2.mdx --- # TAC — Cosmos REST methods (2/4) > API reference for [TAC](/rpc-service/chains/chains-api/tac/). [All methods ->](/rpc-service/chains/chains-api/tac/#methods) > > Part 2 of 4: [1](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/) · 2 · [3](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/) · [4](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p4/) ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators` > Retrieves all validators info for given delegator address. #### Parameters * `delegator_addr` (string; required): a delegator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Validator info for a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators ``` #### Response example ```json { "validators": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:06:38.006Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:06:38.006Z" }, "min_self_delegation": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}` > Retrieves validator info for a given delegator-validator pair. #### Parameters * `delegator_addr` (string; required): a delegator address to query for. * `validator_addr` (string; required): a validator address to query for. #### Returns Validator info for a given delegator pair. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr} ``` #### Response example ```json { "validator": { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:08:34.100Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:08:34.100Z" }, "min_self_delegation": "string" } } ``` --- ### `/cosmos/staking/v1beta1/historical_info/{height}` > Retrieves the historical info for a given height. #### Parameters * `height` (string, int64): defines at which height to query the historical info for. #### Returns Historical info for a given height. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/historical_info/{height} ``` #### Response example ```json { "hist": { "header": { "version": { "block": "string", "app": "string" }, "chain_id": "string", "height": "string", "time": "2021-01-19T07:13:57.974Z", "last_block_id": { "hash": "string", "part_set_header": { "total": 0, "hash": "string" } }, "last_commit_hash": "string", "data_hash": "string", "validators_hash": "string", "next_validators_hash": "string", "consensus_hash": "string", "app_hash": "string", "last_results_hash": "string", "evidence_hash": "string", "proposer_address": "string" }, "valset": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:13:57.974Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:13:57.974Z" }, "min_self_delegation": "string" } ] } } ``` --- ### `/cosmos/staking/v1beta1/params` > Retrieves the staking parameters. #### Parameters None. #### Returns Staking parameters. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/params ``` #### Response example ```json { "params": { "unbonding_time": "string", "max_validators": 0, "max_entries": 0, "historical_entries": 0, "bond_denom": "string" } } ``` --- ### `/cosmos/staking/v1beta1/pool` > Retrieves the pool info. #### Parameters None. #### Returns Pool info. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/pool ``` #### Response example ```json { "pool": { "not_bonded_tokens": "string", "bonded_tokens": "string" } } ``` --- ### /cosmos/staking/v1beta1/validators > Retrieves all validators that match the given status. #### Parameters * `status` (string): a status to query validators by. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Validators that match the given status. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/validators ``` #### Response example ```json { "validators": [ { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:21:25.914Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:21:25.914Z" }, "min_self_delegation": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}` > Retrieves validator info for a given validator address. #### Parameters * `validator_addr` (string; required): a validator address to query for. #### Returns Validator info for a given validator address. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/validators/{validator_addr} ``` #### Response example ```json { "validator": { "operator_address": "string", "consensus_pubkey": { "type_url": "string", "value": "string" }, "jailed": true, "status": "BOND_STATUS_UNSPECIFIED", "tokens": "string", "delegator_shares": "string", "description": { "moniker": "string", "identity": "string", "website": "string", "security_contact": "string", "details": "string" }, "unbonding_height": "string", "unbonding_time": "2021-01-19T07:25:26.679Z", "commission": { "commission_rates": { "rate": "string", "max_rate": "string", "max_change_rate": "string" }, "update_time": "2021-01-19T07:25:26.679Z" }, "min_self_delegation": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations` > Retrieves delegate info for a given validator. #### Parameters * `validator_addr` (string; required): a validator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` `string, uint64`: a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Delegate info for a given validator. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/validators/{validator_addr}/delegations ``` #### Response example ```json { "delegation_responses": [ { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}` > Retrieves delegate info for a given validator-delegator pair. #### Parameters * `validator_addr` (string; required): a validator address to query for. * `delegator_addr` (string; required): a delegator address to query for. #### Returns Delegate info for a given validator delegator pair. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr} ``` #### Response example ```json { "delegation_response": { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation` > Retrieves unbonding info for a given validator-delegator pair. #### Parameters * `validator_addr` (string; required): a validator address to query for. * `delegator_addr` (string; required): a delegator address to query for. #### Returns Unbonding info for a given validator delegator pair. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation ``` #### Response example ```json { "unbond": { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T07:35:28.235Z", "initial_balance": "string", "balance": "string" } ] } } ``` --- ### `/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations` > Retrieves unbonding delegations of a validator. #### Parameters * `validator_addr` (string, required): a validator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Unbonding info for a given validator. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations ``` #### Response example ```json { "unbonding_responses": [ { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T07:37:20.281Z", "initial_balance": "string", "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### Upgrade methods ### `/cosmos/upgrade/v1beta1/applied_plan/{name}` > Retrieves a previously applied upgrade plan by its name. #### Parameters * `name` (string; required): a name of the applied plan to query for. #### Returns Previously applied upgrade plan. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/upgrade/v1beta1/applied_plan/{name} ``` #### Response example ```json { "height": "string" } ``` --- ### `/cosmos/upgrade/v1beta1/current_plan` > Retrieves the current upgrade plan. #### Parameters * `name` (string; required): a name of the applied plan to query for. #### Returns Current upgrade plan. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/upgrade/v1beta1/current_plan ``` #### Response example ```json { "plan": { "name": "string", "time": "2021-01-19T07:49:08.875Z", "height": "string", "info": "string", "upgraded_client_state": { "type_url": "string", "value": "string" } } } ``` --- ### `/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}` > Retrieves the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain, not supported with legacy querier. #### Parameters * `last_height` (string, int64): a required last height under which next consensus state is stored. #### Returns Consensus state. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height} ``` #### Response example ```json { "upgraded_consensus_state": { "type_url": "string", "value": "string" } } ``` --- ### Ibc core methods ### `/ibc/core/channel/v1beta1/channels` > Retrieves all the IBC channels of a chain. #### Parameters * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns IBC channels of a chain. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels ``` #### Response example ```json { "channels": [ { "state": "STATE_UNINITIALIZED_UNSPECIFIED", "ordering": "ORDER_NONE_UNSPECIFIED", "counterparty": { "port_id": "string", "channel_id": "string" }, "connection_hops": [ "string" ], "version": "string", "port_id": "string", "channel_id": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}` > Retrieves an IBC Channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. #### Returns IBC channels of a chain. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id} ``` #### Response example ```json { "channel": { "state": "STATE_UNINITIALIZED_UNSPECIFIED", "ordering": "ORDER_NONE_UNSPECIFIED", "counterparty": { "port_id": "string", "channel_id": "string" }, "connection_hops": [ "string" ], "version": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state` > Retrieves the client state for the channel associated with the provided channel identifiers. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. #### Returns Client state. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state ``` #### Response example ```json { "identified_client_state": { "client_id": "string", "client_state": { "type_url": "string", "value": "string" } }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}` > Retrieves the consensus state for the channel associated with the provided channel identifiers. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `revision_number` (string, uint64; required): a revision number of the consensus state. * `revision_height` string, uint64; required: a revision height of the consensus state. #### Returns Consensus state. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height} ``` #### Response example ```json { "consensus_state": { "type_url": "string", "value": "string" }, "client_id": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence` > Retrieves the next receive sequence for a given channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. #### Returns Next receive sequence. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence ``` #### Response example ```json { "next_sequence_receive": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements` > Retrieves all the packet acknowledgements associated with a channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Packet acknowledgements. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements ``` #### Response example ```json { "acknowledgements": [ { "port_id": "string", "channel_id": "string", "sequence": "string", "data": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/ title: TAC — Cosmos REST methods (3/4) source: docs/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3.mdx --- # TAC — Cosmos REST methods (3/4) > API reference for [TAC](/rpc-service/chains/chains-api/tac/). [All methods ->](/rpc-service/chains/chains-api/tac/#methods) > > Part 3 of 4: [1](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/) · [2](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/) · 3 · [4](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p4/) ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}` > Retrieves a stored packet acknowledgement hash. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `sequence` (string, uint64): a packet sequence. #### Returns Packet acknowledgements. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence} ``` #### Response example ```json { "acknowledgement": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments` > Retrieves all the packet commitments hashes associated with a channel. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Packet commitments. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments ``` #### Response example ```json { "commitments": [ { "port_id": "string", "channel_id": "string", "sequence": "string", "data": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks` > Retrieves all the unreceived IBC acknowledgements associated with a channel and sequences. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `packet_ack_sequence` (array[string]): a required list of acknowledgement sequences. #### Returns Unreceived IBC acknowledgements. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks ``` #### Response example ```json { "sequences": [ "string" ], "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets` > Retrieves all the unreceived IBC packets associated with a channel and sequences. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `packet_commitment_sequences` (array[string]): a list of packet sequences. #### Returns Unreceived IBC packets. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets ``` #### Response example ```json { "sequences": [ "string" ], "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}` > Retrieves a stored packet commitment hash. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `packet_commitment_sequences` (array[string]): a list of packet sequences. #### Returns Packet commitment hash. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence} ``` #### Response example ```json { "commitment": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}` > Checks whether a given packet sequence has been received on the queried chain. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `port_id` (string; required): a port unique identifier. * `sequence` (string, uint64): a required packet sequence. #### Returns Whether the given packet has been received or not. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence} ``` #### Response example ```json { "received": true, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/channel/v1beta1/connections/{connection}/channels` > Retrieves all the channels associated with a connection end. #### Parameters * `connection` (string, required): a connection unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` string($uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Channels associated with a connection. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/channel/v1beta1/connections/{connection}/channels ``` #### Response example ```json { "channels": [ { "state": "STATE_UNINITIALIZED_UNSPECIFIED", "ordering": "ORDER_NONE_UNSPECIFIED", "counterparty": { "port_id": "string", "channel_id": "string" }, "connection_hops": [ "string" ], "version": "string", "port_id": "string", "channel_id": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/client/v1beta1/params` > Retrieves all parameters of the IBC client. #### Parameters None. #### Returns Params of the IBC client. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/client/v1beta1/params ``` #### Response example ```json { "params": { "allowed_clients": [ "string" ] } } ``` --- ### `/ibc/core/client/v1beta1/client_states` > Retrieves all the IBC light clients of a chain. #### Parameters * `pagination.key` (string; byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string; uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string; uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns IBC light clients. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/client/v1beta1/client_states ``` #### Response example ```json { "client_states": [ { "client_id": "string", "client_state": { "type_url": "string", "value": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/ibc/core/client/v1beta1/client_states/{client_id}` > Retrieves an IBC light client. #### Parameters * `client_id` (string; required): a client state unique identifier. #### Returns IBC light client from client_id. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/client/v1beta1/client_states/{client_id} ``` #### Response example ```json { "client_state": { "type_url": "string", "value": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/client/v1beta1/consensus_states/{client_id}` > Retrieves all the consensus state associated with a given client. #### Parameters * `client_id` (string; required): a client unique identifier. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Consensus state associated with given client #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/client/v1beta1/consensus_states/{client_id} ``` #### Response example ```json { "consensus_states": [ { "height": { "revision_number": "string", "revision_height": "string" }, "consensus_state": { "type_url": "string", "value": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}` > Retrieves a consensus state associated with a client state at a given height. #### Parameters * `channel_id` (string; required): a channel unique identifier. * `revision_number` (string, uint64): a required consensus state revision number. * `revision_height`(string, uint64): a required consensus state revision height. * `latest_height` (boolean): overrides the height field and queries the latest stored consensus state. #### Returns Consensus state associated with a client state at a given height. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height} ``` #### Response example ```json { "consensus_state": { "type_url": "string", "value": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/client_connections/{client_id}` > Retrieves the connection paths associated with a client state. #### Parameters * `client_id` (string, required): a client identifier associated with a connection. #### Returns Connections paths associated with a client state. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/connection/v1beta1/client_connections/{client_id} ``` #### Response example ```json { "connection_paths": [ "string" ], "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/connections` > Retrieves all the IBC connections of a chain. #### Parameters * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns IBC connections. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/connection/v1beta1/connections ``` #### Response example ```json { "connections": [ { "id": "string", "client_id": "string", "versions": [ { "identifier": "string", "features": [ "string" ] } ], "state": "STATE_UNINITIALIZED_UNSPECIFIED", "counterparty": { "client_id": "string", "connection_id": "string", "prefix": { "key_prefix": "string" } }, "delay_period": "string" } ], "pagination": { "next_key": "string", "total": "string" }, "height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/connections/{connection_id}` > Retrieves an IBC connection end. #### Parameters * `connection_id` (string; required): a connection unique identifier. #### Returns IBC connections end. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/connection/v1beta1/connections/{connection_id} ``` #### Response example ```json { "connection": { "client_id": "string", "versions": [ { "identifier": "string", "features": [ "string" ] } ], "state": "STATE_UNINITIALIZED_UNSPECIFIED", "counterparty": { "client_id": "string", "connection_id": "string", "prefix": { "key_prefix": "string" } }, "delay_period": "string" }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/connections/{connection_id}/client_state` > Retrieves the client state associated with the connection. #### Parameters * `connection_id` (string; required): a connection unique identifier. #### Returns Client state. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/connection/v1beta1/connections/{connection_id}/client_state ``` #### Response example ```json { "identified_client_state": { "client_id": "string", "client_state": { "type_url": "string", "value": "string" } }, "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### `/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}` > Retrieves the consensus state associated with the connection. #### Parameters * `connection_id` (string; required): a connection unique identifier. * `revision_number` (string, uint64): a required revision number. * `revision_height` (string, uint64): a required revision height. #### Returns Consensus state. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height} ``` #### Response example ```json { "consensus_state": { "type_url": "string", "value": "string" }, "client_id": "string", "proof": "string", "proof_height": { "revision_number": "string", "revision_height": "string" } } ``` --- ### Ibc applications methods ### `/ibc/applications/transfer/v1beta1/denom_traces` > Retrieves all denomination traces. #### Parameters * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Denomination traces. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/applications/transfer/v1beta1/denom_traces ``` #### Response example ```json { "denom_traces": [ { "path": "string", "base_denom": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/ibc/applications/transfer/v1beta1/denom_traces/{hash}` > Retrieves a denomination trace information by hash. #### Parameters * `hash` (string, hex; required): a hash of the denomination trace information. #### Returns Denomination traces. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/applications/transfer/v1beta1/denom_traces/{hash} ``` #### Response example ```json { "denom_trace": { "path": "string", "base_denom": "string" } } ``` --- ### `/ibc/applications/transfer/v1beta1/params` > Retrieves all parameters of the IBC transfer module. #### Parameters None. #### Returns Parameters of the IBC transfer module. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/ibc/applications/transfer/v1beta1/params ``` #### Response example ```json { "params": { "send_enabled": true, "receive_enabled": true } } ``` --- ### Tx methods ### `/cosmos/tx/v1beta1/simulate` > Simulates executing a transaction for estimating gas usage. #### Parameters * `` (object; required): ```json { "tx": { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] } } ``` #### Returns Estimated gas usage. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/tx/v1beta1/simulate ```` #### Response example ```json { "gas_info": { "gas_wanted": "string", "gas_used": "string" }, "result": { "data": "string", "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string", "index": true } ] } ] } } ``` --- ### `/cosmos/tx/v1beta1/txs` > Fetches txs by event. #### Parameters * `events` (array[string]): a list of transaction event type. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Transactions. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/tx/v1beta1/txs ``` #### Response example ```json { "txs": [ { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] } ], "tx_responses": [ { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p4/ title: TAC — Cosmos REST methods (4/4) source: docs/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p4.mdx --- # TAC — Cosmos REST methods (4/4) > API reference for [TAC](/rpc-service/chains/chains-api/tac/). [All methods ->](/rpc-service/chains/chains-api/tac/#methods) > > Part 4 of 4: [1](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/) · [2](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/) · [3](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/) · 4 ### `/cosmos/tx/v1beta1/txs` > Broadcasts a transaction. #### Parameters * `` (object; required): ```json { "tx_bytes": "string", "mode": "BROADCAST_MODE_UNSPECIFIED" } ``` #### Returns Broadcasted transaction. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/tx/v1beta1/txs ```` #### Response example ```json { "tx_response": { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } } ``` --- ### `/cosmos/tx/v1beta1/txs/{hash}` > Fetches a tx by hash. #### Parameters * `hash` (string, hex; required): a tx hash to query, encoded as a hex string. #### Returns Transaction. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/tx/v1beta1/txs/{hash} ``` #### Response example ```json { "tx": { "body": { "messages": [ { "type_url": "string", "value": "string" } ], "memo": "string", "timeout_height": "string", "extension_options": [ { "type_url": "string", "value": "string" } ], "non_critical_extension_options": [ { "type_url": "string", "value": "string" } ] }, "auth_info": { "signer_infos": [ { "public_key": { "type_url": "string", "value": "string" }, "mode_info": { "single": { "mode": "SIGN_MODE_UNSPECIFIED" }, "multi": { "bitarray": { "extra_bits_stored": 0, "elems": "string" }, "mode_infos": [ null ] } }, "sequence": "string" } ], "fee": { "amount": [ { "denom": "string", "amount": "string" } ], "gas_limit": "string", "payer": "string", "granter": "string" } }, "signatures": [ "string" ] }, "tx_response": { "height": "string", "txhash": "string", "codespace": "string", "code": 0, "data": "string", "raw_log": "string", "logs": [ { "msg_index": 0, "log": "string", "events": [ { "type": "string", "attributes": [ { "key": "string", "value": "string" } ] } ] } ], "info": "string", "gas_wanted": "string", "gas_used": "string", "tx": { "type_url": "string", "value": "string" }, "timestamp": "string" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tac/cosmos-rest-methods/ title: TAC — Cosmos REST methods (1/4) source: docs/rpc-service/chains/chains-api/tac/cosmos-rest-methods.mdx --- # TAC — Cosmos REST methods (1/4) > API reference for [TAC](/rpc-service/chains/chains-api/tac/). [All methods ->](/rpc-service/chains/chains-api/tac/#methods) > > Part 1 of 4: 1 · [2](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/) · [3](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/) · [4](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p4/) ### `/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards` > Retrieves the rewards of a validator address. #### Parameters * `validator_address` (string; required): validator address to query for. #### Returns Total outstanding rewards for a validator. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards ``` #### Response example ```json { "rewards": { "rewards": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/slashes` > Retrieves slash events of a validator. #### Parameters * `validator_address` (string; required): a validator address to query for. * `starting_height` (string, uint64): the optional starting height to query the hashes * `ending_height` (string, uint64): the optional ending height to query the hashes * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns All slash events of a validator. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/validators/{validator_address}/slashes ``` #### Response example ```json { "slashes": [ { "validator_period": "string", "fraction": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### Evidence methods ### `/cosmos/evidence/v1beta1/evidence` > Retrieves all evidence. #### Parameters * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns All evidence. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/evidence/v1beta1/evidence ``` #### Response example ```json { "evidence": [ { "type_url": "string", "value": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/evidence/v1beta1/evidence/{evidence_hash}` > Retrieves evidence based on evidence hash. #### Parameters * `evidence_hash` (string, byte): the hash of the requested evidence. #### Returns Evidence for a given hash. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/evidence/v1beta1/evidence/{evidence_hash} ``` #### Response example ```json { "evidence": { "type_url": "string", "value": "string" } } ``` --- ### Gov methods ### `/cosmos/gov/v1beta1/params/{params_type}` > Retrieves all parameters of the gov module. #### Parameters * `params_type` (string, required): parameters to query for; possible values: `voting`, `tallying`, or `deposit`. #### Returns Parameters of the gov module. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/gov/v1beta1/params/{params_type} ``` #### Response example ```json { "voting_params": { "voting_period": "string" }, "deposit_params": { "min_deposit": [ { "denom": "string", "amount": "string" } ], "max_deposit_period": "string" }, "tally_params": { "quorum": "string", "threshold": "string", "veto_threshold": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals` > Retrieves all proposals based on given status. #### Parameters * `proposal_status`: defines status of the proposals. See below for different options. Default value = PROPOSAL_STATUS_UNSPECIFIED. Other statuses: * `PROPOSAL_STATUS_UNSPECIFIED`: default proposal status. * `PROPOSAL_STATUS_DEPOSIT_PERIOD`: defines a proposal status during the deposit period. * `PROPOSAL_STATUS_VOTING_PERIOD`: defines a proposal status during the voting period. * `PROPOSAL_STATUS_PASSED`: defines a proposal status of a proposal that has passed. * `PROPOSAL_STATUS_REJECTED`: defines a proposal status of a proposal that has been rejected. * `PROPOSAL_STATUS_FAILED`: defines a proposal status of a proposal that has failed. * `voter` (string): defines the voter address for the proposals. * `depositor` (string): defines the deposit addresses from the proposals. * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Proposals based on given status. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/gov/v1beta1/proposals ``` #### Response example ```json { "proposals": [ { "proposal_id": "string", "content": { "type_url": "string", "value": "string" }, "status": "PROPOSAL_STATUS_UNSPECIFIED", "final_tally_result": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" }, "submit_time": "2021-01-19T03:03:05.413Z", "deposit_end_time": "2021-01-19T03:03:05.413Z", "total_deposit": [ { "denom": "string", "amount": "string" } ], "voting_start_time": "2021-01-19T03:03:05.413Z", "voting_end_time": "2021-01-19T03:03:05.413Z" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}` > Retrieves proposal details based on `ProposalID`. #### Parameters * `proposal_id` (string; required): a unique id of the proposal. #### Returns Proposal details based on proposalID. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id} ``` #### Response example ```json { "proposal": { "proposal_id": "string", "content": { "type_url": "string", "value": "string" }, "status": "PROPOSAL_STATUS_UNSPECIFIED", "final_tally_result": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" }, "submit_time": "2021-01-19T03:30:27.807Z", "deposit_end_time": "2021-01-19T03:30:27.807Z", "total_deposit": [ { "denom": "string", "amount": "string" } ], "voting_start_time": "2021-01-19T03:30:27.807Z", "voting_end_time": "2021-01-19T03:30:27.807Z" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` > Retrieves all deposits of a single proposal. #### Parameters * `proposal_id` (string, uint64; required): a unique id of the proposal. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns All deposits based on a proposalID. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits ``` #### Response example ```json { "deposits": [ { "proposal_id": "string", "depositor": "string", "amount": [ { "denom": "string", "amount": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}` > Retrieves single deposit information based `proposalID` and `depositAddr`. #### Parameters * `proposal_id` (string, uint64): a required unique id of the proposal. * `depositor` (string): the deposit addresses from the proposals. #### Returns Single deposit based on a proposalID. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor} ``` #### Response example ```json { "deposit": { "proposal_id": "string", "depositor": "string", "amount": [ { "denom": "string", "amount": "string" } ] } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/tally` > Retrieves the tally of a proposal vote. #### Parameters * `proposal_id` (string, uint64): a required unique ID of the proposal. #### Returns Tally of proposal vote. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id}/tally ``` #### Response example ```json { "tally": { "yes": "string", "abstain": "string", "no": "string", "no_with_veto": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/votes` > Retrieves the votes of a given proposal. #### Parameters * `proposal_id` (string($uint64), required): a unique id of the proposal * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Votes for a given proposal. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id}/votes ``` #### Response example ```json { "votes": [ { "proposal_id": "string", "voter": "string", "option": "VOTE_OPTION_UNSPECIFIED" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}` > Retrieves voted information based on `proposalID` and `voterAddr`. #### Parameters * `proposal_id` (string, uint64; required): a unique ID of the proposal. * `voter` (string): the other address for the proposals. #### Returns Votes for a given proposal. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter} ``` #### Response example ```json { "vote": { "proposal_id": "string", "voter": "string", "option": "VOTE_OPTION_UNSPECIFIED" } } ``` --- ### Mint methods ### `/cosmos/mint/v1beta1/annual_provisions` > Retrieves the current minting annual provisions value. #### Parameters None. #### Returns Value of minting annual provisions. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/mint/v1beta1/annual_provisions ``` #### Response example ```json { "error": "string", "code": 0, "message": "string", "details": [ { "type_url": "string", "value": "string" } ] } ``` --- ### `/cosmos/mint/v1beta1/inflation` > Retrieves the current minting inflation value. #### Parameters None. #### Returns Current minting inflation value. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/mint/v1beta1/inflation ``` #### Response example ```json { "inflation": "string" } ``` --- ### `/cosmos/mint/v1beta1/params` > Retrieves the total set of minting parameters #### Parameters None. #### Returns Total set of minting params. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/mint/v1beta1/params ``` #### Response example ```json { "params": { "mint_denom": "string", "inflation_rate_change": "string", "inflation_max": "string", "inflation_min": "string", "goal_bonded": "string", "blocks_per_year": "string" } } ``` --- ### Slashing methods ### `/cosmos/slashing/v1beta1/params` > Retrieves the slashing module parameters. #### Parameters None. #### Returns The parameters of a slashing module. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/slashing/v1beta1/params ``` #### Response example ```json { "params": { "signed_blocks_window": "string", "min_signed_per_window": "string", "downtime_jail_duration": "string", "slash_fraction_double_sign": "string", "slash_fraction_downtime": "string" } } ``` --- ### `/cosmos/slashing/v1beta1/signing_infos` > Retrieves signing info of all validators. #### Parameters * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns The signing info of all validators. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/slashing/v1beta1/signing_infos ``` #### Response example ```json { "info": [ { "address": "string", "start_height": "string", "index_offset": "string", "jailed_until": "2021-01-19T06:33:32.230Z", "tombstoned": true, "missed_blocks_counter": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/slashing/v1beta1/signing_infos/{cons_address}` > Retrieves the signing info of given cons address. #### Parameters * `cons_address` (string, required): an address to query signing info for. #### Returns The signing info of all specified cons address. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/slashing/v1beta1/signing_infos/{cons_address} ``` #### Response example ```json { "val_signing_info": { "address": "string", "start_height": "string", "index_offset": "string", "jailed_until": "2021-01-19T06:34:40.106Z", "tombstoned": true, "missed_blocks_counter": "string" } } ``` --- ### Staking methods ### `/cosmos/staking/v1beta1/delegations/{delegator_addr}` > Retrieves all delegations of a given delegator address. #### Parameters * `delegator_addr` (string, required): a delegator address to query for. * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Delegations from a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/delegations/{delegator_addr} ``` #### Response example ```json { "delegation_responses": [ { "delegation": { "delegator_address": "string", "validator_address": "string", "shares": "string" }, "balance": { "denom": "string", "amount": "string" } } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations` > Retrieves the redelegations of a given address. #### Parameters * `delegator_addr` (string, required): a delegator address to query for. * `src_validator_addr` (string): the validator address to redelegate from. * `dst_validator_addr` (string): the validator address to redelegate to. * `pagination.key` (string, byte): a value returned in PageResponse.next_key to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` `string, uint64`: a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Delegations from a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations ``` #### Response example ```json { "redelegation_responses": [ { "redelegation": { "delegator_address": "string", "validator_src_address": "string", "validator_dst_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T06:58:45.718Z", "initial_balance": "string", "shares_dst": "string" } ] }, "entries": [ { "redelegation_entry": { "creation_height": "string", "completion_time": "2021-01-19T06:58:45.718Z", "initial_balance": "string", "shares_dst": "string" }, "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- ### `/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations` > Retrieves all unbonding delegations of a given delegator address. #### Parameters * `delegator_addr` (string, required): a delegator address to query for. * `pagination.key` (string, byte): a value returned in `PageResponse.next_key` to begin querying the next page efficiently. Only one of `offset` or `key` should be set. * `pagination.key` (string, uint64): a numeric offset that can be used when key is unavailable (less efficient than using key). Only one of `offset` or `key` should be set. * `pagination.limit` (string, uint64): a total number of results to be returned in the results page. If empty, will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in the UIs. Only respected when `offset` is used, ignored when `key` is set. #### Returns Unbonding delegations from a specific delegator address. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations ``` #### Response example ```json { "unbonding_responses": [ { "delegator_address": "string", "validator_address": "string", "entries": [ { "creation_height": "string", "completion_time": "2021-01-19T07:01:25.628Z", "initial_balance": "string", "balance": "string" } ] } ], "pagination": { "next_key": "string", "total": "string" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tac/ title: TAC description: TAC (Tokenized Asset Chain) is a network extension for TON (The Open Network) that enhances its compatibility… 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/tac/index.mdx --- # TAC
> TAC API is available on [Web3 API platform](https://www.ankr.com/rpc/tac). TAC (Tokenized Asset Chain) is a network extension for TON (The Open Network) that enhances its compatibility with the Ethereum Virtual Machine (EVM). It allows users to access EVM applications directly through their TON wallets, eliminating the need to manage multiple wallets or use traditional bridges. In order for your Web3 application to interact with TAC — either by reading blockchain data or sending transactions to the network — it must connect to a TAC node. Developers interact with the blockchain using the methods provided by the API. We support the following networks and protocols for TAC: * [EVM JSON-RPC API](/rpc-service/chains/chains-api/tac/#evm-json-rpc-methods) * [Tendermint JSON-RPC/REST API](/rpc-service/chains/chains-api/tac/#tendermint-json-rpcrest-methods) * [Cosmos REST API](/rpc-service/chains/chains-api/tac/#cosmos-rest-methods) * Cosmos gRPC Responses come in [JSON format](https://www.json.org/json-en.html). ## EVM JSON-RPC methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/tac/methods/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/tac/methods/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/tac/methods/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/tac/methods/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/tac/methods/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/tac/methods/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/tac/methods/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/tac/methods/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/tac/methods/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/tac/methods/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/tac/methods/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/tac/methods/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/tac/methods/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/tac/methods/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/tac/methods/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/tac/methods/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/tac/methods/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/tac/methods/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/tac/methods-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/tac/methods-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tac/methods-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/tac/methods-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Tendermint JSON-RPC/REST methods **Info — node information**: * [`blockchain`](/rpc-service/chains/chains-api/tac/information/#blockchain) — retrieves block headers (max: 20) for `minHeight <= height <= maxHeight`. * [`block`](/rpc-service/chains/chains-api/tac/information/#block) — retrieves a block at a specified height. * [`block_by_hash`](/rpc-service/chains/chains-api/tac/information/#block_by_hash) — retrieves a block by hash. * [`block_results`](/rpc-service/chains/chains-api/tac/information/#block_results) — retrieves block results at a specified height. * [`commit`](/rpc-service/chains/chains-api/tac/information/#commit) — retrieves commit results at a specified height. * [`validators`](/rpc-service/chains/chains-api/tac/information/#validators) — retrieves a validator set at a specified height. * [`genesis_chunked`](/rpc-service/chains/chains-api/tac/information/#genesis_chunked) — retrieves the Genesis in multiple chunks. * [`dump_consensus_state`](/rpc-service/chains/chains-api/tac/information/#dump_consensus_state) — retrieves consensus state. * [`consensus_state`](/rpc-service/chains/chains-api/tac/information-p2/#consensus_state) — retrieves consensus state. * [`consensus_params`](/rpc-service/chains/chains-api/tac/information-p2/#consensus_params) — retrieves consensus parameters. * [`unconfirmed_txs`](/rpc-service/chains/chains-api/tac/information-p2/#unconfirmed_txs) — retrieves the list of unconfirmed transactions. * [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/tac/information-p2/#num_unconfirmed_txs) — retrieves data about unconfirmed transactions. * [`tx_search`](/rpc-service/chains/chains-api/tac/information-p2/#tx_search) — searches for transactions. * [`block_search`](/rpc-service/chains/chains-api/tac/information-p2/#block_search) — searches for blocks by `BeginBlock` and `EndBlock` events. * [`tx`](/rpc-service/chains/chains-api/tac/information-p2/#tx) — retrieves transactions by hash. **Tx — transactions broadcast information**: * [`broadcast_tx_sync`](/rpc-service/chains/chains-api/tac/information-p2/#broadcast_tx_sync) — returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. * [`broadcast_tx_async`](/rpc-service/chains/chains-api/tac/information-p2/#broadcast_tx_async) — returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. * [`broadcast_tx_commit`](/rpc-service/chains/chains-api/tac/information-p2/#broadcast_tx_commit) — returns with the responses from `CheckTx` and `DeliverTx`. * [`check_tx`](/rpc-service/chains/chains-api/tac/information-p2/#check_tx) — checks the transaction without executing it. **ABCI — ABCI info**: * [`abci_info`](/rpc-service/chains/chains-api/tac/information-p2/#abci_info) — retrieves info about the application. * [`abci_query`](/rpc-service/chains/chains-api/tac/information-p2/#abci_query) — queries the application for some information. --- ## Methods ### Methods - [`web3_clientVersion`](/rpc-service/chains/chains-api/tac/methods/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/tac/methods/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/tac/methods/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/tac/methods/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/tac/methods/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/tac/methods/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/tac/methods/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/tac/methods/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/tac/methods/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/tac/methods/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/tac/methods/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/tac/methods/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/tac/methods/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/tac/methods/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/tac/methods/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/tac/methods/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/tac/methods/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/tac/methods/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tac/methods-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/tac/methods-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/tac/methods-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tac/methods-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/tac/methods-p3/#eth_getlogs) ### Information, Transactions, ABCI, Cosmos REST methods - [`blockchain`](/rpc-service/chains/chains-api/tac/information/#blockchain) - [`block`](/rpc-service/chains/chains-api/tac/information/#block) - [`block_by_hash`](/rpc-service/chains/chains-api/tac/information/#block_by_hash) - [`block_results`](/rpc-service/chains/chains-api/tac/information/#block_results) - [`commit`](/rpc-service/chains/chains-api/tac/information/#commit) - [`validators`](/rpc-service/chains/chains-api/tac/information/#validators) - [`genesis_chunked`](/rpc-service/chains/chains-api/tac/information/#genesis_chunked) - [`dump_consensus_state`](/rpc-service/chains/chains-api/tac/information/#dump_consensus_state) - [`consensus_state`](/rpc-service/chains/chains-api/tac/information-p2/#consensus_state) - [`consensus_params`](/rpc-service/chains/chains-api/tac/information-p2/#consensus_params) - [`unconfirmed_txs`](/rpc-service/chains/chains-api/tac/information-p2/#unconfirmed_txs) - [`num_unconfirmed_txs`](/rpc-service/chains/chains-api/tac/information-p2/#num_unconfirmed_txs) - [`tx_search`](/rpc-service/chains/chains-api/tac/information-p2/#tx_search) - [`block_search`](/rpc-service/chains/chains-api/tac/information-p2/#block_search) - [`tx`](/rpc-service/chains/chains-api/tac/information-p2/#tx) - [`broadcast_tx_sync`](/rpc-service/chains/chains-api/tac/information-p2/#broadcast_tx_sync) - [`Parameters`](/rpc-service/chains/chains-api/tac/methods/#parameters) - [`broadcast_tx_async`](/rpc-service/chains/chains-api/tac/information-p2/#broadcast_tx_async) - [`broadcast_tx_commit`](/rpc-service/chains/chains-api/tac/information-p2/#broadcast_tx_commit) - [`check_tx`](/rpc-service/chains/chains-api/tac/information-p2/#check_tx) - [`abci_info`](/rpc-service/chains/chains-api/tac/information-p2/#abci_info) - [`abci_query`](/rpc-service/chains/chains-api/tac/information-p2/#abci_query) - [`Auth methods`](/rpc-service/chains/chains-api/tac/information-p2/#auth-methods) - [`/cosmos/auth/v1beta1/accounts/{address}`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosauthv1beta1accountsaddress) - [`/cosmos/auth/v1beta1/params`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosauthv1beta1params) - [`Bank methods`](/rpc-service/chains/chains-api/tac/information-p2/#bank-methods) - [`/cosmos/bank/v1beta1/balances/{address}`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosbankv1beta1balancesaddress) - [`/cosmos/bank/v1beta1/balances/{address}/{denom}`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosbankv1beta1balancesaddressdenom) - [`/cosmos/bank/v1beta1/params`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosbankv1beta1params) - [`/cosmos/bank/v1beta1/supply`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosbankv1beta1supply) - [`Distribution methods`](/rpc-service/chains/chains-api/tac/information-p2/#distribution-methods) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosdistributionv1beta1delegatorsdelegator_addressrewards) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosdistributionv1beta1delegatorsdelegator_addressrewardsvalidator_address) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosdistributionv1beta1delegatorsdelegator_addressvalidators) - [`/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosdistributionv1beta1delegatorsdelegator_addresswithdraw_address) - [`/cosmos/distribution/v1beta1/params`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosdistributionv1beta1params) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/commission`](/rpc-service/chains/chains-api/tac/information-p2/#cosmosdistributionv1beta1validatorsvalidator_addresscommission) ### Cosmos REST methods - [`/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosdistributionv1beta1validatorsvalidator_addressoutstanding_rewards) - [`/cosmos/distribution/v1beta1/validators/{validator_address}/slashes`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosdistributionv1beta1validatorsvalidator_addressslashes) - [`Evidence methods`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#evidence-methods) - [`/cosmos/evidence/v1beta1/evidence`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosevidencev1beta1evidence) - [`/cosmos/evidence/v1beta1/evidence/{evidence_hash}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosevidencev1beta1evidenceevidence_hash) - [`Gov methods`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#gov-methods) - [`/cosmos/gov/v1beta1/params/{params_type}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosgovv1beta1paramsparams_type) - [`/cosmos/gov/v1beta1/proposals`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosgovv1beta1proposals) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_id) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_iddeposits) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_iddepositsdepositor) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/tally`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_idtally) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_idvotes) - [`/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosgovv1beta1proposalsproposal_idvotesvoter) - [`Mint methods`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#mint-methods) - [`/cosmos/mint/v1beta1/annual_provisions`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosmintv1beta1annual_provisions) - [`/cosmos/mint/v1beta1/inflation`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosmintv1beta1inflation) - [`/cosmos/mint/v1beta1/params`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosmintv1beta1params) - [`Slashing methods`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#slashing-methods) - [`/cosmos/slashing/v1beta1/params`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosslashingv1beta1params) - [`/cosmos/slashing/v1beta1/signing_infos`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosslashingv1beta1signing_infos) - [`/cosmos/slashing/v1beta1/signing_infos/{cons_address}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosslashingv1beta1signing_infoscons_address) - [`Staking methods`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#staking-methods) - [`/cosmos/staking/v1beta1/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosstakingv1beta1delegationsdelegator_addr) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosstakingv1beta1delegatorsdelegator_addrredelegations) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#cosmosstakingv1beta1delegatorsdelegator_addrunbonding_delegations) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidators) - [`/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1delegatorsdelegator_addrvalidatorsvalidator_addr) - [`/cosmos/staking/v1beta1/historical_info/{height}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1historical_infoheight) - [`/cosmos/staking/v1beta1/params`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1params) - [`/cosmos/staking/v1beta1/pool`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1pool) - [`/cosmos/staking/v1beta1/validators`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1validators) - [`/cosmos/staking/v1beta1/validators/{validator_addr}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addr) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrdelegations) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addr) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrdelegationsdelegator_addrunbonding_delegation) - [`/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosstakingv1beta1validatorsvalidator_addrunbonding_delegations) - [`Upgrade methods`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#upgrade-methods) - [`/cosmos/upgrade/v1beta1/applied_plan/{name}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosupgradev1beta1applied_planname) - [`/cosmos/upgrade/v1beta1/current_plan`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosupgradev1beta1current_plan) - [`/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#cosmosupgradev1beta1upgraded_consensus_statelast_height) - [`Ibc core methods`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#ibc-core-methods) - [`/ibc/core/channel/v1beta1/channels`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#ibccorechannelv1beta1channels) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#ibccorechannelv1beta1channelschannel_idportsport_id) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/client_state`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#ibccorechannelv1beta1channelschannel_idportsport_idclient_state) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#ibccorechannelv1beta1channelschannel_idportsport_idconsensus_staterevisionrevision_numberheightrevision_height) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/next_sequence`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#ibccorechannelv1beta1channelschannel_idportsport_idnext_sequence) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_acknowledgements) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_ackssequence) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitments) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitmentspacket_ack_sequencesunreceived_acks) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitmentspacket_commitment_sequencesunreceived_packets) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_commitmentssequence) - [`/ibc/core/channel/v1beta1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccorechannelv1beta1channelschannel_idportsport_idpacket_receiptssequence) - [`/ibc/core/channel/v1beta1/connections/{connection}/channels`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccorechannelv1beta1connectionsconnectionchannels) - [`/ibc/client/v1beta1/params`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibcclientv1beta1params) - [`/ibc/core/client/v1beta1/client_states`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccoreclientv1beta1client_states) - [`/ibc/core/client/v1beta1/client_states/{client_id}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccoreclientv1beta1client_statesclient_id) - [`/ibc/core/client/v1beta1/consensus_states/{client_id}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccoreclientv1beta1consensus_statesclient_id) - [`/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccoreclientv1beta1consensus_statesclient_idrevisionrevision_numberheightrevision_height) - [`/ibc/core/connection/v1beta1/client_connections/{client_id}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1client_connectionsclient_id) - [`/ibc/core/connection/v1beta1/connections`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1connections) - [`/ibc/core/connection/v1beta1/connections/{connection_id}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1connectionsconnection_id) - [`/ibc/core/connection/v1beta1/connections/{connection_id}/client_state`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1connectionsconnection_idclient_state) - [`/ibc/core/connection/v1beta1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibccoreconnectionv1beta1connectionsconnection_idconsensus_staterevisionrevision_numberheightrevision_height) - [`Ibc applications methods`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibc-applications-methods) - [`/ibc/applications/transfer/v1beta1/denom_traces`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibcapplicationstransferv1beta1denom_traces) - [`/ibc/applications/transfer/v1beta1/denom_traces/{hash}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibcapplicationstransferv1beta1denom_traceshash) - [`/ibc/applications/transfer/v1beta1/params`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibcapplicationstransferv1beta1params) - [`Tx methods`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#tx-methods) - [`/cosmos/tx/v1beta1/simulate`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#cosmostxv1beta1simulate) - [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#cosmostxv1beta1txs) - [`/cosmos/tx/v1beta1/txs`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#cosmostxv1beta1txs) - [`/cosmos/tx/v1beta1/txs/{hash}`](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p4/#cosmostxv1beta1txshash) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tac/information-p2/ title: TAC — Information, Transactions, ABCI, Cosmos REST methods (2/2) source: docs/rpc-service/chains/chains-api/tac/information-p2.mdx --- # TAC — Information, Transactions, ABCI, Cosmos REST methods (2/2) > API reference for [TAC](/rpc-service/chains/chains-api/tac/). [All methods ->](/rpc-service/chains/chains-api/tac/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/tac/information/) · 2 ## Information ### `consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns Consensus state results. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/consensus_state ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "round_state": { "height/round/step": "2130789/0/1", "start_time": "2025-01-31T10:00:45.687676388Z", "proposal_block_hash": "", "locked_block_hash": "", "valid_block_hash": "", "height_vote_set": [ { "round": 0, "prevotes": [ "nil-Vote", "nil-Vote", "nil-Vote", "nil-Vote" ], "prevotes_bit_array": "BA{4:____} 0/40066000000000400 = 0.00", "precommits": [ "nil-Vote", "nil-Vote", "nil-Vote", "nil-Vote" ], "precommits_bit_array": "BA{4:____} 0/40066000000000400 = 0.00" } ], "proposer": { "address": "0469070A1C182AF11A1939F098C5C2C666116561", "index": 2 } } } } ``` --- ### `consensus_params` > Retrieves consensus parameters. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be returned. #### Returns Consensus parameters results. #### Request parameters ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "consensus_params", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/consensus_params?height=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block_height": "1", "consensus_params": { "block": { "max_bytes": "22020096", "max_gas": "20000000" }, "evidence": { "max_age_num_blocks": "100000", "max_age_duration": "172800000000000", "max_bytes": "1048576" }, "validator": { "pub_key_types": [ "ed25519" ] }, "version": { "app": "0" }, "abci": { "vote_extensions_enable_height": "0" } } } } ``` --- ### `unconfirmed_txs` > Retrieves the list of unconfirmed transactions. #### Parameters
* `limit` (integer; default: 30; max: 100): the maximum number of unconfirmed transactions to return. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "unconfirmed_txs", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/unconfirmed_txs?limit=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "n_txs": "0", "total": "0", "total_bytes": "0", "txs": [] } } ``` --- ### `num_unconfirmed_txs` > Retrieves data on unconfirmed transactions. #### Parameters
None. #### Returns The status of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "num_unconfirmed_txs", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/num_unconfirmed_txs ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "n_txs": "0", "total": "0", "total_bytes": "0", "txs": null } } ``` --- ### `tx_search` > Searches for transactions with their results. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height and txhash. #### Returns The list of unconfirmed transactions. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx_search", "params": { "query": "tx.height=13225811", "prove": true, "page": "1", "per_page": "5", "order_by": "desc" }, "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/tx_search?query=tx.height%3D13225811&prove=true&page=1&per_page=5&order_by=desc ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "txs": [], "total_count": "0" } } ``` --- ### `block_search` > Searches for blocks by `BeginBlock` and `EndBlock` events. #### Parameters
* `query` (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be `=`, `<`, `<=`, `>`, `>=`, `CONTAINS`. An operand can be a string (escaped with single quotes), number, date, or time. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30, max: 100): a number of entries per page. * `order_by` (string; default: asc): the order in which transactions are sorted (`asc` or `desc`), by height & index. If empty, default sorting still applies. * `match_events` (boolean; default: false): match attributes in query within events, in addition to the height. #### Returns The list of paginated blocks matching the search criteria. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_search", "params": { "query": "block.height=13225811", "page": "1", "per_page": "10", "order_by": "desc" }, "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/block_search?query=block.height%3D13225811&page=1&per_page=10&order_by=desc ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blocks": [], "total_count": "0" } } ``` --- ### `tx` > Retrieves a transaction by hash. #### Parameters
* `hash` (string; required): a hash of a transaction to retrieve. * `prove` (boolean; default: false): adds proofs of the transaction's inclusion in the block. #### Returns Transaction info. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "tx", "params": ["ys4oH8G8i3TFkq51/8w/ntGD6YcJda1LVNEwh0cjxQ0=", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/tx?hash=4B6D8FEA3786BFC6152EAEA791C4DAF00C41E93DAD56A7230B565179CD29CAA1&prove=true ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "hash": "4B6D8FEA3786BFC6152EAEA791C4DAF00C41E93DAD56A7230B565179CD29CAA1", "height": "12345", "index": 2, "tx_result": { "code": 0, "log": "Success", "events": [ { "type": "transfer", "attributes": [ { "key": "sender", "value": "0g1xyz..." }, { "key": "recipient", "value": "0g1abc..." }, { "key": "amount", "value": "10000u0g" } ] } ] }, "tx": "BASE64_ENCODED_TX", // The transaction itself in Base64 format "proof": { "root_hash": "0xABC123...", "data": "BASE64_ENCODED_PROOF", "proof": { /* Detailed proof structure */ } } } } ``` --- ## Transactions ### `broadcast_tx_sync` > Returns with the response from `CheckTx`. Does not wait for `DeliverTx` result. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). Please refer to [Tendermint docs](https://docs.tendermint.com/v0.34/tendermint-core/using-tendermint.html#formatting) for formatting/encoding rules. ### Parameters
* `tx` (string; required): the signed transaction, encoded as Base64. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_sync", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/broadcast_tx_sync?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "code": 0, "data": "", "log": "transaction successfully broadcasted", "hash": "0xABC123..." // The transaction hash } } ``` --- ### `broadcast_tx_async` > Returns right away, with no response. Does not wait for `CheckTx` nor `DeliverTx` results. If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen: 1. A malicious node drops or pretends it has committed your tx. 2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322). 3. A node is offline. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the Base64-encoded signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_async", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/broadcast_tx_async?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "code": 0, "data": "", "log": "", "hash": "0xABC123..." // Transaction hash } } ``` --- ### `broadcast_tx_commit` > Returns with the responses from `CheckTx` and `DeliverTx`. :::warning Use only for testing and development. In production, use `BroadcastTxSync` or `BroadcastTxAsync`. You can subscribe for the transaction result using JSON-RPC via a websocket (see [CometBFT docs](https://docs.cometbft.com/v0.34/core/subscription.html)). ::: :::tip CONTRACT: only returns error if `mempool.CheckTx()` errs or if we timeout waiting for tx to commit. If `CheckTx` or `DeliverTx` fails, no error will be returned, but the result will contain a non-OK ABCI code. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. ::: #### Parameters
* `tx` (string; required): the Base64-encoded signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "broadcast_tx_commit", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/broadcast_tx_commit?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "check_tx": { "code": 0, "data": "", "log": "Transaction checked successfully" }, "deliver_tx": { "code": 0, "data": "", "log": "Transaction delivered successfully", "events": [ { "type": "transfer", "attributes": [ { "key": "sender", "value": "0g1xyz..." }, { "key": "recipient", "value": "0g1abc..." }, { "key": "amount", "value": "10000u0g" } ] } ] }, "hash": "0xABC123...", "height": "12345" } } ``` --- ### `check_tx` > Checks the transaction without executing it. The transaction won't be added to the mempool. Please refer to [CometBFT docs](https://docs.cometbft.com/v0.34/core/using-cometbft.html#formatting) for formatting/encoding rules. #### Parameters
* `tx` (string; required): the Base64-encoded signed transaction. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "check_tx", "params": [""], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/check_tx?tx= ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "code": 0, "data": "", "log": "Transaction is valid", "events": [ { "type": "transfer", "attributes": [ { "key": "sender", "value": "0g1xyz..." }, { "key": "recipient", "value": "0g1abc..." }, { "key": "amount", "value": "10000u0g" } ] } ] } } ``` --- ## ABCI ### `abci_info` > Retrieves application info. #### Parameters
None. #### Returns Application info. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_info", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/abci_info ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "response": { "data": "TacChainApp", "version": "0.0.2", "last_block_height": "2130968", "last_block_app_hash": "X9pYsyApqs0iou6EgXqqfRrRbHRY9o3i7lbfUr/3DfI=" } } } ``` --- ### `abci_query` > Queries the application for particular information. #### Parameters
* `path` (string; required): a path to the data ("/a/b/c"). * `data` (string; required): the hex-encoded data. * `height` (integer; default: 0): the height (0 means latest). * `prove` (boolean; default: false): adds proofs of the transactions inclusion in the block. #### Returns Particular info according to the query submitted. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "abci_query", "params": ["a/b/c", "the_data", "1", true], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/blockchain?path=%2Fa%2Fb%2Fc&data=the_data&height=1&prove=true ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "response": { "code": 0, "log": "", "info": "", "index": -1, "key": "0x6b61766131387879377a...", "value": "0x123456789abcdef", // Hex-encoded value "proofOps": null, "height": "12345", "codespace": "" } } } ``` --- ## Cosmos REST methods **Query**: * [Auth methods](#auth-methods) * [Bank methods](#bank-methods) * [Distribution methods](#distribution-methods) * [Evidence methods](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#evidence-methods) * [Gov methods](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#gov-methods) * [Mint methods](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#mint-methods) * [Slashing methods](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#slashing-methods) * [Staking methods](/rpc-service/chains/chains-api/tac/cosmos-rest-methods/#staking-methods) * [Upgrade methods](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#upgrade-methods) * [Ibc core methods](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p2/#ibc-core-methods) * [Ibc applications methods](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#ibc-applications-methods) **Service**: * [Tx methods](/rpc-service/chains/chains-api/tac/cosmos-rest-methods-p3/#tx-methods) ### Auth methods ### `/cosmos/auth/v1beta1/accounts/{address}` > Retrieves account details based on address. #### Parameters * `address` (string; required): an address to query for account details. #### Returns Account details. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/auth/v1beta1/accounts/{address} ``` #### Response example ```json { "account": { "type_url": "string", "value": "string" } } ``` --- ### `/cosmos/auth/v1beta1/params` > Retrieves all parameters. #### Parameters None. #### Returns Parameters. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/auth/v1beta1/params ``` #### Response example ```json { "params": { "max_memo_characters": "string", "tx_sig_limit": "string", "tx_size_cost_per_byte": "string", "sig_verify_cost_ed25519": "string", "sig_verify_cost_secp256k1": "string" } } ``` --- ### Bank methods ### `/cosmos/bank/v1beta1/balances/{address}` > Retrieves the balance of all coins for a single account. #### Parameters * `address`(string; required): an address to query balances for. * `pagination.key` (string, byte): value returned in `PageResponse.next_key` to begin querying the next page most efficiently. Only one of offset or key should be set. * `pagination.offset` (string, uint64): numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set. * `pagination.limit` (string, uint64): total number of results to be returned in the result page. If left empty it will default to a value to be set by each app. * `pagination.count_total` (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. `count_total` is only respected when `offset` is used, it is ignored when `key` is set. #### Returns Balance of all coins for a single account. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/bank/v1beta1/balances/{address} ``` #### Response example ```json { "balances": [ { "denom": "string", "amount": "string" } ], "pagination": { "next_key": "string", "total": "string" } } ``` ### `/cosmos/bank/v1beta1/balances/{address}/{denom}` > Retrieves balance of a single coin for a single account. #### Parameters * `address` (string; required): an address to query balances for. * `denom` (string; required): a coin denom to query balances for. #### Returns Balance of the specific coin for a single account. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/bank/v1beta1/balances/{address}/{denom} ``` #### Response example ```shell { "balance": { "denom": "string", "amount": "string" } } ``` ### `/cosmos/bank/v1beta1/params` > Retrieves the parameters of x/bank module. #### Parameters None. #### Returns Parameters of x/bank module. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/bank/v1beta1/params ``` #### Response example ```json { "params": { "send_enabled": [ { "denom": "string", "enabled": true } ], "default_send_enabled": true } } ``` --- ### `/cosmos/bank/v1beta1/supply` > Retrieves the total supply of all coins. #### Parameters None. #### Returns Supply of all coins. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/bank/v1beta1/supply ``` #### Response example ```json { "supply": [ { "denom": "string", "amount": "string" } ] } ``` --- ### Distribution methods ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards` > Retrieves the total rewards accrued by each validator. #### Parameters * `delegator_address` (string; required): a delegator address to query for. #### Returns Rewards from each validator. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards ``` #### Response example ```shell { "rewards": [ { "validator_address": "string", "reward": [ { "denom": "string", "amount": "string" } ] } ], "total": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}` > Retrieves the total rewards accrued by a delegation. #### Parameters * `delegator_address` (string; required): a delegator address to query for. * `validator_address` (string; required): a validator address to query for. #### Returns Total rewards accrued by a delegation for a specific validator. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address} ``` #### Response example ```json { "rewards": [ { "denom": "string", "amount": "string" } ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators` > Retrieves the validators of a delegator. #### Parameters * `delegator_address` (string; required): a delegator address to query for. #### Returns Validators for a given delegator. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators ``` #### Response example ```json { "validators": [ "string" ] } ``` --- ### `/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address` > Retrieves withdraw address of a delegator. #### Parameters * `delegator_address` (string, required): a delegator address to query for. #### Returns Withdraw address of delegator. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address ``` #### Response example ```json { "withdraw_address": "string" } ``` --- ### `/cosmos/distribution/v1beta1/params` > Retrieves params of the distribution module. #### Parameters None. #### Returns Params of the distribution module. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/params ``` #### Response example ```json { "params": { "community_tax": "string", "base_proposer_reward": "string", "bonus_proposer_reward": "string", "withdraw_addr_enabled": true } } ``` --- ### `/cosmos/distribution/v1beta1/validators/{validator_address}/commission` > Retrieves accumulated commission for a validator. #### Parameters * `validator_address` (string; required): a validator address to query for. #### Returns Total commission for a validator. #### Request example ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/validators/{validator_address}/commission ``` #### Response example ```json { "commission": { "commission": [ { "denom": "string", "amount": "string" } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tac/information/ title: TAC — Information, Transactions, ABCI, Cosmos REST methods (1/2) source: docs/rpc-service/chains/chains-api/tac/information.mdx --- # TAC — Information, Transactions, ABCI, Cosmos REST methods (1/2) > API reference for [TAC](/rpc-service/chains/chains-api/tac/). [All methods ->](/rpc-service/chains/chains-api/tac/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/tac/information-p2/) ## Information ### `blockchain` > Retrieves block headers for `minHeight <= height <= maxHeight`. At most 20 items will return for the `minHeight` or `maxHeight` parameters specified. If `maxHeight` does not yet exist, the blocks up to the current height will return. If `minHeight` does not exist (pruning), the earliest existing height will be used. #### Parameters
* `minHeight` (integer): the minimum block height to return. * `maxHeight` (integer): the maximum block height to return. #### Returns Block headers, in descending order (highest first). #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "blockchain", "params": ["1", "2"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/blockchain?minHeight=1&maxHeight=2 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "last_height": "2564978", "block_metas": [ { "block_id": { "hash": "ED3BF22DDEAABE5B194ECE00FC97B73B31D6B6E381946054ADF248FADA65FD4F", "parts": { "total": 1, "hash": "268422F8D294840DBC5B24FB031F976357E8478F72C16B66E7B7388C2429D18F" } }, "block_size": "830", "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "2", "time": "2024-06-24T07:25:41.380275895Z", "last_block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "last_commit_hash": "5148301A7ABA311392D676C3C967F299F85A1AD48D74E96AF083DA4787FF9C2D", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "21181DF7C886CEE14012C07031E55BF04428BF77979015F2869ED1EACABAD22E", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "CDFF531A3AFA255BC193D52721027366935F9BF8" }, "num_txs": "0" }, { "block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "block_size": "353", "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "1", "time": "2024-06-24T07:24:31.526533772Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD" }, "num_txs": "0" } ] } } ``` --- ### `block` > Retrieves a block at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block is to be fetched. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/blockchain?height=1 ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "block": { "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "1", "time": "2024-06-24T07:24:31.526533772Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD" }, "data": { "txs": [] }, "evidence": { "evidence": [] }, "last_commit": { "height": "0", "round": 0, "block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "signatures": [] } } } } ``` --- ### `block_by_hash` > Retrieves a block by hash. #### Parameters
* `hash` (string; required): the Base64-encoded block hash. #### Returns Block information. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_by_hash", "params": { "hash": "qKuv5HZ3tYbvJxK7TAW5frjLbg3ORxk49pkK11y9oAA=" }, "id": 1 }' ``` ```shell curl "https://rpc.ankr.com/http/tac_turin_tendermint/block_by_hash?hash=0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000" ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "block_id": { "hash": "A8ABAFE47677B586EF2712BB4C05B97EB8CB6E0DCE471938F6990AD75CBDA000", "parts": { "total": 1, "hash": "7017BF9E8E15A49C4C19A9293B47C2022CB76A1F857E93C535C237CC97C3AEA4" } }, "block": { "header": { "version": { "block": "11" }, "chain_id": "tacchain_2390-1", "height": "2081453", "time": "2025-01-29T11:23:05.876205111Z", "last_block_id": { "hash": "4CD5DEF666A98244E1AC52783D53ACC13A3DE39D6CFC6BE8540AB582F58E6294", "parts": { "total": 1, "hash": "E9CDDE42389997FFEF4362B3D6866E01633C344A741B9AF099EC324222A716F3" } }, "last_commit_hash": "42BCA34B9D6E4ED49C267C34913C2DB9EA96EB91635877D0F78678355B34E9D5", "data_hash": "56D3DB004B30913B1156E941CCDD28703EBEC112440CBB9EEA0BB89C15FD17AC", "validators_hash": "B3ABC95E36789E4A61A817AEF2DC26DCF6D1922BF9391134221B378B13C0542D", "next_validators_hash": "B3ABC95E36789E4A61A817AEF2DC26DCF6D1922BF9391134221B378B13C0542D", "consensus_hash": "16DBFD0AAA36E214D4E55A6EAADF68E9802DD4845DBD49EB58DAA89F885D1FC0", "app_hash": "F0FC1B6ACDAFEDDAA90116AAC6C9C668CB17F3FA3055C9334DAFF806291266B1", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "FAD767856DD735D350D1C2701E01E44E3CD8DCF0" }, "data": { "txs": [ "CpEDCt0CCh8vZXRoZXJtaW50LmV2bS52MS5Nc2dFdGhlcmV1bVR4ErkCCvIBCh4vZXRoZXJtaW50LmV2bS52MS5EeW5hbWljRmVlVHgSzwEKBDIzOTAQ5yUaATEiATEohaoEMioweGQzQThENDRiODg5ZEUwMjcwM0RGOEIzM2M1M0U5MzMxNWEzM2IwNmY6ATBCREDBDxkAAAAAAAAAA..." ] }, "evidence": { "evidence": [] }, "last_commit": { "height": "2081452", "round": 0, "block_id": { "hash": "4CD5DEF666A98244E1AC52783D53ACC13A3DE39D6CFC6BE8540AB582F58E6294", "parts": { "total": 1, "hash": "E9CDDE42389997FFEF4362B3D6866E01633C344A741B9AF099EC324222A716F3" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "A0E2E65C71DE9D8A59D182933122934A1FA23837", "timestamp": "2025-01-29T11:23:05.876205111Z", "signature": "KnjELWFDuPFrA6UH7IsqihmEM6bcgWkl6gG0WUnJrh+vc7HC9Y5Lk1ZalLS2YCJXgxqqO3j1xu4NRSmfnCEPAA==" } ] } } } } ``` --- ### `block_results` > Retrieves block results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block info is to be fetched. #### Returns Block results. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block_results", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/block_results?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "height": "1", "txs_results": null, "finalize_block_events": [ { "type": "coin_spent", "attributes": [ { "key": "spender", "value": "tac1tygms3xhhs3yv487phx3dw4a95jn7t7ly38lhf", "index": false }, { "key": "amount", "value": "40000000000000000000000utac", "index": false } ] } ], "validator_updates": null, "consensus_param_updates": { "block": { "max_bytes": "22020096", "max_gas": "20000000" }, "evidence": { "max_age_num_blocks": "100000", "max_age_duration": "172800000000000", "max_bytes": "1048576" }, "validator": { "pub_key_types": [ "ed25519" ] }, "version": {}, "abci": {} }, "app_hash": "gO0ylmiv3gyUf//1qmvmOEpx36TfluCm05LXVd/GHvk=" } } ``` --- ### `commit` > Retrieves commit results at a specified height. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be fetched. #### Returns Commit results. Canonical switches from false to true for block H once block H+1 has been committed, until then it's subjective and only reflects what this node has seen so far. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "commit", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/commit?height=1 ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "signed_header": { "header": { "version": { "block": "11" }, "chain_id": "tacchain_2390-1", "height": "1", "time": "2024-11-08T12:01:27.393983011Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "307B2281CBDCC5D12F69345E9DA7B262C984BFFDD3EE85D7C732654EECB94B9D", "next_validators_hash": "307B2281CBDCC5D12F69345E9DA7B262C984BFFDD3EE85D7C732654EECB94B9D", "consensus_hash": "16DBFD0AAA36E214D4E55A6EAADF68E9802DD4845DBD49EB58DAA89F885D1FC0", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "A0E2E65C71DE9D8A59D182933122934A1FA23837" }, "commit": { "height": "1", "round": 1, "block_id": { "hash": "07726785B5E5EF0701CEAFA0B929BDF852ABE35840C885A2F740A9E7108A610A", "parts": { "total": 1, "hash": "4289823D5E0104E13D4D5D72A84BF412914C900B2AE14FC6F285F80287B5F0C4" } }, "signatures": [ { "block_id_flag": 2, "validator_address": "0469070A1C182AF11A1939F098C5C2C666116561", "timestamp": "2024-11-08T13:20:25.020397516Z", "signature": "okpCLoE11eQ+b2NPvlIFeX8NXuS939cEa8+M0Yv5qT6L1UkpWZ1JLmDLQn9KO4QinpehezvuaKI3uwIeGQEJBg==" } ] } }, "canonical": true } } ``` --- ### `validators` > Retrieves a validator set at a specified height. Validators are sorted by voting power. #### Parameters
* `height` (integer; default: 0): the height to return. If no height is provided, the validator set corresponding to the latest block is to be fetched. * `page` (integer; default: 1): a page number (1-based). * `per_page` (integer; default: 30; max: 100): a number of entries per page. #### Returns Commit results. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "validators", "params": ["1","1","30"], "id": 1 }' ``` ```shell curl "https://rpc.ankr.com/http/tac_turin_tendermint/validators?height=1&page=1&per_page=30" ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "block_height": "1", "validators": [ { "address": "0469070A1C182AF11A1939F098C5C2C666116561", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "IXbZunQ86cctrrLCvi1IdSo4lUbQ9Yn8ZvJE8NJBUU0=" }, "voting_power": "10000000000000000", "proposer_priority": "-30000000000000000" }, { "address": "A0E2E65C71DE9D8A59D182933122934A1FA23837", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "uY1lJrMtzM7YvevMIy7e8ncBw2H/rF80Hsy1Za76Gs8=" }, "voting_power": "10000000000000000", "proposer_priority": "10000000000000000" }, { "address": "F811E7EEFD3C7869D015E94AA5E24E6C24D65438", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "taLMbOFCeclyC4PSsE4QfffRBd3bte2GDfUMEqQjVB4=" }, "voting_power": "10000000000000000", "proposer_priority": "10000000000000000" }, { "address": "FAD767856DD735D350D1C2701E01E44E3CD8DCF0", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "MKl1KagA7T6KicN3fj7BHihg3KwDsbqHLSCUYXhdkbo=" }, "voting_power": "10000000000000000", "proposer_priority": "10000000000000000" } ], "count": "4", "total": "4" } } ``` --- ### `genesis_chunked` > Retrieves Genesis in multiple chunks. Gets genesis document in multiple chunks to make it easier to iterate through larger genesis structures. Each chunk is produced by converting the genesis document to JSON and then splitting the resulting payload into 16MB blocks, and then Base64-encoding each block. #### Parameters
* `chunk` (integer; default: 0): a sequence number of the chunk to download. #### Returns A Genesis chunk response. #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "genesis_chunked", "params": ["0"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/genesis_chunked?chunk=0 ``` #### Response example ```json { "jsonrpc": "2.0", "id": -1, "result": { "chunk": "0", "total": "1", "data": "eyJnZW5lc2lzX3RpbWUiOiIyMDI0LTA2LTI0VDA3OjI0OjMxLjUyNjUzMzc3MloiLCJjaGFpbl9pZCI6InpndGVuZGVybWludF8xNjYwMC0yIiwiaW5pdGlhbF9oZWlnaHQiOiIxIiwiY29uc2Vuc3VzX3BhcmFtcyI6eyJibG9jayI6eyJtYXhfYnl0ZXMiOiIyMjAyMD..." } } ``` --- ### `dump_consensus_state` > Retrieves consensus state. Not safe to call from inside the ABCI application during a block execution. #### Parameters
None. #### Returns A complete consensus state. See the [Vote string description](https://pkg.go.dev/github.com/tendermint/tendermint/types?tab=doc#Vote.String). #### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "dump_consensus_state", "params": [], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/dump_consensus_state ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "round_state": { "height": "2130808", "round": 0, "step": 3, "start_time": "2025-01-31T10:01:50.17850105Z", "commit_time": "2025-01-31T10:01:47.17850105Z", "validators": { "validators": [ { "address": "A0E2E65C71DE9D8A59D182933122934A1FA23837", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "uY1lJrMtzM7YvevMIy7e8ncBw2H/rF80Hsy1Za76Gs8=" }, "voting_power": "10060000000000400", "proposer_priority": "11333000124971576" } ], "proposer": { "address": "F811E7EEFD3C7869D015E94AA5E24E6C24D65438", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "taLMbOFCeclyC4PSsE4QfffRBd3bte2GDfUMEqQjVB4=" }, "voting_power": "10000000000000000", "proposer_priority": "-20516000041617624" } }, "proposal": null, "proposal_block": null, "proposal_block_parts": null, "locked_round": -1, "locked_block": null, "locked_block_parts": null, "valid_round": -1, "valid_block": null, "valid_block_parts": null, "votes": [ { "round": 0, "prevotes": [ "nil-Vote", "nil-Vote", "nil-Vote", "nil-Vote" ], "prevotes_bit_array": "BA{4:____} 0/40066000000000400 = 0.00", "precommits": [ "nil-Vote", "nil-Vote", "nil-Vote", "nil-Vote" ], "precommits_bit_array": "BA{4:____} 0/40066000000000400 = 0.00" } ], "commit_round": -1, "last_commit": { "votes": [ "Vote{0:A0E2E65C71DE 2130807/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 5F824DEDE09C 0C7A9CCC11AA 000000000000 @ 2025-01-31T10:01:47.030466581Z}", "Vote{1:FAD767856DD7 2130807/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 5F824DEDE09C B9034974713C 000000000000 @ 2025-01-31T10:01:47.046270001Z}", "Vote{2:0469070A1C18 2130807/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 5F824DEDE09C A41F6EE27C20 000000000000 @ 2025-01-31T10:01:47.005732112Z}", "Vote{3:F811E7EEFD3C 2130807/00/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 5F824DEDE09C 4658137BD5EA 000000000000 @ 2025-01-31T10:01:47.046268878Z}" ], "votes_bit_array": "BA{4:xxxx} 40066000000000400/40066000000000400 = 1.00", "peer_maj_23s": {} }, "last_validators": { "validators": [ { "address": "A0E2E65C71DE9D8A59D182933122934A1FA23837", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "uY1lJrMtzM7YvevMIy7e8ncBw2H/rF80Hsy1Za76Gs8=" }, "voting_power": "10060000000000400", "proposer_priority": "1273000124971176" } ], "proposer": { "address": "FAD767856DD735D350D1C2701E01E44E3CD8DCF0", "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "MKl1KagA7T6KicN3fj7BHihg3KwDsbqHLSCUYXhdkbo=" }, "voting_power": "10006000000000000", "proposer_priority": "-20354000041636525" } }, "triggered_timeout_precommit": false }, "peers": [ { "node_address": "9b4995a048f930776ee5b799f201e9b00727ffcc@107.6.94.246:45120", "peer_state": { "round_state": { "height": "2130808", "round": 0, "step": 1, "start_time": "2025-01-31T10:01:49.230676037Z", "proposal": false, "proposal_block_part_set_header": { "total": 0, "hash": "" }, "proposal_block_parts": null, "proposal_pol_round": -1, "proposal_pol": "____", "prevotes": "____", "precommits": "____", "last_commit_round": 0, "last_commit": "xxxx", "catchup_commit_round": -1, "catchup_commit": "____" }, "stats": { "votes": "350044", "block_parts": "44573" } } } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tac/methods-p2/ title: TAC — Methods (2/3) source: docs/rpc-service/chains/chains-api/tac/methods-p2.mdx --- # TAC — Methods (2/3) > API reference for [TAC](/rpc-service/chains/chains-api/tac/). [All methods ->](/rpc-service/chains/chains-api/tac/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/tac/methods/) · 2 · [3](/rpc-service/chains/chains-api/tac/methods-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0x440E079445AA9586bf99971d5f57BF09E2B9A403", "to": "0x3ff5c79e3d1E12A7291449ea7FAD15357EbF31C2", "data": "0xa9059cbb000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf90000000000000000000000000000000000000000000000000000000000000064" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5444" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x0", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1312d00", "gasUsed": "0xdd91d", "hash": "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "logsBloom": "0x00000004000000000800200020000000080000000000000000000000008000040000000000000000020000000400000000000000000000000000800000000000000000000000000000000008000000000000000000000000000000000000000000000000020000400000040000000800000000000000000000000010000000000000000000000004000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000010000001020000000000000000002000000008000000000100000000000000000200100000000000020000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x0bc478f8a29b27280818d6936e95ca50c2eb2415", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x1fc2ad", "parentHash": "0x4cd5def666a98244e1ac52783d53acc13a3de39d6cfc6be8540ab582f58e6294", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x17d1", "stateRoot": "0xf0fc1b6acdafeddaa90116aac6c9c668cb17f3fa3055c9334daff806291266b1", "timestamp": "0x679a0f99", "totalDifficulty": "0x0", "transactions": [ "0xcace281fc1bc8b74c592ae75ffcc3f9ed183e9870975ad4b54d130874723c50d", "0x81ad9fffa1c42f01132aebae506b55f4a3e12c59e53b15a2226012cb39e365d6" ], "transactionsRoot": "0x56d3db004b30913b1156e941ccdd28703ebec112440cbb9eea0bb89c15fd17ac", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1FC2AD", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x0", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1312d00", "gasUsed": "0xdd91d", "hash": "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "logsBloom": "0x00000004000000000800200020000000080000000000000000000000008000040000000000000000020000000400000000000000000000000000800000000000000000000000000000000008000000000000000000000000000000000000000000000000020000400000040000000800000000000000000000000010000000000000000000000004000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000010000001020000000000000000002000000008000000000100000000000000000200100000000000020000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x0bc478f8a29b27280818d6936e95ca50c2eb2415", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x1fc2ad", "parentHash": "0x4cd5def666a98244e1ac52783d53acc13a3de39d6cfc6be8540ab582f58e6294", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x17d1", "stateRoot": "0xf0fc1b6acdafeddaa90116aac6c9c668cb17f3fa3055c9334daff806291266b1", "timestamp": "0x679a0f99", "totalDifficulty": "0x0", "transactions": [ "0xcace281fc1bc8b74c592ae75ffcc3f9ed183e9870975ad4b54d130874723c50d", "0x81ad9fffa1c42f01132aebae506b55f4a3e12c59e53b15a2226012cb39e365d6" ], "transactionsRoot": "0x56d3db004b30913b1156e941ccdd28703ebec112440cbb9eea0bb89c15fd17ac", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xcace281fc1bc8b74c592ae75ffcc3f9ed183e9870975ad4b54d130874723c50d"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "blockNumber": "0x1fc2ad", "from": "0x440e079445aa9586bf99971d5f57bf09e2b9a403", "gas": "0x11505", "gasPrice": "0x1", "maxFeePerGas": "0x1", "maxPriorityFeePerGas": "0x1", "hash": "0xcace281fc1bc8b74c592ae75ffcc3f9ed183e9870975ad4b54d130874723c50d", "input": "0x40c10f1900000000000000000000000092101c6f576871e4e0a5d7bbc3a2d0a8973aea160000000000000000000000000000000000000000000000000de0b6b3a7640000", "nonce": "0x12e7", "to": "0xd3a8d44b889de02703df8b33c53e93315a33b06f", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x956", "v": "0x1", "r": "0xad6f587075453ef50d2671fd5cb9b5ab33ffdcee728e4d69edf7e5af587b87e7", "s": "0x45b03b465f5594fe9e205a6a370ddc31016dfb3aaf9cf8c53326ca073d74782b" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "0x0" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "blockNumber": "0x1fc2ad", "from": "0x440e079445aa9586bf99971d5f57bf09e2b9a403", "gas": "0x11505", "gasPrice": "0x1", "maxFeePerGas": "0x1", "maxPriorityFeePerGas": "0x1", "hash": "0xcace281fc1bc8b74c592ae75ffcc3f9ed183e9870975ad4b54d130874723c50d", "input": "0x40c10f1900000000000000000000000092101c6f576871e4e0a5d7bbc3a2d0a8973aea160000000000000000000000000000000000000000000000000de0b6b3a7640000", "nonce": "0x12e7", "to": "0xd3a8d44b889de02703df8b33c53e93315a33b06f", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x956", "v": "0x1", "r": "0xad6f587075453ef50d2671fd5cb9b5ab33ffdcee728e4d69edf7e5af587b87e7", "s": "0x45b03b465f5594fe9e205a6a370ddc31016dfb3aaf9cf8c53326ca073d74782b" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x1FC2AD", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "blockNumber": "0x1fc2ad", "from": "0x440e079445aa9586bf99971d5f57bf09e2b9a403", "gas": "0x11505", "gasPrice": "0x1", "maxFeePerGas": "0x1", "maxPriorityFeePerGas": "0x1", "hash": "0xcace281fc1bc8b74c592ae75ffcc3f9ed183e9870975ad4b54d130874723c50d", "input": "0x40c10f1900000000000000000000000092101c6f576871e4e0a5d7bbc3a2d0a8973aea160000000000000000000000000000000000000000000000000de0b6b3a7640000", "nonce": "0x12e7", "to": "0xd3a8d44b889de02703df8b33c53e93315a33b06f", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x956", "v": "0x1", "r": "0xad6f587075453ef50d2671fd5cb9b5ab33ffdcee728e4d69edf7e5af587b87e7", "s": "0x45b03b465f5594fe9e205a6a370ddc31016dfb3aaf9cf8c53326ca073d74782b" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tac/methods-p3/ title: TAC — Methods (3/3) source: docs/rpc-service/chains/chains-api/tac/methods-p3.mdx --- # TAC — Methods (3/3) > API reference for [TAC](/rpc-service/chains/chains-api/tac/). [All methods ->](/rpc-service/chains/chains-api/tac/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/tac/methods/) · [2](/rpc-service/chains/chains-api/tac/methods-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xcace281fc1bc8b74c592ae75ffcc3f9ed183e9870975ad4b54d130874723c50d"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "blockNumber": "0x1fc2ad", "contractAddress": null, "cumulativeGasUsed": "0x11505", "effectiveGasPrice": "0x1", "from": "0x440e079445aa9586bf99971d5f57bf09e2b9a403", "gasUsed": "0x11505", "logs": [ { "address": "0xd3a8d44b889de02703df8b33c53e93315a33b06f", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x00000000000000000000000092101c6f576871e4e0a5d7bbc3a2d0a8973aea16" ], "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", "blockNumber": "0x1fc2ad", "transactionHash": "0xcace281fc1bc8b74c592ae75ffcc3f9ed183e9870975ad4b54d130874723c50d", "transactionIndex": "0x0", "blockHash": "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "logIndex": "0x0", "removed": false } ], "logsBloom": "0x00000000000000000000200020000000000000000000000000000000008000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000002000000008000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0xd3a8d44b889de02703df8b33c53e93315a33b06f", "transactionHash": "0xcace281fc1bc8b74c592ae75ffcc3f9ed183e9870975ad4b54d130874723c50d", "transactionIndex": "0x0", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x1FC2AD", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "fromBlock": "0x1FC2AD", "toBlock": "0x1FC2AE" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xd3a8d44b889de02703df8b33c53e93315a33b06f", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x00000000000000000000000092101c6f576871e4e0a5d7bbc3a2d0a8973aea16" ], "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000", "blockNumber": "0x1fc2ad", "transactionHash": "0xcace281fc1bc8b74c592ae75ffcc3f9ed183e9870975ad4b54d130874723c50d", "transactionIndex": "0x0", "blockHash": "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "logIndex": "0x0", "removed": false }, { "address": "0xb7615849ab30b5f7050a6dc8de00790bc04616dd", "topics": [ "0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff", "0x16530117695f4cc7aedafb7d3b53b920e74adabab37cbdf6a0bf9af873f9bc5b", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x16530117695f4cc7aedafb7d3b53b920e74adabab37cbdf6a0bf9af873f9bc5b" ], "data": "0x", "blockNumber": "0x1fc2ad", "transactionHash": "0x81ad9fffa1c42f01132aebae506b55f4a3e12c59e53b15a2226012cb39e365d6", "transactionIndex": "0x1", "blockHash": "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "logIndex": "0x1", "removed": false }, { "address": "0xb7615849ab30b5f7050a6dc8de00790bc04616dd", "topics": [ "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", "0x16530117695f4cc7aedafb7d3b53b920e74adabab37cbdf6a0bf9af873f9bc5b", "0x000000000000000000000000440e079445aa9586bf99971d5f57bf09e2b9a403", "0x000000000000000000000000440e079445aa9586bf99971d5f57bf09e2b9a403" ], "data": "0x", "blockNumber": "0x1fc2ad", "transactionHash": "0x81ad9fffa1c42f01132aebae506b55f4a3e12c59e53b15a2226012cb39e365d6", "transactionIndex": "0x1", "blockHash": "0xa8abafe47677b586ef2712bb4c05b97eb8cb6e0dce471938f6990ad75cbda000", "logIndex": "0x2", "removed": false } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tac/methods/ title: TAC — Methods (1/3) source: docs/rpc-service/chains/chains-api/tac/methods.mdx --- # TAC — Methods (1/3) > API reference for [TAC](/rpc-service/chains/chains-api/tac/). [All methods ->](/rpc-service/chains/chains-api/tac/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/tac/methods-p2/) · [3](/rpc-service/chains/chains-api/tac/methods-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "Version dev ()\nCompiled at using Go go1.23.3 (amd64)" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5b2c76da96136d193336fad3fbc049867b8ca157da22f69ae0e4923648250acc" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "2390" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1fc04b" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x440E079445AA9586bf99971d5f57BF09E2B9A403", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x67f18f4f75e83be3" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xB1029656528C1Fe2Eaf126b72CC9efaCc10A824F", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000005d4e6972f061e361d3623c2b36eb1878b5c1d91f" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x440E079445AA9586bf99971d5f57BF09E2B9A403", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x12f0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb09086f84dd67332d9d5d0e2333609be3f8fd4fcf3ac0cbb1b38feaa7fe06c63"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x1FC293"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xb09086f84dd67332d9d5d0e2333609be3f8fd4fcf3ac0cbb1b38feaa7fe06c63"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x1FC293"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xc7beB7c02CDc5ea618BD22Ebab08E601D92F89a8", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6080604052600436106100555760003560e01c80630d8e6e2c14..." } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/tac/methods-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_tx_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/tac_turin/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a08231000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf9" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/taiko/eth-p2/ title: Taiko — eth, debug (2/2) source: docs/rpc-service/chains/chains-api/taiko/eth-p2.mdx --- # Taiko — eth, debug (2/2) > API reference for [Taiko](/rpc-service/chains/chains-api/taiko/). [All methods ->](/rpc-service/chains/chains-api/taiko/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/taiko/eth/) · 2 ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Taiko blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/taiko/eth/ title: Taiko — eth, debug (1/2) source: docs/rpc-service/chains/chains-api/taiko/eth.mdx --- # Taiko — eth, debug (1/2) > API reference for [Taiko](/rpc-service/chains/chains-api/taiko/). [All methods ->](/rpc-service/chains/chains-api/taiko/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/taiko/eth-p2/) ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0xc5a82afa5fda0fad21f573220ae47384da3aa122735b75e92cdd1fda6210400e", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x5aB420bd468BcdCa2660469cfd2AA684B6f9a0dc"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0x5ab420bd468bcdca2660469cfd2aa684b6f9a0dc", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000007adb404e4963de23dd303114f0fa56f788bf3324", "0x0000000000000000000000000000000000000000000000000000000000071b6b" ], "data": "0x", "blockNumber": "0xa2b6a", "transactionHash": "0x0f6141789a947465b4633a5eb7f91aded855086bec1944330abf1cb113b1a336", "transactionIndex": "0x1", "blockHash": "0x97861f11315028ce6a2e26767507ee4168ee69ac0599f48baaf8993b4c348665", "logIndex": "0x2", "removed": false } ] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Taiko blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0x012ddfb7ed5ebb4ff6084204f0741097eb48aa26d643148b27ba9ea44077a39f", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0x0136ec61b1ea8e47757f6705134a6c2fff6872849d3016883733bb1e65eecc3e", "result": { "from": "0x0000777735367b36bc9b61c50022d9d0700db4ec", "gas": "0x3d090", "gasUsed": "0x2afdc", "to": "0x1670000000000000000000000000000000010001", "input": "0xda69d3db9c38bff01bf28fc5a0c36a56a657e7917db61f5228f05c5d5afa4e3e65363ea1197e968a6214a1e82df44b2220c11ef080a381e33c3610193dfcc1e7a4e458a00000000000000000000000000000000000000000000000000000000001391b410000000000000000000000000000000000000000000000000000000000a19827", "calls": [ { "from": "0x1670000000000000000000000000000000010001", "gas": "0x35859", "gasUsed": "0x25008", "to": "0x0167000000000000000000000000000000010001", "input": "0xda69d3db9c38bff01bf28fc5a0c36a56a657e7917db61f5228f05c5d5afa4e3e65363ea1197e968a6214a1e82df44b2220c11ef080a381e33c3610193dfcc1e7a4e458a00000000000000000000000000000000000000000000000000000000001391b410000000000000000000000000000000000000000000000000000000000a19827", "calls": [ { "from": "0x1670000000000000000000000000000000010001", "gas": "0x2467b", "gasUsed": "0x1dc1", "to": "0x1670000000000000000000000000000000010002", "input": "0x28f713cc0000000000000000000000000000000000000000000000000000000000028c587369676e616c5f73657276696365000000000000000000000000000000000000", "output": "0x0000000000000000000000001670000000000000000000000000000000000005", "calls": [ { "from": "0x1670000000000000000000000000000000010002", "gas": "0x22ab5", "gasUsed": "0xaa2", "to": "0x0167000000000000000000000000000000010002", "input": "0x28f713cc0000000000000000000000000000000000000000000000000000000000028c587369676e616c5f73657276696365000000000000000000000000000000000000", "output": "0x0000000000000000000000001670000000000000000000000000000000000005", "value": "0x0", "type": "DELEGATECALL" } ], "type": "STATICCALL" } ], "value": "0x0", "type": "DELEGATECALL" } ], "value": "0x0", "type": "CALL" } } ] } ``` --- ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the Taiko blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0x44CD4", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "txHash": "0x0136ec61b1ea8e47757f6705134a6c2fff6872849d3016883733bb1e65eecc3e", "result": { "from": "0x0000777735367b36bc9b61c50022d9d0700db4ec", "gas": "0x3d090", "gasUsed": "0x2afdc", "to": "0x1670000000000000000000000000000000010001", "input": "0xda69d3db9c38bff01bf28fc5a0c36a56a657e7917db61f5228f05c5d5afa4e3e65363ea1197e968a6214a1e82df44b2220c11ef080a381e33c3610193dfcc1e7a4e458a00000000000000000000000000000000000000000000000000000000001391b410000000000000000000000000000000000000000000000000000000000a19827", "calls": [ { "from": "0x1670000000000000000000000000000000010001", "gas": "0x35859", "gasUsed": "0x25008", "to": "0x0167000000000000000000000000000000010001", "input": "0xda69d3db9c38bff01bf28fc5a0c36a56a657e7917db61f5228f05c5d5afa4e3e65363ea1197e968a6214a1e82df44b2220c11ef080a381e33c3610193dfcc1e7a4e458a00000000000000000000000000000000000000000000000000000000001391b410000000000000000000000000000000000000000000000000000000000a19827", "calls": [ { "from": "0x1670000000000000000000000000000000010001", "gas": "0x2467b", "gasUsed": "0x1dc1", "to": "0x1670000000000000000000000000000000010002", "input": "0x28f713cc0000000000000000000000000000000000000000000000000000000000028c587369676e616c5f73657276696365000000000000000000000000000000000000", "output": "0x0000000000000000000000001670000000000000000000000000000000000005", "calls": [ { "from": "0x1670000000000000000000000000000000010002", "gas": "0x22ab5", "gasUsed": "0xaa2", "to": "0x0167000000000000000000000000000000010002", "input": "0x28f713cc0000000000000000000000000000000000000000000000000000000000028c587369676e616c5f73657276696365000000000000000000000000000000000000", "output": "0x0000000000000000000000001670000000000000000000000000000000000005", "value": "0x0", "type": "DELEGATECALL" } ], "type": "STATICCALL" } ], "value": "0x0", "type": "DELEGATECALL" } ], "value": "0x0", "type": "CALL" } } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/taiko/ title: Taiko description: Taiko is as a fully open source, permissionless, Ethereum-equivalent ZK-Rollup. 31 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/taiko/index.mdx --- # Taiko
> Taiko API is available on [Web3 API platform](https://www.ankr.com/rpc/taiko). *Taiko* is as a fully open source, permissionless, Ethereum-equivalent ZK-Rollup. Using Taiko feels the exact same as using Ethereum. There are no centralized actors that operate the network; all operations are permissionlessly run by the community. In order for your Web3 application to interact with Taiko — either by reading blockchain data or sending transactions to the network — it must connect to a Taiko node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/taiko/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/taiko/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/taiko/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/taiko/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/taiko/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/taiko/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/taiko/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/taiko/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/taiko/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/taiko/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/taiko/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/taiko/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/taiko/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/taiko/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/taiko/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/taiko/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/taiko/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/taiko/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/taiko/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/taiko/eth/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/taiko/eth/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/taiko/eth/#eth_getlogs) — returns logs matching the parameters specified. **Premium-only methods**: * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/taiko/eth/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/taiko/eth/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/taiko/eth-p2/#debug_traceblock) — traces the execution of all transactions within a block. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/taiko/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/taiko/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/taiko/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/taiko/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/taiko/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/taiko/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/taiko/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/taiko/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/taiko/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/taiko/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/taiko/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/taiko/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/taiko/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/taiko/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/taiko/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/taiko/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/taiko/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/taiko/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/taiko/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/taiko/web3-p3/#eth_gettransactionreceipt) ### eth, debug - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/taiko/eth/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/taiko/eth/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/taiko/eth/#eth_getlogs) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/taiko/eth/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/taiko/eth/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/taiko/eth-p2/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/taiko/web3-p2/ title: Taiko — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/taiko/web3-p2.mdx --- # Taiko — web3, net, eth (2/3) > API reference for [Taiko](/rpc-service/chains/chains-api/taiko/). [All methods ->](/rpc-service/chains/chains-api/taiko/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/taiko/web3/) · 2 · [3](/rpc-service/chains/chains-api/taiko/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x545e" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x1", "difficulty": "0x0", "extraData": "0x302e31382e302d64657600000000000000000000000000000000000000000000", "gasLimit": "0xe8b250", "gasUsed": "0x4ab5d3", "hash": "0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", "logsBloom": "0x000802200010000000100800000000000401000300000000002082018200000000001000000001000500220010002000000000000001200100200000002020420000400440000008002001091000000000400100800010000000008080028080020040000280011100080002082008006040000000010000000001108008000000041000000004d8000120001002000000001041001000042000000101000000022000000200100000200000000800000501000001000022042000884040000000204002008040000101000001002000000800000000000000000008c0002000201028088080400208002000010000200000280410010c518000000002001200", "miner": "0xe1e210594771824dad216568b91c9cb4ceed361c", "mixHash": "0x76a924a163d521a6f218cd6d7c5c034a8ad4d20c079bd707fdfe6c858526b4e6", "nonce": "0x0000000000000000", "number": "0xa2aca", "parentHash": "0xfc3f6a958d2eb00aa3bf763c85abb609bfb876457edf366b1b1fe4b20b3b5392", "receiptsRoot": "0x23724f5f91a8cef90f20e39415c54bdf1e2ac43cf99c86f78e086ab1c0e5ceca", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x563b", "stateRoot": "0x3fc853c7cb77d07d4f5c8a26e7ef3e903f9089cf9cc56f76a1f7ef2af7e17e07", "timestamp": "0x6602cfc4", "totalDifficulty": "0x0", "transactions": [ "0x7ccf86b2b79f7021cf752124519b3d95bdae519db2d90092551d258617c34bea", "0xb5136d9f0626c0c4667d251c56d0e28b82169f655e73bc929664b21cea8b2b14", "0xc5b91e76c221d360cc99d5a7038cb9ddef2e86172922d35690fa44a0ba27a2a4", "0xd39c20048d4424dd83db4ae2350426ea929360b4cc262137e0f463a1b5f9946f", "0x2d2b76942b7332043a9e4d7b9aa195143097a35fbf9afa7c59d19b624a64022f", "0xfee38b6dc9eb985e7527c1bc2dc087a0c000df6935738351005d43e1cdb72060", "0x1acf9b60fd7bdee66fd22f9e9552829a4f5a4ce0ac582fc25c4e972db4ae2d8a", "0x0a042b9b9d408d0c95e1379bde81acbdbd9df0176ed20998ede947a47b044250", "0xd1b605106868876f892cb887a415b55650a03100682d2b3c5be5ff8ed85129db", "0xd23408ab38cf6f234f7a1d8f2d142246e10ed92d98f436b342f18b9632eef5ee" ], "transactionsRoot": "0x91246983d28d6e5b84199617eb0fa683aaea059e93d366b46429e0e034f50a5c", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", true], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x1", "difficulty": "0x0", "extraData": "0x302e31382e302d64657600000000000000000000000000000000000000000000", "gasLimit": "0xe8b250", "gasUsed": "0x2aade", "hash": "0xdd3bda432583d696083e2bac2167c3aa999dd0a18f70fa796c5ca44b576e1adc", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000002040000000000400000000000000000000000000000000000000000000000002000000000000000000000000000000000000200000000000000000000000000000000000100000000000000100000000000000000000000000000000000000000000002000000000000000000000000000020100000000000002000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000001000000", "miner": "0xe1e210594771824dad216568b91c9cb4ceed361c", "mixHash": "0xa17ef61063021597ee89e2ff5e610f895b09b550cebf6c24f0c7231ee9fcf41f", "nonce": "0x0000000000000000", "number": "0xa2b16", "parentHash": "0xfeebb2da16ebbca6ff68ea2147363bba34e857ea787bdd01a5c0717b969bd9f4", "receiptsRoot": "0x690387fda3d3a8d903f4de2eadb546fd799c01af642a66bd681c7ba7998ce8df", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x3e8", "stateRoot": "0xc8303658270b0ee6993841b6875f73c10cdab1a988263f071eb1a67561eccdbe", "timestamp": "0x6602d1f8", "totalDifficulty": "0x0", "transactions": [ { "blockHash": "0xdd3bda432583d696083e2bac2167c3aa999dd0a18f70fa796c5ca44b576e1adc", "blockNumber": "0xa2b16", "from": "0x0000777735367b36bc9b61c50022d9d0700db4ec", "gas": "0x3d090", "gasPrice": "0x1", "maxFeePerGas": "0x1", "maxPriorityFeePerGas": "0x0", "hash": "0xb9a04b86082f007b1f51b565835979f9a83063042d89979053555ab3295fa626", "input": "0xda69d3dbb62a06bd6f9a0a10496024008e0fa61adb990694f220ab489789e7431df2f3764624af72612a6dcea1d5ddfa6a0edba86be625adb1fdd55f90f13e23bb5946770000000000000000000000000000000000000000000000000000000000129f7c00000000000000000000000000000000000000000000000000000000003041ec", "nonce": "0xa2b27", "to": "0x1670080000000000000000000000000000010001", "transactionIndex": "0x0", "value": "0x0", "type": "0x2", "accessList": [], "chainId": "0x28c60", "v": "0x1", "r": "0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "s": "0x72f3bdd7e94da2c30cd06275a03e4774c1d4e68a9facc87e6754065ccec5ca56", "yParity": "0x1" } ], "transactionsRoot": "0x94b5ef81fca806c7edcdd8d2d1fdc6e63cbb90c547536f9ad770dd3a562d62d8", "uncles": [], "withdrawals": [], "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xf67b4d2caab1c16b6f292f7b220c09df038b7f38edcbe9e0915159817845ff9a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", "blockNumber": "0xa2aca", "from": "0xf1a66ee4db3bfec6a4233bd10e587dacdae985a6", "gas": "0x186a0", "gasPrice": "0x59682f01", "maxFeePerGas": "0x59682f01", "maxPriorityFeePerGas": "0x59682f01", "hash": "0xf67b4d2caab1c16b6f292f7b220c09df038b7f38edcbe9e0915159817845ff9a", "input": "0x", "nonce": "0x5c62", "to": "0x904d60501d8b8e904673b3e0bcc7e6ae6e57a195", "transactionIndex": "0x2c", "value": "0x38d7ea4c68000", "type": "0x2", "accessList": [], "chainId": "0x28c60", "v": "0x0", "r": "0x9fdc95549372694cf157b5c53ffb9698a59f5738f384f1166ee16467a654cd22", "s": "0x5de976d4d2beebff2419459f1fe4c0a034268ec98dbd7181a4f584a86a9e29d1", "yParity": "0x0" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", "blockNumber": "0xa2aca", "from": "0x4e9267cdecf7668ad5bb963f51399d0daacaf948", "gas": "0x1a4d4", "gasPrice": "0xf8db9b8d", "hash": "0xb5136d9f0626c0c4667d251c56d0e28b82169f655e73bc929664b21cea8b2b14", "input": "0xa9059cbb0000000000000000000000004e9267cdecf7668ad5bb963f51399d0daacaf9480000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x8", "to": "0x05f4539e5e34252f91bc479de77ae4c0bd030e66", "transactionIndex": "0x1", "value": "0x0", "type": "0x0", "chainId": "0x28c60", "v": "0x518e3", "r": "0x7218b8f27cef7788804ebaee1e7a8d05848fc4ee7285a019e48db9972ae649f6", "s": "0x79345ab4b155a801be7c684b3135674586b2dd652d24b87fd0821ca834c07feb" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x0c891cace708b8e91fa9d1396b4b4134d395b208b90fc1b3f35c0c1bb40f485d", "blockNumber": "0xa2b2b", "from": "0x45406041debc7813f034cdbf081ff33e1f666900", "gas": "0x18af6", "gasPrice": "0x1ff4c9bda", "hash": "0xe6b0030513815872a1486cedc2f7dfc6a27a263244f3c16b4cf099f92e80f21f", "input": "0xa9059cbb00000000000000000000000045406041debc7813f034cdbf081ff33e1f6669000000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x4", "to": "0x0b8d50601a934ab26e7b8865e40d87cb3d49f9ad", "transactionIndex": "0x1", "value": "0x0", "type": "0x0", "chainId": "0x28c60", "v": "0x518e4", "r": "0x16fd9a5b68973e5f7fc6187d877c9316557c05c6e4a4dc58e544e38ada270082", "s": "0x631201afd8d37c44983630750917d7ae0d8fc7510cb0a7561573892c07f71fa4" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/taiko/web3-p3/ title: Taiko — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/taiko/web3-p3.mdx --- # Taiko — web3, net, eth (3/3) > API reference for [Taiko](/rpc-service/chains/chains-api/taiko/). [All methods ->](/rpc-service/chains/chains-api/taiko/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/taiko/web3/) · [2](/rpc-service/chains/chains-api/taiko/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xf67b4d2caab1c16b6f292f7b220c09df038b7f38edcbe9e0915159817845ff9a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x256ac8ce2844b87c69895aba06138ffaa6759433306a7d86e6385b5b42b1f371", "blockNumber": "0xa2aca", "contractAddress": null, "cumulativeGasUsed": "0x1dd14b", "effectiveGasPrice": "0x59682f01", "from": "0xf1a66ee4db3bfec6a4233bd10e587dacdae985a6", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x904d60501d8b8e904673b3e0bcc7e6ae6e57a195", "transactionHash": "0xf67b4d2caab1c16b6f292f7b220c09df038b7f38edcbe9e0915159817845ff9a", "transactionIndex": "0x2c", "type": "0x2" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/taiko/web3/ title: Taiko — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/taiko/web3.mdx --- # Taiko — web3, net, eth (1/3) > API reference for [Taiko](/rpc-service/chains/chains-api/taiko/). [All methods ->](/rpc-service/chains/chains-api/taiko/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/taiko/web3-p2/) · [3](/rpc-service/chains/chains-api/taiko/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "Geth/v1.13.8-stable/linux-amd64/go1.21.6", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "167008" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xa2acc" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xe3320b81758ef" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195", "safe"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xc5a82afa5fda0fad21f573220ae47384da3aa122735b75e92cdd1fda6210400e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x50" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x9B407"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x50" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xc5a82afa5fda0fad21f573220ae47384da3aa122735b75e92cdd1fda6210400e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0xA2ACA"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195", "0x1"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/taiko/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x904D60501D8B8E904673B3E0BCC7E6aE6e57A195","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/telos/ title: Telos description: Telos EVM integrates the Telos blockchain's high performance with Ethereum's development environment. 31 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/telos/index.mdx --- # Telos
> Telos API is available on [Web3 API platform](https://www.ankr.com/rpc/telos). *Telos* EVM integrates the Telos blockchain's high performance with Ethereum's development environment. It offers fast transactions, low fees, and full compatibility with Ethereum tools and smart contracts. Key features include: * **High Performance**: Thousands of transactions per second with low latency. * **Low Fees**: Significantly cheaper transactions than Ethereum. * **Compatibility**: Supports Ethereum smart contracts and development tools like Solidity and Metamask. * **Governance**: Robust governance model allowing token holder participation. * **Frontrunning Protection**: Built-in mechanisms to prevent frontrunning, ensuring fairer transaction execution. * **Arbitration**: Dispute resolution mechanism to handle conflicts, enhancing trust and security. In order for your Web3 application to interact with Telos — either by reading blockchain data or sending transactions to the network — it must connect to a Telos node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`net_listening`](/rpc-service/chains/chains-api/telos/net/#net_listening) — returns true if client is actively listening for network connections. * [`web3_clientVersion`](/rpc-service/chains/chains-api/telos/net/#web3_clientversion) — returns the current client version. * [`net_version`](/rpc-service/chains/chains-api/telos/net/#net_version) — returns the current network ID. * [`parity_pendingTransactions`](/rpc-service/chains/chains-api/telos/net/#parity_pendingtransactions) — retrieves a list of all pending transactions in the transaction pool. * [`eth_gasPrice`](/rpc-service/chains/chains-api/telos/net/#eth_gasprice) — returns the current price per gas in wei. * [`eth_blockNumber`](/rpc-service/chains/chains-api/telos/net/#eth_blocknumber) — returns the number of most recent block. * [`eth_chainId`](/rpc-service/chains/chains-api/telos/net/#eth_chainid) — retrieves the chain ID of the connected network. * [`eth_accounts`](/rpc-service/chains/chains-api/telos/net/#eth_accounts) — returns a list of addresses owned by client. * [`eth_getBalance`](/rpc-service/chains/chains-api/telos/net/#eth_getbalance) — returns the balance of the account specified by address. * `eth_getBalanceHuman` — returns human-readable info on the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/telos/net/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/telos/net/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/telos/net/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/telos/net/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/telos/net/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/telos/net/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/telos/net/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/telos/net/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/telos/net-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/telos/net-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/telos/net-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/telos/net-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/telos/net-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/telos/net-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/telos/net-p2/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getLogs`](/rpc-service/chains/chains-api/telos/net-p3/#eth_getlogs) — returns logs matching the parameters specified. * [`trace_filter`](/rpc-service/chains/chains-api/telos/net-p3/#trace_filter) — retrieve traces that match filter criteria. * [`trace_transaction`](/rpc-service/chains/chains-api/telos/trace/#trace_transaction) — retrieves the traces created during the execution of a given transaction. * [`trace_replayTransaction`](/rpc-service/chains/chains-api/telos/trace/#trace_replaytransaction) — replays a transaction and returns the traces produced by its execution along with the state changes. * [`trace_replayBlockTransactions`](/rpc-service/chains/chains-api/telos/trace/#trace_replayblocktransactions) — replays all the transactions in a given block and returns the traces produced by their execution along with the state changes. * [`trace_block`](/rpc-service/chains/chains-api/telos/trace/#trace_block) — retrieves a detailed trace of all the transactions in a specific block. --- ## Methods ### net, web3, parity, eth, trace - [`net_listening`](/rpc-service/chains/chains-api/telos/net/#net_listening) - [`web3_clientVersion`](/rpc-service/chains/chains-api/telos/net/#web3_clientversion) - [`net_version`](/rpc-service/chains/chains-api/telos/net/#net_version) - [`parity_pendingTransactions`](/rpc-service/chains/chains-api/telos/net/#parity_pendingtransactions) - [`eth_gasPrice`](/rpc-service/chains/chains-api/telos/net/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/telos/net/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/telos/net/#eth_blocknumber) - [`eth_chainId`](/rpc-service/chains/chains-api/telos/net/#eth_chainid) - [`eth_getBalance`](/rpc-service/chains/chains-api/telos/net/#eth_getbalance) - [`eth_getBalanceHuman`](/rpc-service/chains/chains-api/telos/net/#eth_getbalancehuman) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/telos/net/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/telos/net/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/telos/net/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/telos/net/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/telos/net/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/telos/net/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/telos/net/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/telos/net/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/telos/net-p2/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/telos/net-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/telos/net-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/telos/net-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/telos/net-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/telos/net-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/telos/net-p2/#eth_gettransactionreceipt) - [`eth_getLogs`](/rpc-service/chains/chains-api/telos/net-p3/#eth_getlogs) - [`trace_filter`](/rpc-service/chains/chains-api/telos/net-p3/#trace_filter) ### trace - [`trace_transaction`](/rpc-service/chains/chains-api/telos/trace/#trace_transaction) - [`trace_replayTransaction`](/rpc-service/chains/chains-api/telos/trace/#trace_replaytransaction) - [`trace_replayBlockTransactions`](/rpc-service/chains/chains-api/telos/trace/#trace_replayblocktransactions) - [`trace_block`](/rpc-service/chains/chains-api/telos/trace/#trace_block) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/telos/net-p2/ title: Telos — net, web3, parity, eth, trace (2/3) source: docs/rpc-service/chains/chains-api/telos/net-p2.mdx --- # Telos — net, web3, parity, eth, trace (2/3) > API reference for [Telos](/rpc-service/chains/chains-api/telos/). [All methods ->](/rpc-service/chains/chains-api/telos/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/telos/net/) · 2 · [3](/rpc-service/chains/chains-api/telos/net-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{ "to": "0x1234567890abcdef1234567890abcdef12345678", "data": "0xabcdef" }, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{ "to": "0x1234567890abcdef1234567890abcdef12345678", "data": "0xabcdef", "value": "0x0", "from": "0x9D7665151B49a5F15C3ef757dFc152DbEF7Cbdd7" }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x66c6" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x603208c5ad8ef4a061f7c1da3791f67384ed1de70a77a108ee06ff53d0966113", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x400058", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "size": "0x21e", "totalDifficulty": "0x0", "uncles": [], "difficulty": "0x0", "extraData": "0x0040007c2db951fff6f5f28c61e11e1739b5fb83c69aa685b78ffdb37c20dae0", "gasLimit": "0x7fffffff", "miner": "0x0000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "parentHash": "0xff25bb20294def3c19a13da19d037b35e2f518575dc9d3365ffc759af4ad2a88", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "stateRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "gasUsed": "0x0", "hash": "0x024eb6dbebfdbc8e6e268d6c312aee2e31489a74bf0982146515de0e0fd1bab9", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "number": "0x400058", "timestamp": "0x5c32b723", "transactions": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x0c584a3407492e87f5de2a1bb647a56fb1090822664f6d49f3153ba7b961c0e3"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x2e7641dc6b7c7043ea087d7b8236c66c08fc52568a6a43c5350768c9ca9308a5", "blockNumber": "0x14867ff4", "from": "0x339d413CCEfD986b1B3647A9cfa9CBbE70A30749", "gas": "0x35f30", "gasPrice": "0x7834da65aa", "hash": "0x0c584a3407492e87f5de2a1bb647a56fb1090822664f6d49f3153ba7b961c0e3", "input": "0x3161b7f600000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000134a651e39df6d8d8e90910000000000000000000000000000000000000000000000000000000008f0d1800000000000000000000000000000000000000000000000000000000000000010", "nonce": "0x38a86", "to": "0x2D61DCDD36F10b22176E0433B86F74567d529aAa", "transactionIndex": "0x0", "value": "0x0", "v": "0x73", "r": "0x671cd2321393945bb8bc98129236adde83576b1839cb30d5a094926cec19e822", "s": "0x29e578e39c589a448c9493c81136f715871dba421f813b7e43f54eae02604b65" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x7b7344658882c4f0700d39e84fb4e50cb56cbcd0acadb7550d0c265cccc60474", "0x0"], "id": 1 }' ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x9ef60f8828b3157200c51ae2690063a8539eb250782c7c5e0c3e5d7d13d10d2b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x2e7641dc6b7c7043ea087d7b8236c66c08fc52568a6a43c5350768c9ca9308a5", "blockNumber": "0x14867ff4", "contractAddress": null, "cumulativeGasUsed": "0x466c1", "from": "0x6daF055c99883D920849D7022f2EfABb13e2af57", "gasUsed": "0x466c1", "logsBloom": "0x0008000000000000000000001000000000000000000800000000400000000000000000000000020000000000000000000000080000200400000000000020000000000000000000000800000800000000000000000000004000000000000010000100000000080000000000000000000000010000000000000020001420010000000000000000000000000000208000000c004000000040001000000440000000200000000000000000000000000000000000000000000000000000000000008001000003000000000080000000008000000000010000200000000000000000000000000000000000000000000000000000000010040000000000000000020000", "status": "0x1", "to": "0xAbf938482cd67055e537029887bcFa44b9ab84b5", "transactionHash": "0x9ef60f8828b3157200c51ae2690063a8539eb250782c7c5e0c3e5d7d13d10d2b", "transactionIndex": "0x1", "logs": [ { "address": "0x8D97Cea50351Fb4329d591682b148D43a0C3611b", "blockHash": "0x2e7641dc6b7c7043ea087d7b8236c66c08fc52568a6a43c5350768c9ca9308a5", "blockNumber": "0x14867ff4", "data": "0x000000000000000000000000000000000000000000000000000000000bebc200", "logIndex": "0x0", "removed": false, "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000006daf055c99883d920849d7022f2efabb13e2af57", "0x00000000000000000000000017d3fdf3b017c96782de322a286c03106c75c62e" ], "transactionHash": "0x9ef60f8828b3157200c51ae2690063a8539eb250782c7c5e0c3e5d7d13d10d2b", "transactionIndex": "0x1" } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/telos/net-p3/ title: Telos — net, web3, parity, eth, trace (3/3) source: docs/rpc-service/chains/chains-api/telos/net-p3.mdx --- # Telos — net, web3, parity, eth, trace (3/3) > API reference for [Telos](/rpc-service/chains/chains-api/telos/). [All methods ->](/rpc-service/chains/chains-api/telos/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/telos/net/) · [2](/rpc-service/chains/chains-api/telos/net-p2/) · 3 ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0x14869E9E", "toBlock": "0x14869EA5", "address": "0x339d413CCEfD986b1B3647A9cfa9CBbE70A30749", "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"] }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `trace_filter` > Retrieve traces that match filter criteria. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `fromBlock` (string, optional): the starting block number, given as a hexadecimal string. Example: "0x1" for the first block. * `toBlock` (string, optional): the ending block number, given as a hexadecimal string. Example: "latest" for the most recent block. * `fromAddress` (array of strings, optional): an array of addresses that initiated the transactions. Example: ["0xAddress1", "0xAddress2"]. * `toAddress` (array of strings, optional): an array of addresses that received the transactions. Example: ["0xAddress1", "0xAddress2"]. * `after` (integer, optional): the offset for pagination. Example: 0. * `count` (integer, optional): the number of results to return. Example: 100. ### Returns
* `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For `call`: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_filter", "params": [{ "fromBlock": "0x3ff718", "toBlock": "0x3ff720", "fromAddress": ["0x1234567890abcdef1234567890abcdef12345678"], "toAddress": ["0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"], "topics": [["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"]] }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/telos/net/ title: Telos — net, web3, parity, eth, trace (1/3) source: docs/rpc-service/chains/chains-api/telos/net.mdx --- # Telos — net, web3, parity, eth, trace (1/3) > API reference for [Telos](/rpc-service/chains/chains-api/telos/). [All methods ->](/rpc-service/chains/chains-api/telos/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/telos/net-p2/) · [3](/rpc-service/chains/chains-api/telos/net-p3/) ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "nitro/v2.3.3-6a1c1a7/linux-amd64/go1.20.14", "id": 1 } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "660279" } ``` --- ## `parity_pendingTransactions` > Retrieves a list of all pending transactions in the transaction pool. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `hash`: the transaction hash. * `nonce`: the number of transactions sent from the sender's address. * `blockHash`: this will be null for pending transactions. * `blockNumber`: this will be null for pending transactions. * `transactionIndex`: this will be null for pending transactions. * `from`: the address of the sender. * `to`: the address of the receiver (null if it’s a contract creation transaction). * `value`: the amount of value transferred in Wei. * `gas`: the gas provided by the sender. * `gasPrice`: the gas price provided by the sender in Wei. * `input`: the data sent with the transaction. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "parity_pendingTransactions", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in Wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7834da65aa" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x14868685" } ``` --- ## `eth_chainId` > Retrieves the chain ID of the connected network. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns
* `result` (string): the chain ID of the connected network in hexadecimal format. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x28" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xB4B01216a5Bc8F1C8A33CD990A1239030E60C905", "0x1486854B"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x10533d8375c9c90000" } ``` --- ## `eth_getBalanceHuman` > Retrieves the balance of an Ethereum address in a human-readable format. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * ``: the Ethereum address for which you want to retrieve the balance. * `` (optional): the hex of the block number or one of the following block tags: * `latest` (default): the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `earliest`: the lowest numbered block available on the client. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `result` (string): the balance of the specified Ethereum address in a human-readable format, usually in Ether (ETH). ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalanceHuman", "params": ["0xB4B01216a5Bc8F1C8A33CD990A1239030E60C905", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1004.1086" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xB4B01216a5Bc8F1C8A33CD990A1239030E60C905", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xB4B01216a5Bc8F1C8A33CD990A1239030E60C905", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xd33b9a7c7050f1f207e5cd6f9eeec68231b34ff6e7eaf5d9443e2a8967645143"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x14867817"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xd33b9a7c7050f1f207e5cd6f9eeec68231b34ff6e7eaf5d9443e2a8967645143"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x9D7665151B49a5F15C3ef757dFc152DbEF7Cbdd7", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/telos/net-p2/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "your_result" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/telos/trace/ title: Telos — trace source: docs/rpc-service/chains/chains-api/telos/trace.mdx --- # Telos — trace > API reference for [Telos](/rpc-service/chains/chains-api/telos/). [All methods ->](/rpc-service/chains/chains-api/telos/#methods) ## `trace_transaction` > Retrieves the traces created during the execution of a given transaction. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `transactionHash` (string; required): the hash of the transaction for which you want to retrieve the traces. ### Returns
* `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For call: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_transaction", "params": ["0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "action": { "callType": "call", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x38025", "input": "0x3161b7f60000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a50000000000000000000000000000000000000000000123a8d6d9f1c9e741075000000000000000000000000000000000000000000000000000000000017d78400000000000000000000000000000000000000000000000000000000000000010", "value": "0x0", "to": "0x2d61dcdd36f10b22176e0433b86f74567d529aaa" }, "result": { "gasUsed": "0x38025", "output": "0x" }, "subtraces": 1, "traceAddress": [], "type": "call", "blockHash": "0xb20d0897ac3567d603afb646238b66e455bf28d234ce96cdbbe86ddc8d27c9e9", "blockNumber": 344366750, "transactionHash": "0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e", "transactionPosition": 0 }, { "action": { "callType": "delegatecall", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x02e970", "input": "0x3161b7f60000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a50000000000000000000000000000000000000000000123a8d6d9f1c9e741075000000000000000000000000000000000000000000000000000000000017d78400000000000000000000000000000000000000000000000000000000000000010", "value": "0x0", "to": "0x2d61dcdd36f10b22176e0433b86f74567d529aaa" }, "result": { "gasUsed": "0x2a78" }, "subtraces": 0, "traceAddress": [ 0 ], "type": "call", "blockHash": "0xb20d0897ac3567d603afb646238b66e455bf28d234ce96cdbbe86ddc8d27c9e9", "blockNumber": 344366750, "transactionHash": "0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e", "transactionPosition": 0 } ] } ``` --- ## `trace_replayTransaction` > Replays a transaction and returns the traces produced by its execution along with the state changes. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `transactionHash` (string): the hash of the transaction to be replayed. * `traceTypes` (array of strings): the types of traces to be included in the response. Possible value: `trace`. ### Returns The method returns an object that can include the following fields: * `trace` (array): an array of trace objects, similar to those returned by `trace_transaction` and `trace_filter`: * `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For call: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_replayTransaction", "params": ["0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e", ["trace"]], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "output": "0x", "stateDiff": null, "trace": [ { "action": { "callType": "call", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x38025", "input": "0x3161b7f60000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a50000000000000000000000000000000000000000000123a8d6d9f1c9e741075000000000000000000000000000000000000000000000000000000000017d78400000000000000000000000000000000000000000000000000000000000000010", "value": "0x0", "to": "0x2d61dcdd36f10b22176e0433b86f74567d529aaa" }, "result": { "gasUsed": "0x38025", "output": "0x" }, "subtraces": 1, "traceAddress": [], "type": "call" }, { "action": { "callType": "delegatecall", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x02e970", "input": "0x3161b7f60000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a50000000000000000000000000000000000000000000123a8d6d9f1c9e741075000000000000000000000000000000000000000000000000000000000017d78400000000000000000000000000000000000000000000000000000000000000010", "value": "0x0", "to": "0x2d61dcdd36f10b22176e0433b86f74567d529aaa" }, "result": { "gasUsed": "0x2a78" }, "subtraces": 0, "traceAddress": [ 0 ], "type": "call" } ], "vmTrace": null } } ``` --- ## `trace_replayBlockTransactions` > Replays all the transactions in a given block and returns the traces produced by their execution along with the state changes. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `blockHash` (string): the hash of the block whose transactions you want to replay. * `traceTypes` (array of strings): the types of traces to be included in the response. Possible value: `trace`. ### Returns The method returns an object that can include the following fields: * `trace` (array): an array of trace objects, similar to those returned by `trace_transaction` and `trace_filter`: * `action` (object) * For `call`: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create`: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward`: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide`: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): The number of the block containing the transaction. * `result` (object) * For call: * `gasUsed` (string): The amount of gas used by the call. * `output` (string): The output data from the call. * For `create`: * `address` (string): The address of the created contract. * `code` (string): The runtime code of the created contract. * `gasUsed` (string): The amount of gas used by the creation. * For `reward`: No additional fields. * For `suicide`: No additional fields. * `subtraces` (integer): The number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): The address within the trace hierarchy. * `transactionHash` (string): The hash of the transaction containing the trace. * `transactionPosition` (integer): The index position of the transaction within the block. * `type` (string): The type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_replayBlockTransactions", "params": ["0x58ddccddbc8d1deddf91e43e6623cdc2e1186f067dc687bb3928076a02bad39e", ["trace"]], "id": 1 }' ``` --- ## `trace_block` > Retrieves a detailed trace of all the transactions in a specific block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `blockNumber` (string): the number of the block you want to trace, given as a hexadecimal string. ### Returns The method returns an array of trace objects, each of which contains detailed information about a particular operation. These trace objects include the following fields: * `action` (object): describes the action that was performed. The structure of this object varies based on the type of action. * For `call` actions: * `callType` (string): the type of call (e.g., "call", "delegatecall", "staticcall"). * `from` (string): the address that initiated the call. * `to` (string): the address that was called. * `gas` (string): the amount of gas provided for the call. * `input` (string): the input data for the call. * `value` (string): the amount of Wei sent with the call. * For `create` actions: * `from` (string): the address that created the contract. * `gas` (string): the amount of gas provided for the creation. * `init` (string): the initialization code for the contract. * `value` (string): the amount of Wei sent with the creation. * For `reward` actions: * `author` (string): the address that received the reward. * `value` (string): the amount of Wei rewarded. * `rewardType` (string): the type of reward (e.g., "block", "uncle"). * For `suicide` actions: * `address` (string): the address of the contract that self-destructed. * `refundAddress` (string): the address that received the remaining balance. * `balance` (string): the remaining balance of the contract. * `blockHash` (string): the hash of the block containing the transaction. * `blockNumber` (string): the number of the block containing the transaction. * `result` (object): describes the result of the action. * For `call` actions: * `gasUsed` (string): the amount of gas used by the call. * `output` (string): the output data from the call. * For `create` actions: * `address` (string): the address of the created contract. * `code` (string): the runtime code of the created contract. * `gasUsed` (string): the amount of gas used by the creation. * For `reward` actions: no additional fields. * For `suicide` actions: no additional fields. * `subtraces` (integer): the number of subtraces (nested traces) generated by this trace. * `traceAddress` (array of integers): the address within the trace hierarchy, indicating the position of the trace in the call stack. * `transactionHash` (string): the hash of the transaction containing the trace. * `transactionPosition` (integer): the index position of the transaction within the block. * `type` (string): the type of trace (e.g., "call", "create", "reward", "suicide"). ### Request example ```shell curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "trace_block", "params": ["0x14869E9E"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tenet/ title: Tenet description: Tenet is an EVM-compatible Layer-1 bringing liquidity and yield opportunities to LSDs by using them as… 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/tenet/index.mdx --- # Tenet
> Tenet API is available on [Web3 API platform](https://www.ankr.com/rpc/tenet). *Tenet* is an EVM-compatible Layer-1 bringing liquidity and yield opportunities to LSDs by using them as collateral for network validators through [Diversified Proof of Stake](https://docs.tenet.org/diversified-pos/diversified-proof-of-stake-implementation). This increases network security and improves governance inclusivity. In order for your Web3 application to interact with Tenet — either by reading blockchain data or sending transactions to the network — it must connect to a Tenet node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/tenet/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/tenet/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/tenet/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/tenet/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/tenet/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/tenet/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/tenet/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/tenet/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/tenet/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/tenet/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/tenet/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/tenet/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/tenet/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/tenet/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/tenet/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/tenet/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/tenet/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/tenet/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/tenet/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/tenet/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tenet/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/tenet/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/tenet/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/tenet/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/tenet/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/tenet/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/tenet/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/tenet/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/tenet/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/tenet/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/tenet/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/tenet/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/tenet/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/tenet/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/tenet/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/tenet/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/tenet/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/tenet/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/tenet/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/tenet/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tenet/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/tenet/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/tenet/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tenet/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/tenet/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tenet/web3-p2/ title: Tenet — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/tenet/web3-p2.mdx --- # Tenet — web3, net, eth (2/3) > API reference for [Tenet](/rpc-service/chains/chains-api/tenet/). [All methods ->](/rpc-service/chains/chains-api/tenet/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/tenet/web3/) · 2 · [3](/rpc-service/chains/chains-api/tenet/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei; note that if the value exceeds the `from` address balance (which is 0.000000000000000001 ETH by default), then you'll receive an `insufficient funds` error in response. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0x339d413CCEfD986b1B3647A9cfa9CBbE70A30749"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x3c6b5de22d61621fa770d84ad4e5e676e19614ca0d472bfabdd85d74eb21af8b", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x4a817c800", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1312d00", "gasUsed": "0x1e736", "hash": "0x3c6b5de22d61621fa770d84ad4e5e676e19614ca0d472bfabdd85d74eb21af8b", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x20a37d499419f154ffe3806850bb144d133bae29", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x14f787", "parentHash": "0xf474f4f9086aafc54897c0136cdb78804a0fbc7dfbef4a51ad5c9269f04eec6d", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x1262", "stateRoot": "0xfdbdae899c0a9c3a08f1c8c0d4a9a8aa6319bd282c287a14101723f9a7dddd6b", "timestamp": "0x648ae4f9", "totalDifficulty": "0x0", "transactions": [ "0x4ad59daf052794fae3a031fea42fb994b574315ccb5b14f7c075e3e6bee7f4f0", "0x8707167ae0b7c619030d551c6b1b47281c82dbc8bd45d677f5ec0d6c31742cb2" ], "transactionsRoot": "0x577fb6e605a1637f6d35e56d520f408f8575933049e793b31156238a9fe2e605", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x4a817c800", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1312d00", "gasUsed": "0x0", "hash": "0xbfe3f0fd32a07c66d4a5e67eddf3d90333585f9c01e67c72501ff81ee453dcc1", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xacfa03a75b28e450aa3b06d6a0cb10feee31bb8d", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x14f7f8", "parentHash": "0xe8c017283e21f855b54c3f04364d61559e887cc83dc4244ce204ee1c0a578f25", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0xded", "stateRoot": "0x552fd8837d4c8976a8c1a7675e215c78337caf3f6dca75c25debc898fc3ce434", "timestamp": "0x648ae683", "totalDifficulty": "0x0", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x8707167ae0b7c619030d551c6b1b47281c82dbc8bd45d677f5ec0d6c31742cb2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x3c6b5de22d61621fa770d84ad4e5e676e19614ca0d472bfabdd85d74eb21af8b", "blockNumber": "0x14f787", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x1e736", "gasPrice": "0x7aef40a00", "hash": "0x8707167ae0b7c619030d551c6b1b47281c82dbc8bd45d677f5ec0d6c31742cb2", "input": "0x711746e20000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000650000000000000000000000000000000000000000000000000000185ec6dde43d00000000000000000000000000000000000000000000000000000004d21abeb50000000000000000000000000000000000000000000000000000000000000008", "nonce": "0x20b1", "to": "0xcb566e3b6934fa77258d68ea18e931fa75e1aaaa", "transactionIndex": "0x1", "value": "0x0", "type": "0x0", "chainId": "0x617", "v": "0xc51", "r": "0x1e6ffba4caefbfffada28951261531481df568b9c753f326aa87627790d2c17d", "s": "0x40d930ae4d84586f138d7d5bf1216055c199491014fc2b75eb7dfa0005b4a6ae" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x3c6b5de22d61621fa770d84ad4e5e676e19614ca0d472bfabdd85d74eb21af8b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x3c6b5de22d61621fa770d84ad4e5e676e19614ca0d472bfabdd85d74eb21af8b", "blockNumber": "0x14f787", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x1e736", "gasPrice": "0x7aef40a00", "hash": "0x4ad59daf052794fae3a031fea42fb994b574315ccb5b14f7c075e3e6bee7f4f0", "input": "0x711746e200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006d00000000000000000000000000000000000000000000000000000002540be4010000000000000000000000000000000000000000000000000000002b2430f5820000000000000000000000000000000000000000000000000000000000000010", "nonce": "0x20b0", "to": "0xcb566e3b6934fa77258d68ea18e931fa75e1aaaa", "transactionIndex": "0x0", "value": "0x0", "type": "0x0", "chainId": "0x617", "v": "0xc51", "r": "0x625bf6649511826e90ab5cba214a9339127bfe83ee7effc3b7fd7b65196ce52d", "s": "0x32bf53faf86c8412062b9ac3c0627da8cde00ef4d7665406f5517f8e226ff5f9" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x14F787", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x3c6b5de22d61621fa770d84ad4e5e676e19614ca0d472bfabdd85d74eb21af8b", "blockNumber": "0x14f787", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gas": "0x1e736", "gasPrice": "0x7aef40a00", "hash": "0x4ad59daf052794fae3a031fea42fb994b574315ccb5b14f7c075e3e6bee7f4f0", "input": "0x711746e200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006d00000000000000000000000000000000000000000000000000000002540be4010000000000000000000000000000000000000000000000000000002b2430f5820000000000000000000000000000000000000000000000000000000000000010", "nonce": "0x20b0", "to": "0xcb566e3b6934fa77258d68ea18e931fa75e1aaaa", "transactionIndex": "0x0", "value": "0x0", "type": "0x0", "chainId": "0x617", "v": "0xc51", "r": "0x625bf6649511826e90ab5cba214a9339127bfe83ee7effc3b7fd7b65196ce52d", "s": "0x32bf53faf86c8412062b9ac3c0627da8cde00ef4d7665406f5517f8e226ff5f9" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tenet/web3-p3/ title: Tenet — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/tenet/web3-p3.mdx --- # Tenet — web3, net, eth (3/3) > API reference for [Tenet](/rpc-service/chains/chains-api/tenet/). [All methods ->](/rpc-service/chains/chains-api/tenet/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/tenet/web3/) · [2](/rpc-service/chains/chains-api/tenet/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x8707167ae0b7c619030d551c6b1b47281c82dbc8bd45d677f5ec0d6c31742cb2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x3c6b5de22d61621fa770d84ad4e5e676e19614ca0d472bfabdd85d74eb21af8b", "blockNumber": "0x14f787", "contractAddress": null, "cumulativeGasUsed": "0x1e736", "from": "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749", "gasUsed": "0xf39b", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0xcb566e3b6934fa77258d68ea18e931fa75e1aaaa", "transactionHash": "0x8707167ae0b7c619030d551c6b1b47281c82dbc8bd45d677f5ec0d6c31742cb2", "transactionIndex": "0x1", "type": "0x0" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x24a06bc0dbeca06b4f3304d304d23e9dfcf2ecb8240c481d49f81724598bb0a0", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x14F670", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x339d413CCEfD986b1B3647A9cfa9CBbE70A30749"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tenet/web3/ title: Tenet — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/tenet/web3.mdx --- # Tenet — web3, net, eth (1/3) > API reference for [Tenet](/rpc-service/chains/chains-api/tenet/). [All methods ->](/rpc-service/chains/chains-api/tenet/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/tenet/web3-p2/) · [3](/rpc-service/chains/chains-api/tenet/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "Version dev ()\nCompiled at using Go go1.19.5 (amd64)" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5b2c76da96136d193336fad3fbc049867b8ca157da22f69ae0e4923648250acc" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "1559" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x66720b300" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x14f789" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x339d413CCEfD986b1B3647A9cfa9CBbE70A30749", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x14c8b1c3525c82dba0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x339d413CCEfD986b1B3647A9cfa9CBbE70A30749", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x339d413CCEfD986b1B3647A9cfa9CBbE70A30749", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x20b2" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x3c6b5de22d61621fa770d84ad4e5e676e19614ca0d472bfabdd85d74eb21af8b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x3c6b5de22d61621fa770d84ad4e5e676e19614ca0d472bfabdd85d74eb21af8b"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x339d413CCEfD986b1B3647A9cfa9CBbE70A30749", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/tenet/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x339d413CCEfD986b1B3647A9cfa9CBbE70A30749","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ton/ title: TON description: The Open Network (TON) is a decentralized and open internet platform made up of several components. 30 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/ton/index.mdx --- # TON
> TON API is available on [Web3 API platform](https://www.ankr.com/rpc/ton). The Open Network (TON) is a decentralized and open internet platform made up of several components. These include: TON Blockchain, TON DNS, TON Storage, and TON Sites. TON Blockchain is the core protocol that connects TON’s underlying infrastructure together to form the greater TON Ecosystem. TON is focused on achieving widespread cross-chain interoperability, while operating in a highly scalable secure framework. TON is designed to process millions of transactions per second (TPS), with the goal of eventually reaching hundreds of millions of users moving forward. Currently, we provide two interfaces to query TON API — [JSON-RPC](https://www.jsonrpc.org/specification) and REST. Responses for both of them come in [JSON format](https://www.json.org/json-en.html). ## JSON-RPC/REST methods **Accounts — info about accounts**: * [`getAddressInformation`](/rpc-service/chains/chains-api/ton/methods/#getaddressinformation) — retrieves address info. * [`getExtendedAddressInformation`](/rpc-service/chains/chains-api/ton/methods/#getextendedaddressinformation) — retrieves extended address info. * [`getWalletInformation`](/rpc-service/chains/chains-api/ton/methods/#getwalletinformation) — retrieves wallet info. * [`getTransactions`](/rpc-service/chains/chains-api/ton/methods/#gettransactions) — retrieves transactions. * [`getAddressBalance`](/rpc-service/chains/chains-api/ton/methods/#getaddressbalance) — retrieves address balance. * [`getAddressState`](/rpc-service/chains/chains-api/ton/methods/#getaddressstate) — retrieves address state. * [`packAddress`](/rpc-service/chains/chains-api/ton/methods/#packaddress) — packs address. * [`unpackAddress`](/rpc-service/chains/chains-api/ton/methods/#unpackaddress) — unpacks address. * [`getTokenData`](/rpc-service/chains/chains-api/ton/methods/#gettokendata) — retrieves token data. * [`detectAddress`](/rpc-service/chains/chains-api/ton/methods/#detectaddress) — detects address. **Blocks — info about blocks**: * [`getMasterchainInfo`](/rpc-service/chains/chains-api/ton/methods/#getmasterchaininfo) — retrieves masterchain info. * [`getMasterchainBlockSignatures`](/rpc-service/chains/chains-api/ton/methods/#getmasterchainblocksignatures) — retrieves masterchian block signatures. * [`getShardBlockProof`](/rpc-service/chains/chains-api/ton/methods-p2/#getshardblockproof) — retrieves shard block proof. * [`getConsensusBlock`](/rpc-service/chains/chains-api/ton/methods-p2/#getconsensusblock) — retrieves consensus block. * [`lookupBlock`](/rpc-service/chains/chains-api/ton/methods-p2/#lookupblock) — looks up block. * [`shards`](/rpc-service/chains/chains-api/ton/methods-p2/#shards) — retrieves shards. * [`getBlockTransactions`](/rpc-service/chains/chains-api/ton/methods-p2/#getblocktransactions) — retrieves block transactions. * [`getBlockTransactionsExt`](/rpc-service/chains/chains-api/ton/methods-p2/#getblocktransactionsext) — retrieves block transactions extended info. * [`getBlockHeader`](/rpc-service/chains/chains-api/ton/methods-p2/#getblockheader) — retrieves block header. * [`getOutMsgQueueSizes`](/rpc-service/chains/chains-api/ton/methods-p2/#getoutmsgqueuesizes) — retrieves messages queue sizes. **Transactions — fetching and locating transactions**: * [`getTransactions`](/rpc-service/chains/chains-api/ton/methods/#gettransactions) — retrieves transactions. * [`getBlockTransactions`](/rpc-service/chains/chains-api/ton/methods-p2/#getblocktransactions) — retrieves block transactions. * [`getBlockTransactionsExt`](/rpc-service/chains/chains-api/ton/methods-p2/#getblocktransactionsext) — retrieves block transactions extended info. * [`tryLocateTx`](/rpc-service/chains/chains-api/ton/methods-p3/#trylocatetx) — locates outgoing transaction. * [`tryLocateResultTx`](/rpc-service/chains/chains-api/ton/methods-p3/#trylocateresulttx) — locates outgoing transaction. * [`tryLocateSourceTx`](/rpc-service/chains/chains-api/ton/methods-p3/#trylocatesourcetx) — locates incoming transaction. **Get config — getting blockchain config**: * [`getConfigParam`](/rpc-service/chains/chains-api/ton/methods-2/#getconfigparam) — retrieves config param. * [`getConfigAll`](/rpc-service/chains/chains-api/ton/methods-2/#getconfigall) — retrieves full config. **Run method — running get method of smart contract**: * [`runGetMethod`](/rpc-service/chains/chains-api/ton/methods-2/#rungetmethod) — runs get method. **Send — sending data to blockchain**: * [`estimateFee`](/rpc-service/chains/chains-api/ton/methods-2/#estimatefee) — estimates fee. --- ## Methods ### Methods - [`getAddressInformation`](/rpc-service/chains/chains-api/ton/methods/#getaddressinformation) - [`getExtendedAddressInformation`](/rpc-service/chains/chains-api/ton/methods/#getextendedaddressinformation) - [`getWalletInformation`](/rpc-service/chains/chains-api/ton/methods/#getwalletinformation) - [`getTransactions`](/rpc-service/chains/chains-api/ton/methods/#gettransactions) - [`getAddressBalance`](/rpc-service/chains/chains-api/ton/methods/#getaddressbalance) - [`getAddressState`](/rpc-service/chains/chains-api/ton/methods/#getaddressstate) - [`packAddress`](/rpc-service/chains/chains-api/ton/methods/#packaddress) - [`unpackAddress`](/rpc-service/chains/chains-api/ton/methods/#unpackaddress) - [`getTokenData`](/rpc-service/chains/chains-api/ton/methods/#gettokendata) - [`detectAddress`](/rpc-service/chains/chains-api/ton/methods/#detectaddress) - [`getMasterchainInfo`](/rpc-service/chains/chains-api/ton/methods/#getmasterchaininfo) - [`getMasterchainBlockSignatures`](/rpc-service/chains/chains-api/ton/methods/#getmasterchainblocksignatures) - [`getShardBlockProof`](/rpc-service/chains/chains-api/ton/methods-p2/#getshardblockproof) - [`getConsensusBlock`](/rpc-service/chains/chains-api/ton/methods-p2/#getconsensusblock) - [`lookupBlock`](/rpc-service/chains/chains-api/ton/methods-p2/#lookupblock) - [`shards`](/rpc-service/chains/chains-api/ton/methods-p2/#shards) - [`getBlockTransactions`](/rpc-service/chains/chains-api/ton/methods-p2/#getblocktransactions) - [`getBlockTransactionsExt`](/rpc-service/chains/chains-api/ton/methods-p2/#getblocktransactionsext) - [`getBlockHeader`](/rpc-service/chains/chains-api/ton/methods-p2/#getblockheader) - [`getOutMsgQueueSizes`](/rpc-service/chains/chains-api/ton/methods-p2/#getoutmsgqueuesizes) - [`getTransactions`](/rpc-service/chains/chains-api/ton/methods/#gettransactions) - [`getBlockTransactions`](/rpc-service/chains/chains-api/ton/methods-p2/#getblocktransactions) - [`getBlockTransactionsExt`](/rpc-service/chains/chains-api/ton/methods-p2/#getblocktransactionsext) - [`tryLocateTx`](/rpc-service/chains/chains-api/ton/methods-p3/#trylocatetx) - [`tryLocateResultTx`](/rpc-service/chains/chains-api/ton/methods-p3/#trylocateresulttx) - [`tryLocateSourceTx`](/rpc-service/chains/chains-api/ton/methods-p3/#trylocatesourcetx) ### Methods - [`getConfigParam`](/rpc-service/chains/chains-api/ton/methods-2/#getconfigparam) - [`getConfigAll`](/rpc-service/chains/chains-api/ton/methods-2/#getconfigall) - [`runGetMethod`](/rpc-service/chains/chains-api/ton/methods-2/#rungetmethod) - [`estimateFee`](/rpc-service/chains/chains-api/ton/methods-2/#estimatefee) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ton/methods-2/ title: TON — Methods source: docs/rpc-service/chains/chains-api/ton/methods-2.mdx --- # TON — Methods > API reference for [TON](/rpc-service/chains/chains-api/ton/). [All methods ->](/rpc-service/chains/chains-api/ton/#methods) ## `getConfigParam` > Retrieves config by ID. ### Parameters
* `config_id` (integer; query; required): the ID of the configuration parameter to retrieve. * `seqno` (integer; query): the masterchain sequence number. If not specified, the latest blockchain state will be used. ### Returns A specific configuration parameter from the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getConfigParam?config_id=5 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getConfigParam", "params": { "config_id": 5 }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "configInfo", "config": { "@type": "tvm.cell", "bytes": "te6cckEBAQEALAAAUwH//////////////////////////////////////////4AAAACAAAABQNJ1A1s=" }, "@extra": "1731077332.7515757:0:0.8627180770404548" } } ``` --- ## `getConfigAll` > Retrieves full config. ### Parameters
* `seqno` (integer; query): the masterchain sequence number. If not specified, the latest blockchain state will be used. ### Returns Full config from the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getConfigAll ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getConfigAll", "params": {}, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "configInfo", "config": { "@type": "tvm.cell", "bytes": "te6cckIDCFwAAQAAATrxAAACASAAAQACAgLYAAMABAIC9QAxADICASAABQAGAgFiCDIIMwIBIAAHAAgCAUgACQAKAgEgADUANgIBIAB9AH4CAUgACwAMAgFqBsYGxwEBSAANAQFIAB8BKxJnLE8IZy1PCAGQAGQP////////RMAADgICxwAPABACASAAEQASAgEgApoCmwIBIAATABQCASAAGQAaAgEgABUAFgIBIAAXABgCASAAqgCrAgEgAOgA6QIBIAEmAScCASABZAFlAgEgABsAHAIBIAAdAB4CASABogGjAgEgAeAB4QIBIAIeAh8CASACXAJdASsSZy1PCGcuTwgBkABkD////////zrAACACAscAIQAiAgEgACMAJAIBIAWoBakCASAAJQAmAgEgACsALAIBIAAnACgCASAAKQAqAgEgA7gDuQIBIAP2A..." }, "@extra": "1731077952.979539:7:0.4668203125193432" } } ``` --- ## `runGetMethod` > Runs get method. Executes a get method on a smart contract on the TON blockchain. ### Request body parameters
* `address` (string; required): the address of the smart contract to interact with. Example: `EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs`. * `method` (string; required): the name of the get method to execute. Example: `get_wallet_address`. * `stack` (array; optional): an array of arguments to pass with the method. Default is an empty array. ### Returns Retrieves data from smart contracts without modifying their state. ### Request example ```shell curl --request POST https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/runGetMethod \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data ' { "address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs", "method": "get_wallet_address", "stack": [ [ "tvm.Slice", "te6cckEBAQEAJAAAQ4AbUzrTQYTUv8s/I9ds2TSZgRjyrgl2S2LKcZMEFcxj6PARy3rF" ] ] }' ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "runGetMethod", "params": { "address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs", "method": "get_wallet_address", "stack": [ [ "tvm.Slice", "te6cckEBAQEAJAAAQ4AbUzrTQYTUv8s/I9ds2TSZgRjyrgl2S2LKcZMEFcxj6PARy3rF" ] ] }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "smc.runResult", "gas_used": 3143, "stack": [ [ "cell", { "bytes": "te6cckEBAQEAJAAAQ4ANjovsYdlAob6Pq3ofaIojUCMKGuvEP9qPZMUW1kpwFzD5vQ3S", "object": { "data": { "b64": "gA2Oi+xh2UChvo+reh9oiiNQIwoa68Q/2o9kxRbWSnAXIA==", "len": 267 }, "refs": [], "special": false } } ] ], "exit_code": 0, "@extra": "1731078699.3790262:0:0.023048354399674897" } } ``` --- ## `estimateFee` > Estimates fee. Estimates the fees required for query processing. `body`, `init-code`, and `init-data` accepted in serialized format (b64-encoded). ### Request body parameters
* `address` (string; required): the address of the smart contract. * `body` (string; required): the body of the transaction in base64 format. * `ignore_chksig` (boolean; optional): whether to ignore the signature check. Default: false. ### Returns Fees required for query processing. ### Request example ```shell curl --request POST https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/estimateFee \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data ' { "address": "EQBVbC7Hu-g3htYXzst8L5ucV76NMzeBK3URJKebN2Y1k55Q", "body": "te6ccgEBBAEAwwABRYgAqthdj3fQbw2sL52W+F83OK99GmZvAlbqIklPNm7MayYMAQGcJRnEjp8cFJEdHYEy0LKHHYzifhXgDjogvM4i1RhNr6JL5bGaLxFWgLvL/9Q5K9CsRfVakAbG1JfXmJjD+54vAimpoxdm1XNnAAAAEwADAgFkQgA0XvoMzOTI+7LhqhMUCzQfZ6f1jWBzDLBT90cgmTz0fBE4gAAAAAAAAAAAAAAAAAEDACoAAAAAdGhpcyBpcyBhIHRlc3QgdHg=", "ignore_chksig": false }' ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "estimateFee", "params": { "address": "EQBVbC7Hu-g3htYXzst8L5ucV76NMzeBK3URJKebN2Y1k55Q", "body": "te6ccgEBBAEAwwABRYgAqthdj3fQbw2sL52W+F83OK99GmZvAlbqIklPNm7MayYMAQGcJRnEjp8cFJEdHYEy0LKHHYzifhXgDjogvM4i1RhNr6JL5bGaLxFWgLvL/9Q5K9CsRfVakAbG1JfXmJjD+54vAimpoxdm1XNnAAAAEwADAgFkQgA0XvoMzOTI+7LhqhMUCzQfZ6f1jWBzDLBT90cgmTz0fBE4gAAAAAAAAAAAAAAAAAEDACoAAAAAdGhpcyBpcyBhIHRlc3QgdHg=", "ignore_chksig": false }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "query.fees", "source_fees": { "@type": "fees", "in_fwd_fee": 996800, "storage_fee": 0, "gas_fee": 40000, "fwd_fee": 0 }, "destination_fees": [], "@extra": "1731079591.0619361:0:0.37221728035875046" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ton/methods-p2/ title: TON — Methods (2/3) source: docs/rpc-service/chains/chains-api/ton/methods-p2.mdx --- # TON — Methods (2/3) > API reference for [TON](/rpc-service/chains/chains-api/ton/). [All methods ->](/rpc-service/chains/chains-api/ton/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/ton/methods/) · 2 · [3](/rpc-service/chains/chains-api/ton/methods-p3/) ## `getShardBlockProof` > Retrieves shard block proof. Retrieves the proof of a specific shard block on the TON blockchain. ### Parameters
* `workchain` (integer; query; required): the block workchain ID. Example: `-1` for the masterchain. * `shard` (integer; query; required): the block shard ID. Example: `-9223372036854775808` for the masterchain. * `seqno` (integer; query; required): the sequence number of the masterchain block for which to retrieve signatures. * `from_seqno` (integer; query): the sequence number of the masterchain block starting from which the proof is required. If not specified latest masterchain block is used. ### Returns The proof of a specific shard block on the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getShardBlockProof?workchain=-1&shard=-9223372036854775808&seqno=39064985 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getShardBlockProof", "params": { "workchain": -1, "shard": -9223372036854775808, "seqno": 39064865 }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "blocks.shardBlockProof", "from": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 41808549, "root_hash": "s7xGa9Mp3ly90+p6CEyQ2jQgC4lhFktWBC99VCNalhA=", "file_hash": "otXbmchM7gVDOnMo99RcezYGKv7XOICChVs15K5mFu8=" }, "mc_id": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 39064985, "root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=", "file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M=" }, "links": [], "mc_proof": [ { "@type": "blocks.blockLinkBack", "to_key_block": false, "from": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 41808549, "root_hash": "s7xGa9Mp3ly90+p6CEyQ2jQgC4lhFktWBC99VCNalhA=", "file_hash": "otXbmchM7gVDOnMo99RcezYGKv7XOICChVs15K5mFu8=" }, "to": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 39064985, "root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=", "file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M=" }, "dest_proof": "te6ccgECBwEAAUcACUYD8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/sAFgEkEBHvVar///8RAgMEBQGgm8ephwAAAAAEAQJUFZkAAAABAP////8AAAAAAAAAAGaXMXwAACt6kiZ7gAAAK3qSJnuEhbCm0wAI8i0CVBWVAlQU...", "proof": "te6ccgECCQEAAfoACUYDs7xGa9Mp3ly90+p6CEyQ2jQgC4lhFktWBC99VCNalhAAFQEkEBHvVar///8RAgMEBQGgm8ephwAAAAAEAQJ98qUAAAABAP////8AAAAAAAAAAGcuCMYAAC4bdxckQAAALht3FyRELyM3uwAJjQ4CffKhAn2ug8QAAAAJAAAAAAAAAe4GKEgBAXr54c8Gc+eWcHETEHYK/CztB+T1ieXVEoBn1572ldkCAAMqigRpFcGq8hDStc521CzfSTiXxjfhoWUP1kP/q+8wjF6fkv4hVokx69NGJUjnOO8UvPQC/j...", "state_proof": "te6ccgECcAEADIkACUYD/iFWiTHr00YlSOc47xS89AL+P4rCuq4G0iP3ZgTHMsABbwEkW5Ajr+L///8RAP////8AAAAAAAAAAAJ98qUAAAABZy4IxgAALht3FyREAn3yoWACAwQFKEgBAUUKG6HVTbjHrjXJoRaa4m9/CZLcQ8jQHvlvDAcBD2rwAAEoSAEB0du2kTZcVh2Ne1F8P0D7eOk45xNyeq8QG794Zq98TmQBbiIzAAAAAAAAAAD//////////4HBuempBkmw+CgGByRVzCaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqsI4MhMW7ZfvfggJCgsoSAEBpafSQFfYZDslJ3CdmGzaOEatyz7dwy0o7CH2nhfbqu8AAShIAQFH1daNUVAp9rX2NNYO0AXdnjuS9fglxh8OI1KoLN2vrAAlKEgBATJfFYvXj+BzkWTrjA8QIG3vJcXD/xs..." } ], "@extra": "1731070166.2531776:0:0.6464551742790462" } } ``` --- ## `getConsensusBlock` > Retrieves consensus block. Retrieves the consensus block and its update timestamp. ### Parameters None. ### Returns Information about the latest consensus block on the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getConsensusBlock ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getConsensusBlock", "params": {}, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "consensus_block": 41808671, "timestamp": 1731070487.261679 } } ``` --- ## `lookupBlock` > looks up block. Retrieves detailed information about a specific block in the TON blockchain. ### Parameters
* `workchain` (integer; query; required): the block workchain ID. Example: `-1` for the masterchain. * `shard` (integer; query; required): the block shard ID. Example: `-9223372036854775808` for the masterchain. * `seqno` (integer; query; required): the sequence number of the block. Example: `39064985`. * `lt` (integer; query): the block's logical time. * `unixtime` (integer; query): the block's unix time. ### Returns Detailed information about a specific block on the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/lookupBlock?workchain=-1&shard=-9223372036854775808&seqno=39064985 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "lookupBlock", "params": { "workchain": -1, "shard": -9223372036854775808, "seqno": 39064985 }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 39064985, "root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=", "file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M=", "@extra": "1731070853.2663236:0:0.3731994442759804" } } ``` --- ## `shards` > Retrieves shards information. ### Parameters
* `seqno` (integer; query; required): the sequence number of the masterchain block. Example: `39064985`. ### Returns Information about shards for a specific masterchain block on the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/shards?seqno=39064985 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "shards", "params": { "seqno": "39064985" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "blocks.shards", "shards": [ { "@type": "ton.blockIdExt", "workchain": 0, "shard": "4611686018427387904", "seqno": 44599306, "root_hash": "c5B0hqpAddUbvNiSf3gjdzRf3CwZwI6Sf0wQsWwOGsA=", "file_hash": "ZtTs6ODJrgoBSIs5df5ldHaiamLOpsFT2uSV+5VzFn8=" }, { "@type": "ton.blockIdExt", "workchain": 0, "shard": "-4611686018427387904", "seqno": 44599315, "root_hash": "uf8DTtjRw5hQc1tBi/gD3sCNcFrAjnKeIuPPIUjR3h0=", "file_hash": "s0afHo/ReFDI8s6e2+6BjpSRpJjN6ST1DfY1Ke2fMm4=" } ], "@extra": "1731071058.0157397:0:0.09471235795206101" } } ``` --- ## `getBlockTransactions` > Retrieves transactions of a given block. ### Parameters
* `workchain` (integer; query; required): the block workchain ID. Example: `-1` for the masterchain. * `shard` (integer; query; required): the block shard ID. Example: `-9223372036854775808` for the masterchain. * `seqno` (integer; query; required): the sequence number of the block. Example: `39064985`. * `root_hash` (string; query): the root hash of the block for which to request transactions. * `file_hash` (string; query): the file hash associated with the block. * `after_lt` (integer; query): the logical time (LT) marker after which to retrieve transactions. * `after_hash` (string; query): the hash of the last transaction from which to continue fetching additional transactions. * `count` (integer; query; default=40): max number of transactions to return. ### Returns Transactions from a specific block on the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockTransactions?workchain=-1&shard=-9223372036854775808&seqno=39064985 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getBlockTransactions", "params": { "workchain": -1, "shard": -9223372036854775808, "seqno": 39064985 }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "blocks.transactions", "id": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 39064985, "root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=", "file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M=" }, "req_count": 40, "incomplete": false, "transactions": [ { "@type": "blocks.shortTxId", "mode": 135, "account": "-1:3333333333333333333333333333333333333333333333333333333333333333", "lt": "47805438000001", "hash": "oWXZAgtiaqG69JC90PhKUCu/czgLghQVqQGAhxIetMY=" }, { "@type": "blocks.shortTxId", "mode": 135, "account": "-1:3333333333333333333333333333333333333333333333333333333333333333", "lt": "47805438000002", "hash": "gG/fp7ukb3YHhcqRqhARG24xuNncdgc7dT4aSWLhRCI=" }, { "@type": "blocks.shortTxId", "mode": 135, "account": "-1:5555555555555555555555555555555555555555555555555555555555555555", "lt": "47805438000003", "hash": "6p8ROuJ33hA6l7SrfhiXG1XB8YUNEnm05IElYQQCDek=" } ], "@extra": "1731071592.980471:0:0.13996576074060574" } } ``` --- ## `getBlockTransactionsExt` > Retrieves block transactions extended info. ### Parameters
* `workchain` (integer; query; required): the block workchain ID. Example: `-1` for the masterchain. * `shard` (integer; query; required): the block shard ID. Example: `-9223372036854775808` for the masterchain. * `seqno` (integer; query; required): the sequence number of the block. Example: `39064985`. * `root_hash` (string; query): the root hash of the block for which to request transactions. * `file_hash` (string; query): the file hash associated with the block. * `after_lt` (integer; query): the logical time (LT) marker after which to retrieve transactions. * `after_hash` (string; query): the hash of the last transaction from which to continue fetching additional transactions. * `count` (integer; query; default=40): max number of transactions to return. ### Returns Detailed information about transactions from a specific block on the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockTransactionsExt?workchain=-1&shard=-9223372036854775808&seqno=39064985 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getBlockTransactionsExt", "params": { "workchain": -1, "shard": -9223372036854775808, "seqno": 39064874 }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "blocks.transactionsExt", "id": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 39064985, "root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=", "file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M=" }, "req_count": 40, "incomplete": false, "transactions": [ { "@type": "raw.transaction", "address": { "@type": "accountAddress", "account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF" }, "utime": 1721184636, "data": "te6cckECBgEAASwAA69zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAAArepIme4GscsDwDDBgx9i/DeB5aFmy2vrV8aOK0rP/cq/8TPKZcwAAK3qSFzlCZpcxfAABQIAQIDAAEgAIJy8I5H0zoxilm4IYvCWq+YZvggOAzax3zPCIkpOOBNG8wO3imDKvL7ljWwH4GPI4A1OWEW8XeiXiwJjU86+K4vmQIFIDAkBAUAoEMBkBCwdgAAAAAAAAAAAIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvAAAAAAAAAAAAAAAABLUUtpEnlC4z33SeGHxRhIq/htUa7i3D8ghbwxhQTn44ES774TA==", "transaction_id": { "@type": "internal.transactionId", "lt": "47805438000001", "hash": "oWXZAgtiaqG69JC90PhKUCu/czgLghQVqQGAhxIetMY=" }, "fee": "0", "storage_fee": "0", "other_fee": "0", "out_msgs": [], "account": "-1:3333333333333333333333333333333333333333333333333333333333333333" }, { "@type": "raw.transaction", "address": { "@type": "accountAddress", "account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF" }, "utime": 1721184636, "data": "te6cckECBwEAAYoAA69zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAAArepIme4KhZdkCC2Jqobr0kL3Q+EpQK79zOAuCFBWpAYCHEh60xgAAK3qSJnuBZpcxfAABQIAQIDAQGgBACCcg7eKYMq8vuWNbAfgY8jgDU5YRbxd6JeLAmNTzr4ri+ZpP0ft+83iz9Yc0BgMlvUwWg3jAnIjmISfn+TgvvOiOICDwQJLVTvQJgRBQYAq2n+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE/zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzS1U70CAAAAFb1JEz3AM0uYvhAAKBCr3AQsHYAAAAAAAAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbwAAAAAAAAAAAAAAAAS1FLaRJ5QuM990nhh8UYSKv4bVGu4tw/IIW8MYUE5+OBOSEDw0=", "transaction_id": { "@type": "internal.transactionId", "lt": "47805438000002", "hash": "gG/fp7ukb3YHhcqRqhARG24xuNncdgc7dT4aSWLhRCI=" }, "fee": "0", "storage_fee": "0", "other_fee": "0", "in_msg": { "@type": "raw.message", "source": { "@type": "accountAddress", "account_address": "Ef8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAU" }, "destination": { "@type": "accountAddress", "account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF" }, "value": "3042163970", "fwd_fee": "0", "ihr_fee": "0", "created_lt": "47805438000000", "body_hash": "lqKW0iTyhcZ77pPDD4owkVfw2qNdxbh+QQt4YwoJz8c=", "msg_data": { "@type": "msg.dataRaw", "body": "te6cckEBAQEAAgAAAEysuc0=", "init_state": "" } }, "out_msgs": [], "account": "-1:3333333333333333333333333333333333333333333333333333333333333333" }, { "@type": "raw.transaction", "address": { "@type": "accountAddress", "account_address": "Ef9VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVbxn" }, "utime": 1721184636, "data": "te6cckECBgEAASwAA691VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAAArepIme4OECgCvSheQctVrVPqeBE/WfbkG6v5cpslm2if1ScBQRgAAK3qSFzlDZpcxfAABQIAQIDAAEgAIJyQ/ThOpAPm9H/T3ILcT7NCWm9UnbAgiq5qKeHYGOf36hhkadzn9gB0z9C3sKgAmTwI1mVw0NYAp/yY+U2+xU+aAIFMDAkBAUAoEGCkBCwdgAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvAAAAAAAAAAAAAAAABLUUtpEnlC4z33SeGHxRhIq/htUa7i3D8ghbwxhQTn44ECXKhng==", "transaction_id": { "@type": "internal.transactionId", "lt": "47805438000003", "hash": "6p8ROuJ33hA6l7SrfhiXG1XB8YUNEnm05IElYQQCDek=" }, "fee": "0", "storage_fee": "0", "other_fee": "0", "out_msgs": [], "account": "-1:5555555555555555555555555555555555555555555555555555555555555555" } ], "@extra": "1731071979.505911:1:0.010321268558367347" } } ``` --- ## `getBlockHeader` > Retrieves block header. Retrieves metadata of a given block. ### Parameters
* `workchain` (integer; query; required): the block workchain ID. Example: `-1` for the masterchain. * `shard` (integer; query; required): the block shard ID. Example: `-9223372036854775808` for the masterchain. * `seqno` (integer; query; required): the sequence number of the block. Example: `39064985`. * `root_hash` (string; query): the root hash of the block for which to request transactions. * `file_hash` (string; query): the file hash associated with the block. ### Returns Detailed metadata about a block, including its identifiers, state flags, and timing information. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockHeader?workchain=-1&shard=-9223372036854775808&seqno=39064985 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getBlockHeader", "params": { "workchain": -1, "shard": -9223372036854775808, "seqno": 39064874 }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "blocks.header", "id": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 39064985, "root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=", "file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M=" }, "global_id": -239, "version": 0, "flags": 1, "after_merge": false, "after_split": false, "before_split": false, "want_merge": true, "want_split": false, "validator_list_hash_short": -2052020525, "catchain_seqno": 586285, "min_ref_mc_seqno": 39064981, "is_key_block": false, "prev_key_block_seqno": 39064828, "start_lt": "47805438000000", "end_lt": "47805438000004", "gen_utime": 1721184636, "vert_seqno": 1, "prev_blocks": [ { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 39064984, "root_hash": "2IPv7Ob6GLJAUa6mnyLRWgiZPumAMtf9I4rKJ4CYA7U=", "file_hash": "MlowUE4mRqGoS7aKMmXROnpBDTL35jpZDZDrd+oDtBc=" } ], "@extra": "1731074187.3699944:0:0.9581414160490025" } } ``` --- ## `getOutMsgQueueSizes` > Retrieves messages queue sizes. Retrieves info with current sizes of messages queues by shards. ### Parameters None. ### Returns Information about the size of message queues associated with a specified block or shard. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getOutMsgQueueSizes ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getOutMsgQueueSizes", "params": {}, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "blocks.outMsgQueueSizes", "shards": [ { "@type": "blocks.outMsgQueueSize", "id": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 41810136, "root_hash": "PfkJ9d9Y7C+YuemqU1EZuJHVAYLsW8DarhUvT4vZV9U=", "file_hash": "QimWa2jewflBa8R91i8+2/3+FGTGggOe0ObOrxnch8c=" }, "size": 1 }, { "@type": "blocks.outMsgQueueSize", "id": { "@type": "ton.blockIdExt", "workchain": 0, "shard": "2305843009213693952", "seqno": 46979192, "root_hash": "XWJreLPIZ6hvembivVKNjL7DCB/Zha5eJrMIMLsawGo=", "file_hash": "voQ0q1oAGFF6GkiV0I7UUQ3fubnxoeKQ/D7AuFHCJ9U=" }, "size": 128 }, { "@type": "blocks.outMsgQueueSize", "id": { "@type": "ton.blockIdExt", "workchain": 0, "shard": "6917529027641081856", "seqno": 46992152, "root_hash": "xtxBOJrfNB9E3DMI3X3a1Ydt+/39LF+zJ3O5QQ0JmpE=", "file_hash": "hfgU2iDQaZ0vt9hNbcevGWbaWbrQeL9VFjGWqX2XGXY=" }, "size": 175 }, { "@type": "blocks.outMsgQueueSize", "id": { "@type": "ton.blockIdExt", "workchain": 0, "shard": "-6917529027641081856", "seqno": 46753006, "root_hash": "RZGjpslMKh9r4X/6j/RSNubR3MGFWo2T+II59CG4FpU=", "file_hash": "Qskhx4BuIiXKyQKZaL+ZKndM76cI4+4F+Z6RhDF2HFU=" }, "size": 117 }, { "@type": "blocks.outMsgQueueSize", "id": { "@type": "ton.blockIdExt", "workchain": 0, "shard": "-2305843009213693952", "seqno": 46951966, "root_hash": "CbJl2xiawT0B9iJIgQv6+xllWdRD92kFp83ajojbSdo=", "file_hash": "U5A22AXfIQAkeFVZT1yvyoIcREK/vDR8QHBlV9RcI30=" }, "size": 113 } ], "ext_msg_queue_size_limit": 8000, "@extra": "1731074512.3481815:16:0.07293629857925221" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ton/methods-p3/ title: TON — Methods (3/3) source: docs/rpc-service/chains/chains-api/ton/methods-p3.mdx --- # TON — Methods (3/3) > API reference for [TON](/rpc-service/chains/chains-api/ton/). [All methods ->](/rpc-service/chains/chains-api/ton/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/ton/methods/) · [2](/rpc-service/chains/chains-api/ton/methods-p2/) · 3 ## `getTransactions` > Retrieves transactions. Retrieves transaction history of a given address. ### Parameters
* `address` (string; query; required): an identifier of a target TON account. * `limit` (integer; query; default=10, max=100): maximum number of transactions in response. * `lt` (integer; query): logical time of transaction to start with, must be sent with `hash`. * `hash` (string; query): the hash of transaction to start with, in base64 or hex encoding , must be sent with `lt`. * `to_lt` (integer; query): logical time of transaction to finish with (to get tx from `lt` to `to_lt`). * `archival` (boolean; query; default=false): by default `getTransaction` request is processed by any available liteserver. If `archival=true` only liteservers with full history are used. ### Returns The transaction history for a specific address. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getTransactions?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getTransactions", "params": { "address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": [ { "@type": "raw.transaction", "utime": 1730897178, "data": "te6cckECDwEAAywAA7V/l26clqHVRGrod9+7tISkJI53k+e7PGKqChEe+RI36rAAAuDEt9e0EUhqqRoLlokU16oee06iuNKCfrXMhyS9QXJLNJK+RvjwAALf81h8KBZytlGgADRhjwMIAQIDAgHgBAUAgnKmm1F2uF+qjoLb+DOkjIiO+1S2/rUFfz/9X0ecgCrNJJxt7rYpNtcbz4bUhkV3+hJYM6a4v6txgynCn27hbW/LAhkEhZUJANqpBRhgw1ARDQ4BsWgAAHEQFvmJp3gRyAJ1sBIV0YcBim66VsLr6L2rS6H3pL8APl26clqHVRGrod9+7tISkJI53k+e7PGKqChEe+RI36rQDaqQUAYQFLQAAFwYloDkhM5Wyh7ABgEB3wcBqA+KfqVUbeTv2XoE7jY5HJgB8zYowBXIml4lYvHRjdV68RJV0Fi8i20THzvW/WQH84kAAA4iAt8xNO8COQBOtgJCujDgMU3XSthdfRe1aXQ+9JfCAwwCsWgB8u3TktQ6qI1dDvv3dpCUhJHO8nz3Z4xVQUIj3yJG/VcAIzum7Z4PaYlBTeFvKo6mdRJVSxaBZjYWdNcZV1Ty5TgQDUbO0AYZHTgAAFwYlvr2hM5WyjXgCAkCATQKCwGnF41FGVRt5O/ZegTuNjkcmAAAcRAW+YmneBHIAnWwEhXRhwGKbrpWwuvovatLofekvwAADiIC3zE07wI5AE62AkK6MOAxTddK2F19F7VpdD70l8QHDAhCAo9FLXpN/XQGa2gjZRdyWe0Fc0Q1vna1/UvV2K8rfD1oAIcAgB8zYowBXIml4lYvHRjdV68RJV0Fi8i20THzvW/WQH84kALETqZS1AkoWcZ9pE5Mo63WVlsOKJfWQKLFG/s3DYh3+gAaAAAAADEwOTUxNTg2OACeQH0MCL8UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABvyYlq8EwZHRAAAAAAAAIAAAAAAALC24AfOr7B+9wHRF8yKXY1QVDD2tgXWyS0aakzhF8WbEGQR6TI4r5Y", "transaction_id": { "@type": "internal.transactionId", "lt": "50630341000001", "hash": "/PZphaovGJ1xCTklvEPzGszPvBaotdzWcon79et+Nvw=" }, "fee": "1640116", "storage_fee": "5716", "other_fee": "1634400", "in_msg": { "@type": "raw.message", "source": "EQAAOIgLfMTTvAjkATrYCQrow4DFN10rYXX0XtWl0PvSX5uk", "destination": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W", "value": "57320468", "fwd_fee": "526938", "ihr_fee": "0", "created_lt": "50630337000002", "body_hash": "vt02QoQHP7hw48TBJm8i1YII+Zx8kL/QfNVj79Kmt7w=", "msg_data": { "@type": "msg.dataRaw", "body": "te6cckEBAgEAZgABqA+KfqVUbeTv2XoE7jY5HJgB8zYowBXIml4lYvHRjdV68RJV0Fi8i20THzvW/WQH84kAAA4iAt8xNO8COQBOtgJCujDgMU3XSthdfRe1aXQ+9JfCAwEAGgAAAAAxMDk1MTU4NjicCb0U", "init_state": "" }, "message": "D4p+pVRt5O/ZegTuNjkcmAHzNijAFciaXiVi8dGN1XrxElXQWLyLbRMfO9b9ZAfziQAADiIC3zE0\n7wI5AE62AkK6MOAxTddK2F19F7VpdD70l8ID\n" }, "out_msgs": [ { "@type": "raw.message", "source": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W", "destination": "EQCM7pu2eD2mJQU3hbyqOpnUSVUsWgWY2FnTXGVdU8uU4Ddb", "value": "55686068", "fwd_fee": "822940", "ihr_fee": "0", "created_lt": "50630341000002", "body_hash": "Ycyf2S915TpjkcLaOH70Kse87Z1rZrF65nPLm/70Rms=", "msg_data": { "@type": "msg.dataRaw", "body": "te6cckEBAgEAZgABpxeNRRlUbeTv2XoE7jY5HJgAAHEQFvmJp3gRyAJ1sBIV0YcBim66VsLr6L2rS6H3pL8AAA4iAt8xNO8COQBOtgJCujDgMU3XSthdfRe1aXQ+9JfEBwEAGgAAAAAxMDk1MTU4NjhoTgE0", "init_state": "te6cckEBAwEAbgACATQBAghCAo9FLXpN/XQGa2gjZRdyWe0Fc0Q1vna1/UvV2K8rfD1oAIcAgB8zYowBXIml4lYvHRjdV68RJV0Fi8i20THzvW/WQH84kALETqZS1AkoWcZ9pE5Mo63WVlsOKJfWQKLFG/s3DYh3+vXib6g=" }, "message": "F41FGVRt5O/ZegTuNjkcmAAAcRAW+YmneBHIAnWwEhXRhwGKbrpWwuvovatLofekvwAADiIC3zE0\n7wI5AE62AkK6MOAxTddK2F19F7VpdD70l8QG\n" } ] } ] } ``` --- ## `getBlockTransactions` > Retrieves transactions of a given block. ### Parameters
* `workchain` (integer; query; required): the block workchain ID. Example: `-1` for the masterchain. * `shard` (integer; query; required): the block shard ID. Example: `-9223372036854775808` for the masterchain. * `seqno` (integer; query; required): the sequence number of the block. Example: `39064985`. * `root_hash` (string; query): the root hash of the block for which to request transactions. * `file_hash` (string; query): the file hash associated with the block. * `after_lt` (integer; query): the logical time (LT) marker after which to retrieve transactions. * `after_hash` (string; query): the hash of the last transaction from which to continue fetching additional transactions. * `count` (integer; query; default=40): max number of transactions to return. ### Returns Transactions from a specific block on the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockTransactions?workchain=-1&shard=-9223372036854775808&seqno=39064985 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getBlockTransactions", "params": { "workchain": -1, "shard": -9223372036854775808, "seqno": 39064985 }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "blocks.transactions", "id": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 39064985, "root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=", "file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M=" }, "req_count": 40, "incomplete": false, "transactions": [ { "@type": "blocks.shortTxId", "mode": 135, "account": "-1:3333333333333333333333333333333333333333333333333333333333333333", "lt": "47805438000001", "hash": "oWXZAgtiaqG69JC90PhKUCu/czgLghQVqQGAhxIetMY=" }, { "@type": "blocks.shortTxId", "mode": 135, "account": "-1:3333333333333333333333333333333333333333333333333333333333333333", "lt": "47805438000002", "hash": "gG/fp7ukb3YHhcqRqhARG24xuNncdgc7dT4aSWLhRCI=" }, { "@type": "blocks.shortTxId", "mode": 135, "account": "-1:5555555555555555555555555555555555555555555555555555555555555555", "lt": "47805438000003", "hash": "6p8ROuJ33hA6l7SrfhiXG1XB8YUNEnm05IElYQQCDek=" } ], "@extra": "1731071592.980471:0:0.13996576074060574" } } ``` --- ## `getBlockTransactionsExt` > Retrieves block transactions extended info. ### Parameters
* `workchain` (integer; query; required): the block workchain ID. Example: `-1` for the masterchain. * `shard` (integer; query; required): the block shard ID. Example: `-9223372036854775808` for the masterchain. * `seqno` (integer; query; required): the sequence number of the block. Example: `39064985`. * `root_hash` (string; query): the root hash of the block for which to request transactions. * `file_hash` (string; query): the file hash associated with the block. * `after_lt` (integer; query): the logical time (LT) marker after which to retrieve transactions. * `after_hash` (string; query): the hash of the last transaction from which to continue fetching additional transactions. * `count` (integer; query; default=40): max number of transactions to return. ### Returns Detailed information about transactions from a specific block on the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockTransactionsExt?workchain=-1&shard=-9223372036854775808&seqno=39064985 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getBlockTransactionsExt", "params": { "workchain": -1, "shard": -9223372036854775808, "seqno": 39064874 }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "blocks.transactionsExt", "id": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 39064985, "root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=", "file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M=" }, "req_count": 40, "incomplete": false, "transactions": [ { "@type": "raw.transaction", "address": { "@type": "accountAddress", "account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF" }, "utime": 1721184636, "data": "te6cckECBgEAASwAA69zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAAArepIme4GscsDwDDBgx9i/DeB5aFmy2vrV8aOK0rP/cq/8TPKZcwAAK3qSFzlCZpcxfAABQIAQIDAAEgAIJy8I5H0zoxilm4IYvCWq+YZvggOAzax3zPCIkpOOBNG8wO3imDKvL7ljWwH4GPI4A1OWEW8XeiXiwJjU86+K4vmQIFIDAkBAUAoEMBkBCwdgAAAAAAAAAAAIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvAAAAAAAAAAAAAAAABLUUtpEnlC4z33SeGHxRhIq/htUa7i3D8ghbwxhQTn44ES774TA==", "transaction_id": { "@type": "internal.transactionId", "lt": "47805438000001", "hash": "oWXZAgtiaqG69JC90PhKUCu/czgLghQVqQGAhxIetMY=" }, "fee": "0", "storage_fee": "0", "other_fee": "0", "out_msgs": [], "account": "-1:3333333333333333333333333333333333333333333333333333333333333333" }, { "@type": "raw.transaction", "address": { "@type": "accountAddress", "account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF" }, "utime": 1721184636, "data": "te6cckECBwEAAYoAA69zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAAArepIme4KhZdkCC2Jqobr0kL3Q+EpQK79zOAuCFBWpAYCHEh60xgAAK3qSJnuBZpcxfAABQIAQIDAQGgBACCcg7eKYMq8vuWNbAfgY8jgDU5YRbxd6JeLAmNTzr4ri+ZpP0ft+83iz9Yc0BgMlvUwWg3jAnIjmISfn+TgvvOiOICDwQJLVTvQJgRBQYAq2n+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE/zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzS1U70CAAAAFb1JEz3AM0uYvhAAKBCr3AQsHYAAAAAAAAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbwAAAAAAAAAAAAAAAAS1FLaRJ5QuM990nhh8UYSKv4bVGu4tw/IIW8MYUE5+OBOSEDw0=", "transaction_id": { "@type": "internal.transactionId", "lt": "47805438000002", "hash": "gG/fp7ukb3YHhcqRqhARG24xuNncdgc7dT4aSWLhRCI=" }, "fee": "0", "storage_fee": "0", "other_fee": "0", "in_msg": { "@type": "raw.message", "source": { "@type": "accountAddress", "account_address": "Ef8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAU" }, "destination": { "@type": "accountAddress", "account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF" }, "value": "3042163970", "fwd_fee": "0", "ihr_fee": "0", "created_lt": "47805438000000", "body_hash": "lqKW0iTyhcZ77pPDD4owkVfw2qNdxbh+QQt4YwoJz8c=", "msg_data": { "@type": "msg.dataRaw", "body": "te6cckEBAQEAAgAAAEysuc0=", "init_state": "" } }, "out_msgs": [], "account": "-1:3333333333333333333333333333333333333333333333333333333333333333" }, { "@type": "raw.transaction", "address": { "@type": "accountAddress", "account_address": "Ef9VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVbxn" }, "utime": 1721184636, "data": "te6cckECBgEAASwAA691VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAAArepIme4OECgCvSheQctVrVPqeBE/WfbkG6v5cpslm2if1ScBQRgAAK3qSFzlDZpcxfAABQIAQIDAAEgAIJyQ/ThOpAPm9H/T3ILcT7NCWm9UnbAgiq5qKeHYGOf36hhkadzn9gB0z9C3sKgAmTwI1mVw0NYAp/yY+U2+xU+aAIFMDAkBAUAoEGCkBCwdgAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvAAAAAAAAAAAAAAAABLUUtpEnlC4z33SeGHxRhIq/htUa7i3D8ghbwxhQTn44ECXKhng==", "transaction_id": { "@type": "internal.transactionId", "lt": "47805438000003", "hash": "6p8ROuJ33hA6l7SrfhiXG1XB8YUNEnm05IElYQQCDek=" }, "fee": "0", "storage_fee": "0", "other_fee": "0", "out_msgs": [], "account": "-1:5555555555555555555555555555555555555555555555555555555555555555" } ], "@extra": "1731071979.505911:1:0.010321268558367347" } } ``` --- ## `tryLocateTx` > Locates outgoing transaction. Locates an outgoing transaction of the destination address by incoming message. ### Parameters
* `source` (string; query; required): the source address of the transaction. * `destination` (string; query; required): recipient address of the transaction. * `created_lt` (string; query; required): the logical time when the transaction was created. ### Returns Specific transaction on the TON blockchain based on the source address, destination address, and the logical time of its creation. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/tryLocateTx?source=UQAX2d4C2d48JeA-0y2_peGabRVumnKY22xPvkuEayC3zTI1&destination=UQBP4mzpDIywL1SV-Wp9ZuBBlzprR9eXQgSYGEXiUEHm73vA&created_lt=47597573000002 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "tryLocateTx", "params": { "source": "UQAX2d4C2d48JeA-0y2_peGabRVumnKY22xPvkuEayC3zTI1", "destination": "UQBP4mzpDIywL1SV-Wp9ZuBBlzprR9eXQgSYGEXiUEHm73vA", "created_lt": "47597573000002" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "raw.transaction", "utime": 1720370807, "data": "te6cckECCAEAAcYAA7N0/ibOkMjLAvVJX5an1m4EGXOmtH15dCBJgYReJQQebvAAArSixuS0NxLUvVgs8QeGGFM2MZwhibMZb5gyItVOLXOT/S0xskoAAAK0graeWDZorGdwABRUR+gBAgMBAaAEAIJyQ6mmQyZ39HLmBav8jckU7IrGamu4wzwWzKlJuYOGa/n6kZCfzjVebR8px97WNeOqId7XzjMSA2dM8e5vAZIEWgIVDIF/yMPQkBhTiBEGBwGvSAAvs7wFs7x4S8B9plt/S8M02irdNOUxttiffJcI1kFvmwAT+Js6QyMsC9UlflqfWbgQZc6a0fXl0IEmBhF4lBB5u8w9CQAGDGcIAABWlFjcloTNFYzuwAUAagAAAABidWdhdHRpYm95dmljZSAyNjUsMDAwIPCfko4gYXZhaWxhYmxlIG9uIGZyYWdtZW50AJonyCcQAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbwAAAAAAAAAAAAAAAAS1FLaRJ5QuM990nhh8UYSKv4bVGu4tw/IIW8MYUE5+OBHSfO+8=", "transaction_id": { "@type": "internal.transactionId", "lt": "47597573000003", "hash": "mlVb0ixiGkELIAog5jwcqDOEcJa3R1CQk/20yaYAQ10=" }, "fee": "41535", "storage_fee": "1535", "other_fee": "40000", "in_msg": { "@type": "raw.message", "source": "EQAX2d4C2d48JeA-0y2_peGabRVumnKY22xPvkuEayC3zW_w", "destination": "EQBP4mzpDIywL1SV-Wp9ZuBBlzprR9eXQgSYGEXiUEHm7yYF", "value": "1000000", "fwd_fee": "406404", "ihr_fee": "0", "created_lt": "47597573000002", "body_hash": "0+UqzPwXQY+jCm7ohKTneJ+Yi3q08vctwy000JALqts=", "msg_data": { "@type": "msg.dataText", "text": "YnVnYXR0aWJveXZpY2UgMjY1LDAwMCDwn5KOIGF2YWlsYWJsZSBvbiBmcmFnbWVudA==" }, "message": "bugattiboyvice 265,000 💎 available on fragment" }, "out_msgs": [] } } ``` --- ## `tryLocateResultTx` > Locates outgoing transaction. Same as previous. Locates an outgoing transaction of destination address by incoming message. ### Parameters
* `source` (string; query; required): the source address of the transaction. * `destination` (string; query; required): the recipient address of the transaction. * `created_lt` (string; query; required): the logical time when the transaction was created. ### Returns Specific transaction on the TON blockchain based on the source address, destination address, and the logical time of its creation. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/tryLocateResultTx?source=UQAX2d4C2d48JeA-0y2_peGabRVumnKY22xPvkuEayC3zTI1&destination=UQBP4mzpDIywL1SV-Wp9ZuBBlzprR9eXQgSYGEXiUEHm73vA&created_lt=47597573000002 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "tryLocateResultTx", "params": { "source": "UQAX2d4C2d48JeA-0y2_peGabRVumnKY22xPvkuEayC3zTI1", "destination": "UQBP4mzpDIywL1SV-Wp9ZuBBlzprR9eXQgSYGEXiUEHm73vA", "created_lt": "47597573000002" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "raw.transaction", "utime": 1720370807, "data": "te6cckECCAEAAcYAA7N0/ibOkMjLAvVJX5an1m4EGXOmtH15dCBJgYReJQQebvAAArSixuS0NxLUvVgs8QeGGFM2MZwhibMZb5gyItVOLXOT/S0xskoAAAK0graeWDZorGdwABRUR+gBAgMBAaAEAIJyQ6mmQyZ39HLmBav8jckU7IrGamu4wzwWzKlJuYOGa/n6kZCfzjVebR8px97WNeOqId7XzjMSA2dM8e5vAZIEWgIVDIF/yMPQkBhTiBEGBwGvSAAvs7wFs7x4S8B9plt/S8M02irdNOUxttiffJcI1kFvmwAT+Js6QyMsC9UlflqfWbgQZc6a0fXl0IEmBhF4lBB5u8w9CQAGDGcIAABWlFjcloTNFYzuwAUAagAAAABidWdhdHRpYm95dmljZSAyNjUsMDAwIPCfko4gYXZhaWxhYmxlIG9uIGZyYWdtZW50AJonyCcQAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbwAAAAAAAAAAAAAAAAS1FLaRJ5QuM990nhh8UYSKv4bVGu4tw/IIW8MYUE5+OBHSfO+8=", "transaction_id": { "@type": "internal.transactionId", "lt": "47597573000003", "hash": "mlVb0ixiGkELIAog5jwcqDOEcJa3R1CQk/20yaYAQ10=" }, "fee": "41535", "storage_fee": "1535", "other_fee": "40000", "in_msg": { "@type": "raw.message", "source": "EQAX2d4C2d48JeA-0y2_peGabRVumnKY22xPvkuEayC3zW_w", "destination": "EQBP4mzpDIywL1SV-Wp9ZuBBlzprR9eXQgSYGEXiUEHm7yYF", "value": "1000000", "fwd_fee": "406404", "ihr_fee": "0", "created_lt": "47597573000002", "body_hash": "0+UqzPwXQY+jCm7ohKTneJ+Yi3q08vctwy000JALqts=", "msg_data": { "@type": "msg.dataText", "text": "YnVnYXR0aWJveXZpY2UgMjY1LDAwMCDwn5KOIGF2YWlsYWJsZSBvbiBmcmFnbWVudA==" }, "message": "bugattiboyvice 265,000 💎 available on fragment" }, "out_msgs": [] } } ``` --- ## `tryLocateSourceTx` > Locates incoming transaction. Locates incoming transaction of source address by outgoing message. ### Parameters
* `source` (string; query; required): the source address of the transaction. * `destination` (string; query; required): the recipient address of the transaction. * `created_lt` (string; query; required): the logical time when the transaction was created. ### Returns The source transaction in the TON blockchain based on the source address, destination address, and the logical time of a result transaction. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/tryLocateSourceTx?source=UQAX2d4C2d48JeA-0y2_peGabRVumnKY22xPvkuEayC3zTI1&destination=UQBP4mzpDIywL1SV-Wp9ZuBBlzprR9eXQgSYGEXiUEHm73vA&created_lt=47597573000002 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "tryLocateSourceTx", "params": { "source": "UQAX2d4C2d48JeA-0y2_peGabRVumnKY22xPvkuEayC3zTI1", "destination": "UQBP4mzpDIywL1SV-Wp9ZuBBlzprR9eXQgSYGEXiUEHm73vA", "created_lt": "47597573000002" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "raw.transaction", "utime": 1720370807, "data": "te6cckECCwEAArMAA7VxfZ3gLZ3jwl4D7TLb+l4ZptFW6acpjbbE++S4RrILfNAAArSixuS0ELoQyiDrvrN3Z0DPMD02uBod3iPli5PYjRN2/Ub+3FzAAAK0or5PcBZorGdwADRkYqjIAQIDAgHgBAUAgnKKPjpYcmgZLfsPoW9xmCLuTvF605qU692DTlFlYt85leU7kkdddoIfJzvx8qfF8HlSpJoGlSpo4eN5F697Wt9PAg8MQoYYoYYEQAkKAeGIAC+zvAWzvHhLwH2mW39LwzTaKt005TG22J98lwjWQW+aBp2t/wOepbcynWvjnMnSZ74h87QzObNk6oolE6HVQhB28rHHhfhPHOxPhrn435Q7Y0DIBKfINv5sP+zJYHem6CFNTRi7NFY88AAA0IAAHAYBAd8HANBCACfxNnSGRlgXqkr8tT6zcCDLnTWj68uhAkwMIvEoIPN3mHoSAAAAAAAAAAAAAAAAAAAAAAAAYnVnYXR0aWJveXZpY2UgMjY1LDAwMCDwn5KOIGF2YWlsYWJsZSBvbiBmcmFnbWVudAGvSAAvs7wFs7x4S8B9plt/S8M02irdNOUxttiffJcI1kFvmwAT+Js6QyMsC9UlflqfWbgQZc6a0fXl0IEmBhF4lBB5u8w9CQAGDGcIAABWlFjcloTNFYzuwAgAagAAAABidWdhdHRpYm95dmljZSAyNjUsMDAwIPCfko4gYXZhaWxhYmxlIG9uIGZyYWdtZW50AJ1BnYMTiAAAAAAAAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAG/JhKagTAxm8AAAAAAAAgAAAAAAA9aib6Td8cdWhCpStTRgutI+DjjUUflMzLbRvaXnP5FgQJAjDIpjigg=", "transaction_id": { "@type": "internal.transactionId", "lt": "47597573000001", "hash": "9BFX+3WF/g7lt+fmHWmyFraflfOoAG3s7z32tOx3HbQ=" }, "fee": "2705610", "storage_fee": "10", "other_fee": "2705600", "in_msg": { "@type": "raw.message", "source": "", "destination": "EQAX2d4C2d48JeA-0y2_peGabRVumnKY22xPvkuEayC3zW_w", "value": "0", "fwd_fee": "0", "ihr_fee": "0", "created_lt": "0", "body_hash": "ZSRHhXgmUkSeNbEYIOHUYXcW8kCvcG99IPJk4PWP6Lc=", "msg_data": { "@type": "msg.dataRaw", "body": "te6cckEBAgEAuwABnNO1v+Bz1LbmU618c5k6TPfEPnaGZzZsnVFEonQ6qEIO3lY48L8J452J8Nc/G/KHbGgZAJT5Bt/Nh/2ZLA703QQpqaMXZorHngAAGhAAAwEA0EIAJ/E2dIZGWBeqSvy1PrNwIMudNaPry6ECTAwi8Sgg83eYehIAAAAAAAAAAAAAAAAAAAAAAABidWdhdHRpYm95dmljZSAyNjUsMDAwIPCfko4gYXZhaWxhYmxlIG9uIGZyYWdtZW506B10iw==", "init_state": "" }, "message": "07W/4HPUtuZTrXxzmTpM98Q+doZnNmydUUSidDqoQg7eVjjwvwnjnYnw1z8b8odsaBkAlPkG382H\n/ZksDvTdBCmpoxdmiseeAAAaEAAD\n" }, "out_msgs": [ { "@type": "raw.message", "source": "EQAX2d4C2d48JeA-0y2_peGabRVumnKY22xPvkuEayC3zW_w", "destination": "EQBP4mzpDIywL1SV-Wp9ZuBBlzprR9eXQgSYGEXiUEHm7yYF", "value": "1000000", "fwd_fee": "406404", "ihr_fee": "0", "created_lt": "47597573000002", "body_hash": "0+UqzPwXQY+jCm7ohKTneJ+Yi3q08vctwy000JALqts=", "msg_data": { "@type": "msg.dataText", "text": "YnVnYXR0aWJveXZpY2UgMjY1LDAwMCDwn5KOIGF2YWlsYWJsZSBvbiBmcmFnbWVudA==" }, "message": "bugattiboyvice 265,000 💎 available on fragment" } ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/ton/methods/ title: TON — Methods (1/3) source: docs/rpc-service/chains/chains-api/ton/methods.mdx --- # TON — Methods (1/3) > API reference for [TON](/rpc-service/chains/chains-api/ton/). [All methods ->](/rpc-service/chains/chains-api/ton/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/ton/methods-p2/) · [3](/rpc-service/chains/chains-api/ton/methods-p3/) ## `getAddressInformation` > Retrieves basic information about the address: balance, code, data, last_transaction_id. ### Parameters
* `address` (string; query; required): an identifier of a target TON account. ### Returns Information about the address specified. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getAddressInformation?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getAddressInformation", "params": { "address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W" }, "id": "1" }' ``` ### Response example ```json { "id": "1", "jsonrpc": "2.0", "result": { "@type": "raw.fullAccountState", "balance": "6088697", "code": "te6cckEBAQEAIwAIQgKPRS16Tf10BmtoI2UXclntBXNENb52tf1L1divK3w9aCBrv3Y=", "data": "te6cckEBAQEARgAAhwCAAAcRAW+YmneBHIAnWwEhXRhwGKbrpWwuvovatLofekvwAsROplLUCShZxn2kTkyjrdZWWw4ol9ZAosUb+zcNiHf6+xcGRA==", "last_transaction_id": { "@type": "internal.transactionId", "lt": "50630341000001", "hash": "/PZphaovGJ1xCTklvEPzGszPvBaotdzWcon79et+Nvw=" }, "block_id": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 41748127, "root_hash": "LUtR/YNt5qJdLeo2AJAPcoTRbhTx1K2c+sMPkRMT8mA=", "file_hash": "iOOCR19ILPA9vbpJ8KbhsY76Ns03GitAcF2sMWIkRG4=" }, "frozen_hash": "", "sync_utime": 1730904471, "@extra": "1730904488.9606094:0:0.8056820862639625", "state": "active" } } ``` --- ## `getExtendedAddressInformation` > Retrieves extended address info. Similar to previous one but tries to parse additional information for known contract types. This method is based on tonlib's function `getAccountState`. For detecting wallets we recommend to use `getWalletInformation`. ### Parameters
* `address` (string; query; required): an identifier of a target TON account. ### Returns Information about the address specified. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getExtendedAddressInformation?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getExtendedAddressInformation", "params": { "address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "fullAccountState", "address": { "@type": "accountAddress", "account_address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W" }, "balance": "6088697", "last_transaction_id": { "@type": "internal.transactionId", "lt": "50630341000001", "hash": "/PZphaovGJ1xCTklvEPzGszPvBaotdzWcon79et+Nvw=" }, "block_id": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 41748257, "root_hash": "BtEIAxrUco9i3qeK0lb3FNnuupSQdwu/b35cn7eNqTg=", "file_hash": "Ojn6XMPRb8BZ6gJ/ibpWF6V+e+wUh0jh+8UwV+UkIBc=" }, "sync_utime": 1730904823, "account_state": { "@type": "raw.accountState", "code": "te6cckEBAQEAIwAIQgKPRS16Tf10BmtoI2UXclntBXNENb52tf1L1divK3w9aCBrv3Y=", "data": "te6cckEBAQEARgAAhwCAAAcRAW+YmneBHIAnWwEhXRhwGKbrpWwuvovatLofekvwAsROplLUCShZxn2kTkyjrdZWWw4ol9ZAosUb+zcNiHf6+xcGRA==", "frozen_hash": "" }, "revision": 0, "@extra": "1730904845.8151195:0:0.1685316976114063" } } ``` --- ## `getWalletInformation` > Retrieves wallet info. This method parses contract state and currently supports more wallet types than `getExtendedAddressInformation`: simple wallet, standart wallet, v3 wallet, v4 wallet. ### Parameters
* `address` (string; query; required): an identifier of a target TON account. ### Returns Information about the address specified. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getWalletInformation?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getWalletInformation", "params": { "address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "wallet": false, "balance": "6088697", "account_state": "active", "wallet_type": null, "seqno": null, "last_transaction_id": { "@type": "internal.transactionId", "lt": "50630341000001", "hash": "/PZphaovGJ1xCTklvEPzGszPvBaotdzWcon79et+Nvw=" } } } ``` --- ## `getTransactions` > Retrieves transactions. Retrieves transaction history of a given address. ### Parameters
* `address` (string; query; required): an identifier of a target TON account. * `limit` (integer; query; default=10, max=100): maximum number of transactions in response. * `lt` (integer; query): logical time of transaction to start with, must be sent with `hash`. * `hash` (string; query): the hash of transaction to start with, in base64 or hex encoding , must be sent with `lt`. * `to_lt` (integer; query): logical time of transaction to finish with (to get tx from `lt` to `to_lt`). * `archival` (boolean; query; default=false): by default `getTransaction` request is processed by any available liteserver. If `archival=true` only liteservers with full history are used. ### Returns The transaction history for a specific address. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getTransactions?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getTransactions", "params": { "address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": [ { "@type": "raw.transaction", "utime": 1730897178, "data": "te6cckECDwEAAywAA7V/l26clqHVRGrod9+7tISkJI53k+e7PGKqChEe+RI36rAAAuDEt9e0EUhqqRoLlokU16oee06iuNKCfrXMhyS9QXJLNJK+RvjwAALf81h8KBZytlGgADRhjwMIAQIDAgHgBAUAgnKmm1F2uF+qjoLb+DOkjIiO+1S2/rUFfz/9X0ecgCrNJJxt7rYpNtcbz4bUhkV3+hJYM6a4v6txgynCn27hbW/LAhkEhZUJANqpBRhgw1ARDQ4BsWgAAHEQFvmJp3gRyAJ1sBIV0YcBim66VsLr6L2rS6H3pL8APl26clqHVRGrod9+7tISkJI53k+e7PGKqChEe+RI36rQDaqQUAYQFLQAAFwYloDkhM5Wyh7ABgEB3wcBqA+KfqVUbeTv2XoE7jY5HJgB8zYowBXIml4lYvHRjdV68RJV0Fi8i20THzvW/WQH84kAAA4iAt8xNO8COQBOtgJCujDgMU3XSthdfRe1aXQ+9JfCAwwCsWgB8u3TktQ6qI1dDvv3dpCUhJHO8nz3Z4xVQUIj3yJG/VcAIzum7Z4PaYlBTeFvKo6mdRJVSxaBZjYWdNcZV1Ty5TgQDUbO0AYZHTgAAFwYlvr2hM5WyjXgCAkCATQKCwGnF41FGVRt5O/ZegTuNjkcmAAAcRAW+YmneBHIAnWwEhXRhwGKbrpWwuvovatLofekvwAADiIC3zE07wI5AE62AkK6MOAxTddK2F19F7VpdD70l8QHDAhCAo9FLXpN/XQGa2gjZRdyWe0Fc0Q1vna1/UvV2K8rfD1oAIcAgB8zYowBXIml4lYvHRjdV68RJV0Fi8i20THzvW/WQH84kALETqZS1AkoWcZ9pE5Mo63WVlsOKJfWQKLFG/s3DYh3+gAaAAAAADEwOTUxNTg2OACeQH0MCL8UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABvyYlq8EwZHRAAAAAAAAIAAAAAAALC24AfOr7B+9wHRF8yKXY1QVDD2tgXWyS0aakzhF8WbEGQR6TI4r5Y", "transaction_id": { "@type": "internal.transactionId", "lt": "50630341000001", "hash": "/PZphaovGJ1xCTklvEPzGszPvBaotdzWcon79et+Nvw=" }, "fee": "1640116", "storage_fee": "5716", "other_fee": "1634400", "in_msg": { "@type": "raw.message", "source": "EQAAOIgLfMTTvAjkATrYCQrow4DFN10rYXX0XtWl0PvSX5uk", "destination": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W", "value": "57320468", "fwd_fee": "526938", "ihr_fee": "0", "created_lt": "50630337000002", "body_hash": "vt02QoQHP7hw48TBJm8i1YII+Zx8kL/QfNVj79Kmt7w=", "msg_data": { "@type": "msg.dataRaw", "body": "te6cckEBAgEAZgABqA+KfqVUbeTv2XoE7jY5HJgB8zYowBXIml4lYvHRjdV68RJV0Fi8i20THzvW/WQH84kAAA4iAt8xNO8COQBOtgJCujDgMU3XSthdfRe1aXQ+9JfCAwEAGgAAAAAxMDk1MTU4NjicCb0U", "init_state": "" }, "message": "D4p+pVRt5O/ZegTuNjkcmAHzNijAFciaXiVi8dGN1XrxElXQWLyLbRMfO9b9ZAfziQAADiIC3zE0\n7wI5AE62AkK6MOAxTddK2F19F7VpdD70l8ID\n" }, "out_msgs": [ { "@type": "raw.message", "source": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W", "destination": "EQCM7pu2eD2mJQU3hbyqOpnUSVUsWgWY2FnTXGVdU8uU4Ddb", "value": "55686068", "fwd_fee": "822940", "ihr_fee": "0", "created_lt": "50630341000002", "body_hash": "Ycyf2S915TpjkcLaOH70Kse87Z1rZrF65nPLm/70Rms=", "msg_data": { "@type": "msg.dataRaw", "body": "te6cckEBAgEAZgABpxeNRRlUbeTv2XoE7jY5HJgAAHEQFvmJp3gRyAJ1sBIV0YcBim66VsLr6L2rS6H3pL8AAA4iAt8xNO8COQBOtgJCujDgMU3XSthdfRe1aXQ+9JfEBwEAGgAAAAAxMDk1MTU4NjhoTgE0", "init_state": "te6cckEBAwEAbgACATQBAghCAo9FLXpN/XQGa2gjZRdyWe0Fc0Q1vna1/UvV2K8rfD1oAIcAgB8zYowBXIml4lYvHRjdV68RJV0Fi8i20THzvW/WQH84kALETqZS1AkoWcZ9pE5Mo63WVlsOKJfWQKLFG/s3DYh3+vXib6g=" }, "message": "F41FGVRt5O/ZegTuNjkcmAAAcRAW+YmneBHIAnWwEhXRhwGKbrpWwuvovatLofekvwAADiIC3zE0\n7wI5AE62AkK6MOAxTddK2F19F7VpdD70l8QG\n" } ] } ] } ``` --- ## `getAddressBalance` > Retrieves address balance. Retrieves balance (in nanotons) of a given address. ### Parameters
* `address` (string; query; required): an identifier of a target TON account. ### Returns The balance of a specific address on the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getAddressBalance?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getAddressBalance", "params": { "address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": "6088697" } ``` --- ## `getAddressState` > Retrieves address state. Retrieves state of a given address. State can be either `unitialized`, `active`, or `frozen`. ### Parameters
* `address` (string; query; required): an identifier of a target TON account. ### Returns Checks whether an address is active, uninitialized, or frozen. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getAddressState?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getAddressState", "params": { "address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": "active" } ``` --- ## `packAddress` > Packs address. Convert an address from raw to human-readable format. ### Parameters
* `address` (string; query; required): an identifier of a target TON account in raw format. Example: `0:83DFD552E63729B472FCBCC8C45EBCC6691702558B68EC7527E1BA403A0F31A8`. ### Returns Converts TON addresses to a more readable and standardized output. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/packAddress?address=0%3A83DFD552E63729B472FCBCC8C45EBCC6691702558B68EC7527E1BA403A0F31A8 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "packAddress", "params": { "address": "0:83dfd552e63729b472fcbcc8c45ebcc6691702558b68ec7527e1ba403a0f31a8" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": "EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N" } ``` --- ## `unpackAddress` > Unpacks address. Converts an address from human-readable to raw format. ### Parameters
* `address` (string; query; required): an identifier of a target TON account in user-friendly form. Example: `EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N`. ### Returns Converts human-readable addresses into raw format. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/unpackAddress?address=EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "unpackAddress", "params": { "address": "EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": "0:83dfd552e63729b472fcbcc8c45ebcc6691702558b68ec7527e1ba403a0f31a8" } ``` --- ## `getTokenData` > Retrieves token data. Retrieves NFT or Jetton information. ### Parameters
* `address` (string; query; required): the address of NFT collection/item or Jetton master/wallet smart contract. ### Returns Data about a specific token on the TON blockchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getTokenData?address=EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getTokenData", "params": { "address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "total_supply": 1229976002510000, "mintable": true, "admin_address": "EQBkQP48aUEDg5Y5RRc8SxFHm_C5tNcJDlh3e9pYHC-ZmG2M", "jetton_content": { "type": "onchain", "data": { "uri": "https://tether.to/usdt-ton.json", "decimals": "6" } }, "jetton_wallet_code": "te6cckEBAQEAIwAIQgKPRS16Tf10BmtoI2UXclntBXNENb52tf1L1divK3w9aCBrv3Y=", "contract_type": "jetton_master" } } ``` --- ## `detectAddress` > Detects address. Retrieves all possible address forms. ### Parameters
* `address` (string; query; required): an identifier of a target TON account. ### Returns Detects the type and format of a TON address. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/detectAddress?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "detectAddress", "params": { "address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "raw_form": "0:f976e9c96a1d5446ae877dfbbb484a4248e7793e7bb3c62aa0a111ef91237eab", "bounceable": { "b64": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN+q19W", "b64url": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W" }, "non_bounceable": { "b64": "UQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN+qwKT", "b64url": "UQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-qwKT" }, "given_type": "friendly_bounceable", "test_only": false } } ``` --- ## `getMasterchainInfo` > Retrieves masterchain info. Retrieves up-to-date masterchain state. ### Parameters None. ### Returns Information about the current state of the TON masterchain. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getMasterchainInfo ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getMasterchainInfo", "params": {}, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "blocks.masterchainInfo", "last": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 41808232, "root_hash": "OARlTgr+YA5SqBL3SOxIFiTve/E397qeDIshLmZzwNA=", "file_hash": "ragbYfalWXeldsyZZ2BSBJwqtOLsw6ifLrpyWhnVduo=" }, "state_root_hash": "p/eRavA1zOrMtonVIuhvQ22JhsbgtzUu6bUDUGoPVvg=", "init": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "0", "seqno": 0, "root_hash": "F6OpKZKqvqeFp6CQmFomXNMfMj2EnaUSOXN+Mh+wVWk=", "file_hash": "XplPz01CXAps5qeSWUtxcyBfdAo5zVb1N979KLSKD24=" }, "@extra": "1731069303.2264078:0:0.6208585424366947" } } ``` --- ## `getMasterchainBlockSignatures` > Retrieves masterchian block signatures. Retrieves the signatures of a specific masterchain block on the TON blockchain. ### Parameters
* `seqno` (integer; query; required): the sequence number of the masterchain block for which to retrieve signatures. ### Returns Detects the type and format of a TON address. ### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getMasterchainBlockSignatures?seqno=39064865 ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getMasterchainBlockSignatures", "params": { "seqno": "39064865" }, "id": "1" }' ``` ### Response example ```json { "ok": true, "result": { "@type": "blocks.blockSignatures", "id": { "@type": "ton.blockIdExt", "workchain": -1, "shard": "-9223372036854775808", "seqno": 39064865, "root_hash": "AovDThkPXWEPiYOBVzYpQW9Mf/B1DXRVK2jNCEaMuUk=", "file_hash": "vTGEDDjoVzWCR+Yz/DUAUSMNfIjl7LL/I0ynpAYz4rk=" }, "signatures": [ { "@type": "blocks.signature", "node_id_short": "/DM6Q8OqwsiL/lo0h6yryoGLXLBxW9dXXGLfduMkwSQ=", "signature": "dQStdfk5/FrUiTvJ6uuSaHT8xq5IvIn5Oj9evkP5BExrhMhZ4yAF/S49eP9AmVBCu6k4DHZwlYkoErGrYMsLBw==" }, { "@type": "blocks.signature", "node_id_short": "mwccnaYVl/CYI/QcZEas6hv01zM4BDR9FegiGvuRYYY=", "signature": "Oo18FpSQB82eyeVJjUAnYPcHtvmI/uO17nWb6rnrp9yvAjJhHMrb386gqcH2eEwIVcveUR9smPOZzNMeEmXyCQ==" } ], "@extra": "1731069520.765146:0:0.3486811129074091" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/ title: TRON description: TRON is an open source public blockchain platform that supports smart contracts. 26 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/tron/index.mdx --- # TRON
> TRON API is available on [Web3 API platform](https://www.ankr.com/rpc/tron). *TRON* is an open source public blockchain platform that supports smart contracts. TRON is compatible with Ethereum, which means that you can migrate smart contracts on Ethereum to TRON directly or with minor modifications. TRON relies on a unique consensus mechanism to realize the high TPS of the TRON network that is far beyond Ethereum, bringing developers a good experience of a faster transaction. In order for your Web3 application to interact with TRON — either by reading blockchain data or sending transactions to the network — it must connect to a TRON node. Developers interact with the blockchain using the methods provided by the API. We provide two interfaces to query TRON API: * TRON [JSON-RPC](/rpc-service/chains/chains-api/tron/#json-rpc-methods) * TRON [REST](/rpc-service/chains/chains-api/tron/#rest-methods) Responses for both of them come in [JSON format](https://www.json.org/json-en.html). --- ## JSON-RPC methods JSON-RPC is a stateless, lightweight remote procedure call (RPC) protocol. The JSON-RPC interface supported by the TRON network is compatible with Ethereum's. However, due to the difference in chain mechanism and design, TRON cannot support some interfaces on Ethereum. At the same time, TRON also provides dedicated APIs to create different types of transactions. * [`web3_clientVersion`](/rpc-service/chains/chains-api/tron/methods/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/tron/methods/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/tron/methods/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/tron/methods/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/tron/methods/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/tron/methods/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/tron/methods/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/tron/methods/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/tron/methods/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/tron/methods/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/tron/methods/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/tron/methods/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/tron/methods/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/tron/methods/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/tron/methods/#eth_getcode) — returns code at an address specified. * [`eth_call`](/rpc-service/chains/chains-api/tron/methods/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/tron/methods/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/tron/methods/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tron/methods-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/tron/methods-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## REST methods **SolidityNode API**: * [`/walletsolidity/getaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetaccount) — retrieves account information. * [`/walletsolidity/listwitnesses`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditylistwitnesses) — retrieves the list of witnesses. * [`/walletsolidity/getassetissuelist`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetassetissuelist) — retrieves the list of all the tokens. * [`/walletsolidity/getpaginatedassetissuelist`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetpaginatedassetissuelist) — retrieves the list of all the tokens by pagination. * [`/walletsolidity/getassetissuebyname`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetassetissuebyname) — retrieves a token by token name. * [`/walletsolidity/getassetissuelistbyname`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetassetissuelistbyname) — retrieves the list of tokens by name. * [`/walletsolidity/getassetissuebyid`](/rpc-service/chains/chains-api/tron/#walletsolidity/getassetissuebyid) — retrieves a token by token ID. * [`/walletsolidity/getnowblock`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetnowblock) — retrieves the latest block information. * [`/walletsolidity/getblockbynum`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetblockbynum) — retrieves a block information by block height. * [`/walletsolidity/gettransactionbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygettransactionbyid) — retrieves a transaction information by transaction ID. * [`/walletsolidity/gettransactioncountbyblocknum`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygettransactioncountbyblocknum) — retrieves the number of transactions in a specific block. * [`/walletsolidity/gettransactioninfobyblocknum`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygettransactioninfobyblocknum) — retrieves the list of transaction information in a specific block. * [`/walletsolidity/gettransactioninfobyid`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygettransactioninfobyid) — retrieves the transaction fee and block height by transaction ID. * [`/walletsolidity/getdelegatedresource`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetdelegatedresource) — retrieves the energy delegation information. * [`/walletsolidity/getdelegatedresourceaccountindex`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetdelegatedresourceaccountindex) — retrieves the energy delegation index by an account. * [`/walletsolidity/getexchangebyid`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetexchangebyid) — retrieves an exchange pair by exchange pair ID. * [`/walletsolidity/listexchanges`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditylistexchanges) — retrieves the list of all the exchange pairs. * [`/walletsolidity/getaccountbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletsoliditygetaccountbyid) — retrieves an account information by account ID. * [`/walletsolidity/getblockbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletsoliditygetblockbyid) — retrieves a block information by block ID. * [`/walletsolidity/getblockbylimitnext`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletsoliditygetblockbylimitnext) — retrieves a list of blocks by range. * [`/walletsolidity/getblockbylatestnum`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletsoliditygetblockbylatestnum) — retrieves several latest blocks. **FullNode API**: * [`wallet/createtransaction`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletcreatetransaction) — creates a transfer transaction; if `to_address` doesn't exist, creates an account on the blockchain. * [`wallet/broadcasttransaction`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletbroadcasttransaction) — broadcasts a transaction after signing. * [`wallet/broadcasthex`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletbroadcasthex) — broadcasts a transaction hex string after signing. * [`wallet/updateaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletupdateaccount) — updates the name of an account. * [`wallet/votewitnessaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletvotewitnessaccount) — votes for witnesses. * [`wallet/getBrokerage`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetbrokerage) — retrieves the ratio of brokerage of the witness. * [`wallet/getReward`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetreward) — retrieves unclaimed reward. * [`wallet/updateBrokerage`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletupdatebrokerage) — updates the ratio of brokerage. * [`wallet/getaccountbalance`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetaccountbalance) — retrieves the account balance in a specific block. * [`wallet/createassetissue`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletcreateassetissue) — issues a token. * [`wallet/updatewitness`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletupdatewitness) — updates the witness's website URL. * [`wallet/createaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletcreateaccount) — creates an account. * [`wallet/createwitness`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletcreatewitness) — applies to become a witness. * [`wallet/transferasset`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#wallettransferasset) — transfers a token. * [`wallet/participateassetissue`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletparticipateassetissue) — participates a token. * [`wallet/freezebalance`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletfreezebalance) — stakes TRX. * [`wallet/unfreezebalance`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletunfreezebalance) — unstakes the staked TRX that is due. * [`wallet/unfreezeasset`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletunfreezeasset) — unstakes the staked token that is due. * [`wallet/withdrawbalance`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletwithdrawbalance) — withdraws a reward to an account balance for witnesses. * [`wallet/updateasset`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletupdateasset) — updates token information. * [`wallet/getassetissuebyaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetassetissuebyaccount) — retrieves the token issue information of an account. * [`wallet/getaccountnet`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetaccountnet) — retrieves the bandwidth information of an account. * [`wallet/getassetissuebyname`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetassetissuebyname) — retrieves a token by token name. * [`wallet/getassetissuelistbyname`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetassetissuelistbyname) — retrieves the list of tokens by name. * [`wallet/getassetissuebyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetassetissuebyid) — retrieves a token by token ID. * [`wallet/getnowblock`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetnowblock) — retrieves the latest block information. * [`wallet/getblockbynum`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetblockbynum) — retrieves a block information by block height. * [`wallet/getblockbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetblockbyid) — retrieves a block information by block ID. * [`wallet/getblockbylimitnext`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetblockbylimitnext) — retrieves a list of blocks by range. * [`wallet/getblockbylatestnum`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgetblockbylatestnum) — retrieves several latest blocks. * [`wallet/getblockbalance`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgetblockbalance) — retrieves all balance change operations in a block. * [`wallet/gettransactionbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgettransactionbyid) — retrieves transaction information by transaction ID. * [`wallet/gettransactioninfobyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgettransactioninfobyid) — retrieves the transaction fee and block height by transaction ID. * [`wallet/gettransactioncountbyblocknum`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgettransactioncountbyblocknum) — retrieves the number of transactions in a specific block. * [`wallet/gettransactioninfobyblocknum`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgettransactioninfobyblocknum) — retrieves the list of transaction information in a specific block. * [`wallet/getaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetaccount) — retrieves account information. * [`wallet/listwitnesses`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletlistwitnesses) — retrieves the list of witnesses. * [`wallet/getassetissuelist`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetassetissuelist) — retrieves the list of all tokens. * [`wallet/getpaginatedassetissuelist`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetpaginatedassetissuelist) — retrieves the list of all tokens by pagination. * [`wallet/getpaginatedproposallist`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetpaginatedproposallist) — retrieves the list of all proposals by pagination. * [`wallet/getpaginatedexchangelist`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetpaginatedexchangelist) — retrieves the list of all exchange pairs by pagination. * [`wallet/getnextmaintenancetime`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetnextmaintenancetime) — retrieves the time interval till the next vote round. * [`wallet/validateaddress`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletvalidateaddress) — checks the validity of the address. * [`wallet/deploycontract`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletdeploycontract) — deploys a smart contract. * [`wallet/triggersmartcontract`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#wallettriggersmartcontract) — triggers a smart contract. * [`wallet/getcontract`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetcontract) — retrieves a contract. * [`wallet/proposalcreate`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletproposalcreate) — creates a proposal. * [`wallet/getproposalbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetproposalbyid) — retrieves a proposal by proposal ID. * [`wallet/listproposals`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletlistproposals) — retrieves all proposals. * [`wallet/proposalapprove`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletproposalapprove) — approves a proposal. * [`wallet/proposaldelete`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletproposaldelete) — deletes a proposal. * [`wallet/getaccountresource`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetaccountresource) — retrieves the resource information of an account. * [`wallet/exchangecreate`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletexchangecreate) — creates an exchange pair. * [`wallet/exchangeinject`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletexchangeinject) — injects funds for an exchange pair. * [`wallet/exchangewithdraw`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletexchangewithdraw) — withdraws from an exchange pair. * [`wallet/exchangetransaction`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletexchangetransaction) — participates the transaction of exchange pair. * [`wallet/getexchangebyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetexchangebyid) — retrieves an exchange pair by exchange pair ID. * [`wallet/listexchanges`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletlistexchanges) — retrieves the list of all exchange pairs. * [`wallet/getchainparameters`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetchainparameters) — retrieves the parameters of the blockchain used for witnesses to create a proposal. * [`wallet/updatesetting`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletupdatesetting) — updates the `consume_user_resource_percent` parameter of a smart contract. * [`wallet/updateenergylimit`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletupdateenergylimit) — updates the `origin_energy_limit` parameter of a smart contract. * [`wallet/getdelegatedresource`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetdelegatedresource) — retrieves the energy delegation information. * [`wallet/getdelegatedresourceaccountindex`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetdelegatedresourceaccountindex) — retrieves the energy delegation index by an account. * [`wallet/setaccountid`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletsetaccountid) — sets an account ID for an account. * [`wallet/getaccountbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetaccountbyid) — retrieves account information by account ID. * [`wallet/triggerconstantcontract`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#wallettriggerconstantcontract) — triggers the constant of the smart contract, the transaction is off the blockchain. * [`wallet/clearabi`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletclearabi) — clears the abi of a smart contract. * [`wallet/getsignweight`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetsignweight) — retrieves the current signatures total weight of a transaction after signing. * [`wallet/getapprovedlist`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/#walletgetapprovedlist) — retrieves the signatures list of a transaction after signing. * [`wallet/accountpermissionupdate`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/#walletaccountpermissionupdate) — sets a multi-signature for an account. * [`wallet/getzenpaymentaddress`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/#walletgetzenpaymentaddress) — retrieves payment address. * [`wallet/getrcm`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/#walletgetrcm) — retrieves a random commitment trapdoor. --- ## Methods ### Methods - [`web3_clientVersion`](/rpc-service/chains/chains-api/tron/methods/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/tron/methods/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/tron/methods/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/tron/methods/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/tron/methods/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/tron/methods/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/tron/methods/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/tron/methods/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/tron/methods/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/tron/methods/#eth_getstorageat) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/tron/methods/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/tron/methods/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/tron/methods/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/tron/methods/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/tron/methods/#eth_getcode) - [`eth_call`](/rpc-service/chains/chains-api/tron/methods/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/tron/methods/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/tron/methods/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/tron/methods-p2/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/tron/methods-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/tron/methods-p3/#eth_getlogs) ### SolidityNode API - [`/walletsolidity/getaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetaccount) - [`walletsolidity/listwitnesses`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditylistwitnesses) - [`/walletsolidity/getassetissuelist`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetassetissuelist) - [`/walletsolidity/getpaginatedassetissuelist`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetpaginatedassetissuelist) - [`/walletsolidity/getassetissuebyname`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetassetissuebyname) - [`/walletsolidity/getassetissuelistbyname`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetassetissuelistbyname) - [`/walletsolidity/getassetissuebyid`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetassetissuebyid) - [`/walletsolidity/getnowblock`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetnowblock) - [`/walletsolidity/getblockbynum`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetblockbynum) - [`/walletsolidity/gettransactionbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygettransactionbyid) - [`/walletsolidity/gettransactioncountbyblocknum`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygettransactioncountbyblocknum) - [`/walletsolidity/gettransactioninfobyblocknum`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygettransactioninfobyblocknum) - [`/walletsolidity/gettransactioninfobyid`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygettransactioninfobyid) - [`/walletsolidity/getdelegatedresource`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetdelegatedresource) - [`/walletsolidity/getdelegatedresourceaccountindex`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetdelegatedresourceaccountindex) - [`/walletsolidity/getexchangebyid`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditygetexchangebyid) - [`/walletsolidity/listexchanges`](/rpc-service/chains/chains-api/tron/soliditynode-api/#walletsoliditylistexchanges) - [`/walletsolidity/getaccountbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletsoliditygetaccountbyid) - [`/walletsolidity/getblockbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletsoliditygetblockbyid) - [`/walletsolidity/getblockbylimitnext`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletsoliditygetblockbylimitnext) - [`/walletsolidity/getblockbylatestnum`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletsoliditygetblockbylatestnum) - [`wallet/createtransaction`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletcreatetransaction) - [`wallet/broadcasttransaction`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletbroadcasttransaction) - [`wallet/broadcasthex`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletbroadcasthex) - [`wallet/updateaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/#walletupdateaccount) - [`wallet/votewitnessaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletvotewitnessaccount) - [`wallet/getBrokerage`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetbrokerage) - [`wallet/getReward`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetreward) - [`wallet/updateBrokerage`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletupdatebrokerage) - [`wallet/getaccountbalance`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetaccountbalance) - [`wallet/createassetissue`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletcreateassetissue) - [`wallet/updatewitness`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletupdatewitness) - [`wallet/createaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletcreateaccount) - [`wallet/createwitness`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletcreatewitness) - [`wallet/transferasset`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#wallettransferasset) - [`wallet/participateassetissue`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletparticipateassetissue) - [`wallet/freezebalance`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletfreezebalance) - [`wallet/unfreezebalance`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletunfreezebalance) - [`wallet/unfreezeasset`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletunfreezeasset) - [`wallet/withdrawbalance`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletwithdrawbalance) - [`wallet/updateasset`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletupdateasset) - [`wallet/getassetissuebyaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetassetissuebyaccount) - [`wallet/getaccountnet`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetaccountnet) - [`wallet/getassetissuebyname`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetassetissuebyname) - [`wallet/getassetissuelistbyname`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetassetissuelistbyname) - [`wallet/getassetissuebyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetassetissuebyid) - [`wallet/getnowblock`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetnowblock) - [`wallet/getblockbynum`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetblockbynum) - [`wallet/getblockbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetblockbyid) - [`wallet/getblockbylimitnext`](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/#walletgetblockbylimitnext) - [`wallet/getblockbylatestnum`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgetblockbylatestnum) - [`wallet/getblockbalance`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgetblockbalance) - [`wallet/gettransactionbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgettransactionbyid) - [`wallet/gettransactioninfobyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgettransactioninfobyid) - [`wallet/gettransactioncountbyblocknum`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgettransactioncountbyblocknum) - [`wallet/gettransactioninfobyblocknum`](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/#walletgettransactioninfobyblocknum) ### SolidityNode API - [`wallet/getaccount`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetaccount) - [`wallet/listwitnesses`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletlistwitnesses) - [`wallet/getassetissuelist`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetassetissuelist) - [`wallet/getpaginatedassetissuelist`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetpaginatedassetissuelist) - [`wallet/getpaginatedproposallist`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetpaginatedproposallist) - [`wallet/getpaginatedexchangelist`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetpaginatedexchangelist) - [`wallet/getnextmaintenancetime`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetnextmaintenancetime) - [`wallet/validateaddress`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletvalidateaddress) - [`wallet/deploycontract`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletdeploycontract) - [`wallet/triggersmartcontract`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#wallettriggersmartcontract) - [`wallet/getcontract`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetcontract) - [`wallet/proposalcreate`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletproposalcreate) - [`wallet/getproposalbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-2/#walletgetproposalbyid) - [`wallet/listproposals`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletlistproposals) - [`wallet/proposalapprove`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletproposalapprove) - [`wallet/proposaldelete`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletproposaldelete) - [`wallet/getaccountresource`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetaccountresource) - [`wallet/exchangecreate`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletexchangecreate) - [`wallet/exchangeinject`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletexchangeinject) - [`wallet/exchangewithdraw`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletexchangewithdraw) - [`wallet/exchangetransaction`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletexchangetransaction) - [`wallet/getexchangebyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetexchangebyid) - [`wallet/listexchanges`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletlistexchanges) - [`wallet/getchainparameters`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetchainparameters) - [`wallet/updatesetting`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletupdatesetting) - [`wallet/updateenergylimit`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletupdateenergylimit) - [`wallet/getdelegatedresource`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetdelegatedresource) - [`wallet/getdelegatedresourceaccountindex`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetdelegatedresourceaccountindex) - [`wallet/setaccountid`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletsetaccountid) - [`wallet/getaccountbyid`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetaccountbyid) - [`wallet/triggerconstantcontract`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#wallettriggerconstantcontract) - [`wallet/clearabi`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletclearabi) - [`wallet/getsignweight`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/#walletgetsignweight) - [`wallet/getapprovedlist`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/#walletgetapprovedlist) - [`wallet/accountpermissionupdate`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/#walletaccountpermissionupdate) - [`Response example`](/rpc-service/chains/chains-api/tron/methods/#response-example) - [`wallet/getzenpaymentaddress`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/#walletgetzenpaymentaddress) - [`wallet/getrcm`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/#walletgetrcm) - [`wallet/gettriggerinputforshieldedtrc20contract`](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p4/#walletgettriggerinputforshieldedtrc20contract) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/methods-p2/ title: TRON — Methods (2/3) source: docs/rpc-service/chains/chains-api/tron/methods-p2.mdx --- # TRON — Methods (2/3) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/tron/methods/) · 2 · [3](/rpc-service/chains/chains-api/tron/methods-p3/) ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x1b4", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x0", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x0", "gasUsed": "0x0", "hash": "0x00000000000001b471ba79b1cf4cfe70ff48558f7a2218f52541d54f3403d091", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x5095d4f4d26ebc672ca12fc0e3a48d6ce3b169d2", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x1b4", "parentHash": "0x00000000000001b36c300ca00603e1f4145045fc9667d4b5e1c8e89d91d6446c", "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", "size": "0xad", "stateRoot": "0x", "timestamp": "0x5b304fee", "totalDifficulty": "0x0", "transactions": [], "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["5f72a4ff71f906fb53958a68e8a56613ff56752649ca9ed0fa879890f5f06098"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x0000000002fb6540b72dbe6efa2568db23bdc1155c30253ecbeb180b344c7366", "blockNumber": "0x2fb6540", "from": "0x7507386fe92eed44c61281ac9513c9c64f8e65d2", "gas": "0x0", "gasPrice": "0x1a4", "hash": "0x5f72a4ff71f906fb53958a68e8a56613ff56752649ca9ed0fa879890f5f06098", "input": "0x", "nonce": "0x0000000000000000", "r": "0x352d87789df75779efd5abbd5dc2b36fdadd64c5b98848107d98a7d46c2cbffe", "s": "0x17d117d81dd5a7336ebd3fe5453fce71fa35a1f50b633eaf032ae8bb5d9d9662", "to": "0x08b0a04bdfbb7ee6258b19a4d8a57bd41a88f9f1", "transactionIndex": "0x6c", "type": "0x0", "v": "0x1b", "value": "0x1" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["00000000020ef11c87517739090601aa0a7be1de6faebf35ddb14e7ab7d1cc5b", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x00000000020ef11c87517739090601aa0a7be1de6faebf35ddb14e7ab7d1cc5b", "blockNumber": "0x20ef11c", "from": "0xb4f1b6e3a1461266b01c2c4ff9237191d5c3d5ce", "gas": "0x0", "gasPrice": "0x8c", "hash": "0x8dd26d1772231569f022adb42f7d7161dee88b97b4b35eeef6ce73fcd6613bc2", "input": "0x", "nonce": "0x0000000000000000", "r": "0x6212a53b962345fb8ab02215879a2de05f32e822c54e257498f0b70d33825cc5", "s": "0x6e04221f5311cf2b70d3aacfc444e43a5cf14d0bf31d9227218efaabd9b5a812", "to": "0x047d4a0a1b7a9d495d6503536e2a49bb5cc72cfe", "transactionIndex": "0x0", "type": "0x0", "v": "0x1b", "value": "0x203226" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x2FB6562", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x0000000002fb6562c886d5f844a697b99c73e25b79cb8d3de8771cca9c3700d4", "blockNumber": "0x2fb6562", "from": "0x9d959e29ca58da6583b460e54d329e3975ddc3b4", "gas": "0xacc4", "gasPrice": "0x1a4", "hash": "0x50f952272174ec81359e91a229b171e881e3a7db44400b53f81ccecf038b2564", "input": "0x23b872dd0000000000000000000000417db40dca0d40898c18ab574303c5ff139176b11d0000000000000000000000419339b7a574abc3f201ab56dd66b72964402080fe0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "r": "0x513d8b9990aa2f18cb744d2a1056b75be4fa16bd48108e2010ae904fcffa45d7", "s": "0xa622e4e997445f1cff980be4d205c44d2fd1781ab5e863453f8e8fc57d97ec77", "to": "0xa614f803b6fd780986a42c78ec9c7f77e6ded13c", "transactionIndex": "0x0", "type": "0x0", "v": "0x1b", "value": "0x0" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["c9af231ad59bcd7e8dcf827afd45020a02112704dce74ec5f72cb090aa07eef0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x00000000020ef11c87517739090601aa0a7be1de6faebf35ddb14e7ab7d1cc5b", "blockNumber": "0x20ef11c", "contractAddress": null, "cumulativeGasUsed": "0x646e2", "effectiveGasPrice": "0x8c", "from": "0x6eced5214d62c3bc9eaa742e2f86d5c516785e14", "gasUsed": "0x0", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x0697250b9d73b460a9d2bbfd8c4cacebb05dd1f1", "transactionHash": "0xc9af231ad59bcd7e8dcf827afd45020a02112704dce74ec5f72cb090aa07eef0", "transactionIndex": "0x6", "type": "0x0" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0000000002fb6562c886d5f844a697b99c73e25b79cb8d3de8771cca9c3700d4", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/methods-p3/ title: TRON — Methods (3/3) source: docs/rpc-service/chains/chains-api/tron/methods-p3.mdx --- # TRON — Methods (3/3) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/tron/methods/) · [2](/rpc-service/chains/chains-api/tron/methods-p2/) · 3 ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0x29c", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0xa614f803b6fd780986a42c78ec9c7f77e6ded13c"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xa614f803b6fd780986a42c78ec9c7f77e6ded13c", "blockHash": "0x0000000002fbb03922d9924ccf3d1d7453e608cf60b9e428b19f63852066c550", "blockNumber": "0x2fbb039", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "logIndex": "0x0", "removed": false, "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000588f0416ccd8e9a7effe911e932a4889aba151e3", "0x000000000000000000000000ddeb92d8428ecfe3a517e46e5e8023027a8d598f" ], "transactionHash": "0x14398ead0f9c6abb63821304d83f6219498be5efd0dd9ac1a4fb9bee141fd9f3", "transactionIndex": "0x3" }, { "address": "0xa614f803b6fd780986a42c78ec9c7f77e6ded13c", "blockHash": "0x0000000002fbb03922d9924ccf3d1d7453e608cf60b9e428b19f63852066c550", "blockNumber": "0x2fbb039", "data": "0x0000000000000000000000000000000000000000000000000000000000e4e1c0", "logIndex": "0x1", "removed": false, "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000058c1801b09daa665180dfb3e7ac73bf59253d425", "0x000000000000000000000000332189e035485990009731422172df8aac90d948" ], "transactionHash": "0xf7d84e8b3b6840beea7012789fcfededd77e38f3fc158ed7f38bb4caa5c97467", "transactionIndex": "0x8" } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/methods/ title: TRON — Methods (1/3) source: docs/rpc-service/chains/chains-api/tron/methods.mdx --- # TRON — Methods (1/3) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/tron/methods-p2/) · [3](/rpc-service/chains/chains-api/tron/methods-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "TRON/v4.7.1/Linux/Java1.8" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2b6653dc" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or FALSE, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": { "startingBlock": "0x2fb6331", "currentBlock": "0x2fb6344", "highestBlock": "0x2fb6344" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1a4" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2fb6363" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tag_: * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["41c2ad4ef36bf52f1a724783c822b3a8dd68ae7e00", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1717c" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or the following _block tag_: * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["41c2ad4ef36bf52f1a724783c822b3a8dd68ae7e00", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0000000002fb639b337bc09c3864b02ec550eedac1b6387707d0d8ed340e1c7a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x17a" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x2FB639B"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x17a" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0000000002fb639b337bc09c3864b02ec550eedac1b6387707d0d8ed340e1c7a"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["finalized"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): a contract address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xa614f803b6fd780986a42c78ec9c7f77e6ded13c", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): Not supported. The value is 0x0. * `gasPrice` (string; quantity; optional): Not supported. The value is 0x0. * `value` (string; quantity; optional): Not supported. The value is 0x0. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or the following _block tag_: * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{ "from": "0xF0CC5A2A84CD0F68ED1667070934542D673ACBD8", "to": "0x70082243784DCDF3042034E7B044D6D342A91360", "gas": "0x0", "gasPrice": "0x0", "value": "0x0", "data": "0x70a08231000000000000000000000041f0cc5a2a84cd0f68ed1667070934542d673acbd8" }, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. ``: the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): unused. * `gasPrice` (string; quantity; optional): unused. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. ### Returns * `` (quantity): the amount of energy used. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "eth_estimateGas", "params": [{ "from": "0x41F0CC5A2A84CD0F68ED1667070934542D673ACBD8", "to": "0x4170082243784DCDF3042034E7B044D6D342A91360", "gas": "0x01", "gasPrice": "0x8c", "value": "0x01", "data": "0x70a08231000000000000000000000041f0cc5a2a84cd0f68ed1667070934542d673acbd8" }] }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0000000002fb64e09010fed562392f3dca79d29c9bd823e18c1aed9083058a3f", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x0", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1dcf14400", "gasUsed": "0x3b090b", "hash": "0x0000000002fb64e09010fed562392f3dca79d29c9bd823e18c1aed9083058a3f", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x78c842ee63b253f8f0d2955bbc582c661a078c9d", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x2fb64e0", "parentHash": "0x0000000002fb64df62e0d38a5e5275c78b42653925f47986a4d1db77aa645e3e", "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", "size": "0x173d6", "stateRoot": "0x", "timestamp": "0x642d7b08", "totalDifficulty": "0x0", "transactions": [ "0x92327d478923335c581d1ca59fb70163548838f2b766d0199fbf64d4860344ad", "0xf113fda5cb23e30880c5968e221cef2f23f048470150dd8c04f38d3c227c7002", "0x2a8fc9a2e6e2391d330d9a7a41ae5ab494628951da36909fc98b91c9f1dacb8e", "0xb173d5070ba0aa5afefe40b67bbb63e8d6bc6ec57019afe426131c565b258ec3", "0xecd84aa22c5935bcaf2be7f98e06eadacdada8b262640162364b08ac7aa3e4fa", "0xf4c2239f422820a22da6b9e1d4d52493384fbd596457e428c072cd0693671d98", "0x22bab3772a77043e10e4cb9f993c9450fcd117ffdcb1bc82288504acb36e6e6b", "0xfa5d8defac3e3291ca56f8f44b7aa0db5170e3756ac1c1eade30fd31eaa4d5da", "0x2e5c7e1af56f4bd20592671ddf8e5dc0097daf6ca579d26d53c1f643d85618e2", "0xa1cfe2e6b9e08d6939bf6c01b1d6b1f2892f0e915df9343a86e8d728ae3630ae" ], "transactionsRoot": "0x448c3eb29eb9e065a8a22441c0973d70d67e614c498ea748a1af1bead9d22410", "uncles": [] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/ title: TRON — SolidityNode API (2/4) source: docs/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2.mdx --- # TRON — SolidityNode API (2/4) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 2 of 4: [1](/rpc-service/chains/chains-api/tron/soliditynode-api-2/) · 2 · [3](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/) · [4](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p4/) ### `wallet/listproposals` > Retrieves all proposals. #### Parameters None. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/listproposals' ``` #### Response example ```json { "proposals": [ { "proposal_id": 84, "proposer_address": "41456798cb4ab28109d8cc643cd7da7bd6069ceae9", "parameters": [ { "key": 70, "value": 14 }, { "key": 59, "value": 1 } ], "expiration_time": 1680847200000, "create_time": 1680581727000, "approvals": [ "41456798cb4ab28109d8cc643cd7da7bd6069ceae9", "418440ffd578f7a5abf3537b5f46a6980d382db581", "4167e39013be3cdd3814bed152d7439fb5b6791409", "414ce8225c8ea6c8e1e0a483132211610c765fc6df", "41c189fa6fc9ed7a3580c3fe291915d5c6a6259be7" ] } ] } ``` --- ### `wallet/proposalapprove` > Approves a proposal. #### Parameters * `owner_address` (string; hex; required): the address that makes the approval * `proposal_id` (integer; required): a proposal ID. * `is_add_approval` (boolean; required): whether to approve or not. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/proposalapprove' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "419844F7600E018FD0D710E2145351D607B3316CE9", "proposal_id": 1, "is_add_approval": true }' ``` --- ### `wallet/proposaldelete` > Deletes a proposal. #### Parameters * `owner_address` (string; hex; required): a proposal's owner address. * `proposal_id` (integer; required): a proposal ID. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/proposaldelete' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "419844F7600E018FD0D710E2145351D607B3316CE9", "proposal_id": 1 }' ``` --- ### `wallet/getaccountresource` > Retrieves the resource information of an account. #### Parameters * `address` (string; hex; required): an account address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getaccountresource' \ -H 'Content-Type: application/json' \ -d '{ "address": "419844f7600e018fd0d710e2145351d607b3316ce9" }' ``` --- ### `wallet/exchangecreate` > Creates an exchange pair. #### Parameters * `owner_address` (string; hex; required): an owner address. * `first_token_id` (string; hex; required): the first token's ID. * `first_token_balance` (integer; required): the first token's balance. * `second_token_id` (string; hex; required): the second token's ID. * `second_token_balance` (integer; required): the second token's balance. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/exchangecreate' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9", "first_token_id": "token_a", "first_token_balance": 100, "second_token_id": "token_b", "second_token_balance": 200 }' ``` --- ### `wallet/exchangeinject` > Injects funds for an exchange pair. #### Parameters * `owner_address` (string; hex; required): an owner address of the exchange pair. * `exchange_id` (integer; required): an exchange pair. * `token_id` (string; hex; required): a token ID. * `quant` (integer; required): a token inject amount. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/exchangeinject' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9", "exchange_id": 1, "token_id": "74726f6e6e616d65", "quant": 100 }' ``` --- ### `wallet/exchangewithdraw` > Withdraws from an exchange pair. #### Parameters * `owner_address` (string; hex; required): an owner address of the exchange pair. * `exchange_id` (integer; required): an exchange pair. * `token_id` (string; hex; required): a token ID. * `quant` (integer; required): a token inject amount. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/exchangewithdraw' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9", "exchange_id": 1, "token_id": "74726f6e6e616d65", "quant": 100 }' ``` --- ### `wallet/exchangetransaction` > Participates the transaction of exchange pair. #### Parameters * `owner_address` (string; hex; required): an owner address of the exchange pair. * `exchange_id` (integer; required): an exchange pair. * `token_id` (string; hex; required): a token ID. * `quant` (integer; required): a token inject amount. * `expected` (integer; required): an expected token amount to get. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/exchangetransaction' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9", "exchange_id": 1, "token_id": "74726f6e6e616d65", "quant": 100, "expected": 10 }' ``` --- ### `wallet/getexchangebyid` > Retrieves an exchange pair by exchange pair ID. #### Parameters * `id` (integer; required): an exchange pair ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getexchangebyid' \ -H 'Content-Type: application/json' \ -d '{ "id": 1 }' ``` #### Response example ```json { "exchange_id": 1, "creator_address": "41f596e85bfd042744f76880979a133da0728679d9", "create_time": 1539673398000, "first_token_id": "31303030353634", "first_token_balance": 5, "second_token_id": "5f", "second_token_balance": 4326459 } ``` --- ### `wallet/listexchanges` > Retrieves the list of all exchange pairs. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/listexchanges' ``` #### Response example ```json { "exchanges": [ { "exchange_id": 184, "creator_address": "4165b29b92cb5f33342647c4cc32b6efcb59eb3f45", "create_time": 1615538445000, "first_token_id": "31303033333934", "first_token_balance": 100000000000000, "second_token_id": "31303032393232", "second_token_balance": 1341470000000 }, { "exchange_id": 183, "creator_address": "41f55075d3c88b65d65e0f4cb19881182adce446b8", "create_time": 1602234009000, "first_token_id": "31303032373537", "second_token_id": "5f" }, { "exchange_id": 182, "creator_address": "41d4af469119bab46909222e77e277c655f0de9054", "create_time": 1600277286000, "first_token_id": "31303033333031", "first_token_balance": 115545377, "second_token_id": "31303032303030", "second_token_balance": 86546095 }, { "exchange_id": 181, "creator_address": "41d4af469119bab46909222e77e277c655f0de9054", "create_time": 1600208667000, "first_token_id": "5f", "first_token_balance": 37777779, "second_token_id": "31303033333031", "second_token_balance": 66176472 } ] } ``` --- ### `wallet/getchainparameters` > Retrieves the parameters of the blockchain used for witnesses to create a proposal. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getchainparameters' ``` #### Response example ```json { "chainParameter": [ { "key": "getMaintenanceTimeInterval", "value": 21600000 }, { "key": "getAccountUpgradeCost", "value": 9999000000 }, { "key": "getCreateAccountFee", "value": 100000 }, { "key": "getTransactionFee", "value": 1000 }, { "key": "getAssetIssueFee", "value": 1024000000 }, { "key": "getWitnessPayPerBlock", "value": 16000000 }, { "key": "getWitnessStandbyAllowance", "value": 115200000000 }, { "key": "getCreateNewAccountFeeInSystemContract", "value": 1000000 } ] } ``` --- ### `wallet/updatesetting` > Updates the `consume_user_resource_percent` parameter of a smart contract. #### Parameters * `owner_address` (string; hex; required): an owner address of the smart contract. * `contract_address` (string; hex; required): a smart contract address. * `consume_user_resource_percent` (integer; required): a percentage of user resource consumption. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/updatesetting' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9", "contract_address": "41c6600433381c731f22fc2b9f864b14fe518b322f", "consume_user_resource_percent": 7 }' ``` --- ### `wallet/updateenergylimit` > Updates the `origin_energy_limit` parameter of a smart contract. #### Parameters * `owner_address` (string; hex; required): an owner address of the smart contract. * `contract_address` (string; hex; required): a smart contract address. * `origin_energy_limit` (integer; required): the maximum resource consumption of the creator in one execution or creation. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/updateenergylimit' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9", "contract_address": "41c6600433381c731f22fc2b9f864b14fe518b322f", "origin_energy_limit": 7 }' ``` --- ### `wallet/getdelegatedresource` > Retrieves the energy delegation information. #### Parameters * `fromAddress` (string; hex; required): the energy "from" address. * `toAddress` (string; hex; required): the energy "to" address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getdelegatedresource' \ -H 'Content-Type: application/json' \ -d '{ "fromAddress": "419844f7600e018fd0d710e2145351d607b3316ce9", "toAddress": "41c6600433381c731f22fc2b9f864b14fe518b322f" }' ``` --- ### `wallet/getdelegatedresourceaccountindex` > Retrieves the energy delegation index by an account. #### Parameters * `value` (string; hex; required): an account address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getdelegatedresourceaccountindex' \ -H 'Content-Type: application/json' \ -d '{ "value": "419844f7600e018fd0d710e2145351d607b3316ce9" }' ``` #### Response example ```json { "account": "419844f7600e018fd0d710e2145351d607b3316ce9" } ``` --- ### `wallet/setaccountid` > Sets an account ID for an account. #### Parameters * `owner_address` (string; hex; required): an owner address. * `account_id` (string; hex; required): an account ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/setaccountid' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41a7d8a35b260395c14aa456297662092ba3b76fc0", "account_id": "6161616162626262" }' ``` #### Response example ```json { "visible": false, "txID": "5e0bec70e545e1ec197d580ae90d2d4a105409d99f7666d33e31d1b05512794a", "raw_data": { "contract": [ { "parameter": { "value": { "account_id": "6161616162626262", "owner_address": "41a7d8a35b260395c14aa456297662092ba3b76fc0" }, "type_url": "type.googleapis.com/protocol.SetAccountIdContract" }, "type": "SetAccountIdContract" } ], "ref_block_bytes": "444a", "ref_block_hash": "5078253a302d67ab", "expiration": 1680677295000, "timestamp": 1680677235852 }, "raw_data_hex": "0a02444a22085078253a302d67ab4098a7b181f5305a5a081312560a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5365744163636f756e744964436f6e747261637412210a086161616162626262121541a7d8a35b260395c14aa456297662092ba3b76fc0708cd9ad81f530" } ``` --- ### `wallet/getaccountbyid` > Retrieves account information by account ID. #### Parameters * `account_id` (string; hex; required): an account ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getaccountbyid' \ -H 'Content-Type: application/json' \ -d '{ "account_id": "6161616162626262" }' ``` --- [//]: # (### `wallet/getdeferredtransactionbyid`) [//]: # () [//]: # (> Retrieves the deferred transaction information by transaction ID.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `value` (string; hex; required): a transaction ID.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getdeferredtransactionbyid' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "address": "309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2") [//]: # (}') [//]: # (```) [//]: # () [//]: # (POST not supported) [//]: # () [//]: # (---) [//]: # (### `wallet/canceldeferredtransactionbyid`) [//]: # () [//]: # (> Retrieves a deferred transaction by transaction ID.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `transactionId` (string; hex; required): a transaction ID.) [//]: # ( * `ownerAddress` (string; hex; required): an owner address of the transaction.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/canceldeferredtransactionbyid' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "transactionId": "34e6b6497b71100756790a7f20cd729376768dd2bebb6a4a9c5e87b920d5de10",) [//]: # ( "ownerAddress": "41a7d8a35b260395c14aa456297662092ba3b76fc0") [//]: # (}') [//]: # (```) [//]: # () [//]: # (POST not supported.) [//]: # () [//]: # (---) [//]: # (### `wallet/getdeferredtransactioninfobyid`) [//]: # () [//]: # (> Retrieves the deferred transaction fee and block height by transaction ID.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `value` (string; hex; required): a transaction ID.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getdeferredtransactioninfobyid' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "value": "309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2") [//]: # (}') [//]: # (```) [//]: # () [//]: # (??? POST not supported.) [//]: # () [//]: # (---) ### `wallet/triggerconstantcontract` > Triggers the constant of the smart contract, the transaction is off the blockchain. #### Parameters * `contract_address` (string; hex; required): a smart contract address. * `function_selector` (string; required): a function call; must not leave any blank space. * `parameter` (string; required): the parameter passed to `function_selector`; the format must match with the VM's requirements; you can use a tool provided by remix to convert a parameter [1,2] into the format required by VM. * `fee_limit` (integer; required): the maximum TRX burns for resource consumption. * `call_value` (integer; required): the TRX transfer to the contract for each call. * `owner_address` (string; hex; required): an owner address that triggers the contract. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/triggerconstantcontract' \ -H 'Content-Type: application/json' \ -d '{ "contract_address": "4189139CB1387AF85E3D24E212A008AC974967E561", "function_selector": "set(uint256,uint256)", "parameter": "00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002", "fee_limit": 10, "call_value": 100, "owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292" }' ``` #### Response example ```json { "result": { "code": "CONTRACT_VALIDATE_ERROR", "message": "536d61727420636f6e7472616374206973206e6f742065786973742e" } } ``` --- ### `wallet/clearabi` > Clears the abi of a smart contract. #### Parameters * `owner_address` (string; hex; required): an owner address of the smart contract. * `contract_address` (string; hex; required): a smart contract address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/clearabi' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41a7d8a35b260395c14aa456297662092ba3b76fc0", "contract_address": "417bcb781f4743afaacf9f9528f3ea903b3782339f" }' ``` --- ### `wallet/getsignweight` > Retrieves the current signatures total weight of a transaction after signing. #### Parameters A transaction object after signing. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getsignweight' \ -H 'Content-Type: application/json' \ -d '{ "visible": true, "signature": [ "36c9d227b9dd6b6f377d018bb2df784be884f28c743dc97edfdaa8bd64b2ffb058bca24a4eb8b4543a052a4f353fee8cb9e606ff739c74d22f9451c7a35c8f5200" ], "txID": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 1000000, "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", "to_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, "type": "TransferContract", "Permission_id": 2 } ], "ref_block_bytes": "0380", "ref_block_hash": "6cdc8193f096be0f", "expiration": 1556249055000, "timestamp": 1556248995694 }, "raw_data_hex": "0a02038022086cdc8193f096be0f40989eb0bda52d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d280270eeceacbda52d" }' ``` #### Response example ```json { "result": { "code": "PERMISSION_ERROR", "message": "36c9d227b9dd6b6f377d018bb2df784be884f28c743dc97edfdaa8bd64b2ffb058bca24a4eb8b4543a052a4f353fee8cb9e606ff739c74d22f9451c7a35c8f5200 is signed by TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR but it is not contained of permission." }, "permission": { "operations": "7fff1fc0033e0300000000000000000000000000000000000000000000000000", "keys": [ { "address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", "weight": 1 }, { "address": "TGsy6W3T4fs3nAMk4E6ohfXXsosbHXRLvK", "weight": 10 } ], "threshold": 10, "id": 2, "type": "Active", "permission_name": "active" }, "transaction": { "result": { "result": true }, "txid": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d", "transaction": { "signature": [ "36c9d227b9dd6b6f377d018bb2df784be884f28c743dc97edfdaa8bd64b2ffb058bca24a4eb8b4543a052a4f353fee8cb9e606ff739c74d22f9451c7a35c8f5200" ], "txID": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 1000000, "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", "to_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, "type": "TransferContract", "Permission_id": 2 } ], "ref_block_bytes": "0380", "ref_block_hash": "6cdc8193f096be0f", "expiration": 1556249055000, "timestamp": 1556248995694 }, "raw_data_hex": "0a02038022086cdc8193f096be0f40989eb0bda52d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d280270eeceacbda52d" } } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/ title: TRON — SolidityNode API (3/4) source: docs/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3.mdx --- # TRON — SolidityNode API (3/4) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 3 of 4: [1](/rpc-service/chains/chains-api/tron/soliditynode-api-2/) · [2](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/) · 3 · [4](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p4/) ### `wallet/getapprovedlist` > Retrieves the signatures list of a transaction after signing. #### Parameters A transaction object after signing. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getapprovedlist' \ -H 'Content-Type: application/json' \ -d '{ "visible": true, "signature": [ "36c9d227b9dd6b6f377d018bb2df784be884f28c743dc97edfdaa8bd64b2ffb058bca24a4eb8b4543a052a4f353fee8cb9e606ff739c74d22f9451c7a35c8f5200" ], "txID": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 1000000, "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", "to_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, "type": "TransferContract", "Permission_id": 2 } ], "ref_block_bytes": "0380", "ref_block_hash": "6cdc8193f096be0f", "expiration": 1556249055000, "timestamp": 1556248995694 }, "raw_data_hex": "0a02038022086cdc8193f096be0f40989eb0bda52d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d280270eeceacbda52d" }' ``` #### Response example ```json { "result": {}, "approved_list": [ "TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR" ], "transaction": { "result": { "result": true }, "txid": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d", "transaction": { "signature": [ "36c9d227b9dd6b6f377d018bb2df784be884f28c743dc97edfdaa8bd64b2ffb058bca24a4eb8b4543a052a4f353fee8cb9e606ff739c74d22f9451c7a35c8f5200" ], "txID": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 1000000, "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", "to_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, "type": "TransferContract", "Permission_id": 2 } ], "ref_block_bytes": "0380", "ref_block_hash": "6cdc8193f096be0f", "expiration": 1556249055000, "timestamp": 1556248995694 }, "raw_data_hex": "0a02038022086cdc8193f096be0f40989eb0bda52d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d280270eeceacbda52d" } } } ``` --- ### `wallet/accountpermissionupdate` > Sets a multi-signature for an account. #### Parameters * `owner_address` (string; hex; required): an owner address of the account. * `owner` (object): an account owner permission. * `witness` (object): an account witness permission; only for the witness. * `actives` (array): an operation permission. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/accountpermissionupdate' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", "owner": { "type": 0, "permission_name": "owner", "threshold": 1, "keys": [ { "address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", "weight": 1 } ] }, "actives": [ { "type": 2, "permission_name": "active12323", "threshold": 2, "operations": "7fff1fc0033e0000000000000000000000000000000000000000000000000000", "keys": [ { "address": "TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR", "weight": 1 }, { "address": "TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP", "weight": 1 } ] } ], "visible": true }' ``` ### Response example ```json { "visible": true, "txID": "893420ec0302c29b8a060b3a2ebbdf5239b628570a329b492f3e9a38222eb9a1", "raw_data": { "contract": [ { "parameter": { "value": { "owner": { "keys": [ { "address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", "weight": 1 } ], "threshold": 1, "permission_name": "owner" }, "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ", "actives": [ { "operations": "7fff1fc0033e0000000000000000000000000000000000000000000000000000", "keys": [ { "address": "TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR", "weight": 1 }, { "address": "TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP", "weight": 1 } ], "threshold": 2, "type": "Active", "permission_name": "active12323" } ] }, "type_url": "type.googleapis.com/protocol.AccountPermissionUpdateContract" }, "type": "AccountPermissionUpdateContract" } ], "ref_block_bytes": "4ffc", "ref_block_hash": "4e38306be89d0e14", "expiration": 1680686277000, "timestamp": 1680686217702 }, "raw_data_hex": "0a024ffc22084e38306be89d0e144088c3d585f5305aee01082e12e9010a3c747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e745065726d697373696f6e557064617465436f6e747261637412a8010a1541a7d8a35b260395c14aa456297662092ba3b76fc012241a056f776e657220013a190a1541a7d8a35b260395c14aa456297662092ba3b76fc01001226908021a0b6163746976653132333233200232207fff1fc0033e00000000000000000000000000000000000000000000000000003a190a15418ba2aaae540c642e44e3bed5522c63bbc21fff9210013a190a15416d684e23fdb378cd815852f42ab7d20c35160548100170e6f3d185f530" } ``` --- ### `wallet/getzenpaymentaddress` > Retrieves payment address. #### Parameters * `ivk` (string; hex; required): an incoming viewing key. * `d` (string; required): d. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/createtransaction' \ -H 'Content-Type: application/json' \ -d '{ "ivk": "8c7852e10862d8eec058635974f70f24c1f8d73819131bb5b54028d0a9408a03", "d": "736ba8692ed88a5473e009" }' ``` --- [//]: # (### `wallet/scannotebyivk`) [//]: # () [//]: # (> Retrieves all the notes by ivk.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # (Note: Range limit (`end_block_index` - `start_block_index` is less than or equal to 1000)) [//]: # () [//]: # ( * `start_block_index` (integer; required): the start block height (included in the range).) [//]: # ( * `end_block_index` (integer; required): the end block height (excluded from the range).) [//]: # ( * `ivk` (): an incoming viewing key.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/scannotebyivk' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "start_block_index": 0,) [//]: # ( "end_block_index": 100,) [//]: # ( "ivk": "80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05") [//]: # (}') [//]: # (```) [//]: # () [//]: # (??? POST not supported.) [//]: # () [//]: # (---) [//]: # (### `wallet/scanandmarknotebyivk`) [//]: # () [//]: # (> Retrieves all the notes with spent status by ivk.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # (Note: Range limit (`end_block_index` - `start_block_index` is less than or equal to 1000)) [//]: # () [//]: # ( * `start_block_index` (integer; required): the start block height (included in the range).) [//]: # ( * `end_block_index` (integer; required): the end block height (excluded from the range).) [//]: # ( * `ivk` (string; required): an incoming viewing key.) [//]: # ( * `ak` (string; required): an ak key.) [//]: # ( * `nk` (string; required): an nk key.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/scanandmarknotebyivk' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "start_block_index": 0,) [//]: # ( "end_block_index": 100,) [//]: # ( "ivk": "80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05",) [//]: # ( "ak": "1d4f9b5551f4aa9443ceb263f0e208eb7e26080264571c5ef06de97a646fe418",) [//]: # ( "nk": "748522c7571a9da787e43940c9a474aa0c5c39b46c338905deb6726fa3678bdb") [//]: # (}') [//]: # (```) [//]: # () [//]: # (??? POST not supported.) [//]: # () [//]: # (---) [//]: # (### `wallet/scannotebyovk`) [//]: # () [//]: # (> Retrieves all the notes by ovk.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # (Note: Range limit (`end_block_index` - `start_block_index` is less than or equal to 1000)) [//]: # () [//]: # ( * `start_block_index` (integer; required): the start block height (included in the range).) [//]: # ( * `end_block_index` (): the end block height (excluded in the range).) [//]: # ( * `ovk` (string; required): an outgoing viewing key.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/scannotebyovk' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "start_block_index": 0,) [//]: # ( "end_block_index": 100,) [//]: # ( "ovk": "705145aa18cbe6c11d5d0011419a98f3d5b1d341eb4727f1315597f4bdaf8539") [//]: # (}') [//]: # (```) [//]: # () [//]: # (??? POST not supported.) [//]: # () [//]: # (---) ### `wallet/getrcm` > Retrieves a random commitment trapdoor. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getrcm' ``` #### Response example ```json { "value": "cf41ab2baca05e1fee6d34778f1b059ae93669aa8011f4bc629a75c495226801" } ``` --- [//]: # (### `wallet/getmerkletreevoucherinfo`) [//]: # () [//]: # (> Retrieves a merkle tree information of a note.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `out_points` (array; required): note information.) [//]: # () [//]: # (#### Request parameters) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getmerkletreevoucherinfo' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "out_points":[{) [//]: # ( "hash":"185b3e085723f5862b3a3c3cf54d52f5c1eaf2541e3a1e0ecd08bc12cd958d74",) [//]: # ( "index":0) [//]: # ( }]) [//]: # (}') [//]: # (```) [//]: # () [//]: # (??? POST not supported.) [//]: # () [//]: # (---) [//]: # (### `wallet/isspend`) [//]: # () [//]: # (> Checks whether a note is spent or not.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `ak` (string; hex; required): an ak key.) [//]: # ( * `nk` (string; hex; required): an nk key.) [//]: # ( * `note` (object; required): note information.) [//]: # ( * `txid` (string; hex; required): a transaction ID.) [//]: # ( * `index` (integer; required): a note index.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/isspend' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "ak": "a3e65d509b675aaa2aeda977ceff11eebd76218079b6f543d78a615e396ca129",) [//]: # ( "nk": "62cfda9bea09a53cf2a21022057913734a8458969e11e0bb9c59ead48fbce83e",) [//]: # ( "note": {) [//]: # ( "payment_address": "ztron1aqgauawtkelxfu2w6s48cwh0mchjt6kwpj44l4wym3pullx0294j4r4v7kpm75wnclzycsw73mq",) [//]: # ( "rcm": "74a16c1b27ec7fbf06881d9d35ddaab1554838b1bddcd54f6bd8a9fb4ba0b80a",) [//]: # ( "value": 500000000) [//]: # ( },) [//]: # ( "txid": "7d09e471bb047d3ac044d5d6691b3721a2dddbb683ac02c207fbe78af6302463",) [//]: # ( "index": 1) [//]: # (}') [//]: # (```) [//]: # () [//]: # (??? POST not supported.) [//]: # () [//]: # (---) [//]: # (### `wallet/createshieldnullifier`) [//]: # () [//]: # (> Creates a shielded nullifier.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `note` (object; required): note information) [//]: # ( * `voucher` (object; required): voucher information.) [//]: # ( * `ak` (string; hex; required): an ak key.) [//]: # ( * `nk` (string; hex; required): an nk key.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/createshieldnullifier' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "note": {) [//]: # ( "payment_address": "ztron1aqgauawtkelxfu2w6s48cwh0mchjt6kwpj44l4wym3pullx0294j4r4v7kpm75wnclzycsw73mq",) [//]: # ( "rcm": "74a16c1b27ec7fbf06881d9d35ddaab1554838b1bddcd54f6bd8a9fb4ba0b80a",) [//]: # ( "value": 500000000) [//]: # ( },) [//]: # ( "voucher": {) [//]: # ( "tree": {) [//]: # ( "left": {) [//]: # ( "content": "a4d763fae3fee78964ccdf7567ec3062c95a5b97825d731202d3dfa6cb01c143") [//]: # ( }) [//]: # ( },) [//]: # ( "rt": "7dc3652c2a16e8518a8be0e3e038f9d28c3eb96f13e8da8acc2a9b650702f33e") [//]: # ( },) [//]: # ( "ak": "a3e65d509b675aaa2aeda977ceff11eebd76218079b6f543d78a615e396ca129",) [//]: # ( "nk": "62cfda9bea09a53cf2a21022057913734a8458969e11e0bb9c59ead48fbce83e") [//]: # (}') [//]: # (```) [//]: # () [//]: # (??? POST not supported.) [//]: # () [//]: # (---) [//]: # (### `wallet/getshieldtransactionhash`) [//]: # () [//]: # (> Retrieves a shielded transaction hash.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # (A transaction object.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getshieldtransactionhash' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "txID": "de639a64497d86bb27e34a2953093a0cc488ec4c7bc9624ac5857d3799748595",) [//]: # ( "raw_data": {) [//]: # ( "contract": [) [//]: # ( {) [//]: # ( "parameter": {) [//]: # ( "value": {) [//]: # ( "binding_signature": "2b8ae5e11ecad3e6946f54b7ad513bd8692a3edae72d29e266b28e47c9b37ccdb38e3b6433575694b6681136b1734f85afcfe672061d2ee7368755ad0b96a80b",) [//]: # ( "spend_description": [) [//]: # ( {) [//]: # ( "value_commitment": "cbe1063adbe7e10919421fa6133f03150253913f5aff02d165e2c019cea4a869",) [//]: # ( "anchor": "fb1115d5ddd16c5427c3a608d6b5add5967e70f51c890307c6142083a2c28565",) [//]: # ( "nullifier": "93e329d464e1dbddc8bb4d2dcc939a796dfe11e985d4e9033a15edf0e3df4f35",) [//]: # ( "rk": "10c702d6dff1509502ee5acc0b01d4b4531b2ff53b0dd54488aea6031b5e6d16",) [//]: # ( "zkproof": "abf64b3beacfd873b1db764c3da9f739993518f3f740e761cb8af60682b7171892895c3ccfb550c3cf757e906dbf5313a3676b8226b0b84960f76a185c8d3fdfc3fa9c08479a704852d7b3dfeb913cf13e01c25657561e00a06c61e7c65b50b812902ddc4f17bfe2bcb2f247c2dc6132d0f0e0abcecc0332fdd99077af10d07bbdb88c4fd257948428e233c57f84eee8b2eeab2162c1aeccf2e1dfaa306d5803a8b2d281a549440fbd5a3657a830c1ca07a384cea446aa077b195b29b23023b1") [//]: # ( }) [//]: # ( ],) [//]: # ( "receive_description": [) [//]: # ( {) [//]: # ( "value_commitment": "f6d45db8ec5a1c8dbbde040b4ea138efbe8db2d0597ed2306ff3fdd0620b3c5a",) [//]: # ( "note_commitment": "ec3f5472ac8114a9a07987d1c2a0e1254504e352d9574971e77084293900312e",) [//]: # ( "epk": "719eeb5ebaeeccc55c9f0d73767aadf0c0513603400ccb50bd789637d984b8e6",) [//]: # ( "c_enc": "3a6c4fe0e79f5b23fed34a419c4728d0b26bca23180a22871743b0a9444c27663cf07c55a0ea6db504d70421768bf17384e180b2ad8b8be88ff5cf662c53a4ba086effc3a4b1df39265f71dfac884bff5a69e1dcdcae8aecf6ae443168ffab692a5c1e4908b415dd830dcf6432fae1c32461132080da74d6b83d3d00887eb2ce9965a749f8d8410ea4182969371ac2fd5e0e74d27d883492a08e6209cd9959d74bb67c2a9fe7faac5a4777f1bff19cf0b6398a2faa9b194bbb93d60f132f382f7d693a722e8cbca1da084ee7e0c371397419a7259d1fa0943078cfe5ea352e4b53907bb6c04ca8ad409fb0ae0b110a6b312200e21ab79d543ae7aeb16802cf87afdac1e8954038caa42818f4ca2847fd642360c098accfeeade4abd1cc9ca3315a4336be224ba3516973c7dae3f41875457236675993df38d3a544470c4f9335d77b005e6a9aec40fd881b34852ec9bbbcc3d24ee92930eae770a5462ce04c4e37b0524ef07e00e8d58c810d6aefb19fa7bc2c3a2fdfab6dd4fe73dbecc0795a280f9b7ca35cc8bc1062aed8e26bd81ba33c6f4c318974636f6d796723e77772ced3dbc1f42afec6fc9bb61f8beac704affea9baf2e2de226250c1d427c7d78b1eb1d239e1f3eb6af0f017b80541333f4fce17340048d826b9b0be8477c996ad8bfc3440dc686fdff6d0d63986db4d95962d7977289cbfd14c745de7c79d4dc0bcd220e5b4ced5b409e79142e0f336e44ca29a9a87f6f43707d8c4936e895236dd2b393a478a8bc27b1f682496ba84a0ddc549da06cb7855c4d8680dc66ac40240733b7f",) [//]: # ( "c_out": "50be6e77854d4c427b2af4f16e5275f0b0c206b3ea2d2a24ffb287ea356f323523354cd83d15e7c48e6f1fa103dfca3d49ca2263dbb0cd8bfb35d72cdcad1351de6fba7a30aea27184a68bcda19cc6da",) [//]: # ( "zkproof": "a4e6c50d5753092d005689922c2bdeafc98775bce59db840974163ace23c13fec18112e32aae1c39842c645ed172ad8fa277e63c1e3d6d7fb12eb15d56b573237b776f562a81d0e6be362d147d8604fdfec421482270ca82950de1883fda06e719f5d256d7a039769bffc570a1778d70c17295d1c0336a6ae0903d2460dc139a9563c2d40f37bffefa73003a55af1ff0861b6f79ef40099b6a0cb25ab3f40727210e4629647d0711abff125712a5f0d64fcb6e6a6b0b34478d7da0552b493a80") [//]: # ( }) [//]: # ( ]) [//]: # ( },) [//]: # ( "type_url": "type.googleapis.com/protocol.ShieldedTransferContract") [//]: # ( },) [//]: # ( "type": "ShieldedTransferContract") [//]: # ( }) [//]: # ( ],) [//]: # ( "ref_block_bytes": "0d59",) [//]: # ( "ref_block_hash": "7356ce5c35d8265e",) [//]: # ( "expiration": 1559237283000,) [//]: # ( "timestamp": 1559201285590) [//]: # ( },) [//]: # ( "raw_data_hex": "0a020d5922087356ce5c35d8265e40b899a3ceb02d5a940b0833128f0b0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e536869656c6465645472616e73666572436f6e747261637412d50a1acb020a20cbe1063adbe7e10919421fa6133f03150253913f5aff02d165e2c019cea4a8691220fb1115d5ddd16c5427c3a608d6b5add5967e70f51c890307c6142083a2c285651a2093e329d464e1dbddc8bb4d2dcc939a796dfe11e985d4e9033a15edf0e3df4f35222010c702d6dff1509502ee5acc0b01d4b4531b2ff53b0dd54488aea6031b5e6d162ac001abf64b3beacfd873b1db764c3da9f739993518f3f740e761cb8af60682b7171892895c3ccfb550c3cf757e906dbf5313a3676b8226b0b84960f76a185c8d3fdfc3fa9c08479a704852d7b3dfeb913cf13e01c25657561e00a06c61e7c65b50b812902ddc4f17bfe2bcb2f247c2dc6132d0f0e0abcecc0332fdd99077af10d07bbdb88c4fd257948428e233c57f84eee8b2eeab2162c1aeccf2e1dfaa306d5803a8b2d281a549440fbd5a3657a830c1ca07a384cea446aa077b195b29b23023b122c2070a20f6d45db8ec5a1c8dbbde040b4ea138efbe8db2d0597ed2306ff3fdd0620b3c5a1220ec3f5472ac8114a9a07987d1c2a0e1254504e352d9574971e77084293900312e1a20719eeb5ebaeeccc55c9f0d73767aadf0c0513603400ccb50bd789637d984b8e622c4043a6c4fe0e79f5b23fed34a419c4728d0b26bca23180a22871743b0a9444c27663cf07c55a0ea6db504d70421768bf17384e180b2ad8b8be88ff5cf662c53a4ba086effc3a4b1df39265f71dfac884bff5a69e1dcdcae8aecf6ae443168ffab692a5c1e4908b415dd830dcf6432fae1c32461132080da74d6b83d3d00887eb2ce9965a749f8d8410ea4182969371ac2fd5e0e74d27d883492a08e6209cd9959d74bb67c2a9fe7faac5a4777f1bff19cf0b6398a2faa9b194bbb93d60f132f382f7d693a722e8cbca1da084ee7e0c371397419a7259d1fa0943078cfe5ea352e4b53907bb6c04ca8ad409fb0ae0b110a6b312200e21ab79d543ae7aeb16802cf87afdac1e8954038caa42818f4ca2847fd642360c098accfeeade4abd1cc9ca3315a4336be224ba3516973c7dae3f41875457236675993df38d3a544470c4f9335d77b005e6a9aec40fd881b34852ec9bbbcc3d24ee92930eae770a5462ce04c4e37b0524ef07e00e8d58c810d6aefb19fa7bc2c3a2fdfab6dd4fe73dbecc0795a280f9b7ca35cc8bc1062aed8e26bd81ba33c6f4c318974636f6d796723e77772ced3dbc1f42afec6fc9bb61f8beac704affea9baf2e2de226250c1d427c7d78b1eb1d239e1f3eb6af0f017b80541333f4fce17340048d826b9b0be8477c996ad8bfc3440dc686fdff6d0d63986db4d95962d7977289cbfd14c745de7c79d4dc0bcd220e5b4ced5b409e79142e0f336e44ca29a9a87f6f43707d8c4936e895236dd2b393a478a8bc27b1f682496ba84a0ddc549da06cb7855c4d8680dc66ac40240733b7f2a5050be6e77854d4c427b2af4f16e5275f0b0c206b3ea2d2a24ffb287ea356f323523354cd83d15e7c48e6f1fa103dfca3d49ca2263dbb0cd8bfb35d72cdcad1351de6fba7a30aea27184a68bcda19cc6da32c001a4e6c50d5753092d005689922c2bdeafc98775bce59db840974163ace23c13fec18112e32aae1c39842c645ed172ad8fa277e63c1e3d6d7fb12eb15d56b573237b776f562a81d0e6be362d147d8604fdfec421482270ca82950de1883fda06e719f5d256d7a039769bffc570a1778d70c17295d1c0336a6ae0903d2460dc139a9563c2d40f37bffefa73003a55af1ff0861b6f79ef40099b6a0cb25ab3f40727210e4629647d0711abff125712a5f0d64fcb6e6a6b0b34478d7da0552b493a802a402b8ae5e11ecad3e6946f54b7ad513bd8692a3edae72d29e266b28e47c9b37ccdb38e3b6433575694b6681136b1734f85afcfe672061d2ee7368755ad0b96a80b70d68b8ebdb02d") [//]: # (}') [//]: # (```) [//]: # () [//]: # (??? POST not supported.) [//]: # () [//]: # (---) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/soliditynode-api-2-p4/ title: TRON — SolidityNode API (4/4) source: docs/rpc-service/chains/chains-api/tron/soliditynode-api-2-p4.mdx --- # TRON — SolidityNode API (4/4) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 4 of 4: [1](/rpc-service/chains/chains-api/tron/soliditynode-api-2/) · [2](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/) · [3](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/) · 4 ### `wallet/gettriggerinputforshieldedtrc20contract` > Retrieves the trigger input data of shielded TRC-20 contract for the shielded TRC-20 parameters without spending authority signature. #### Parameters * `shielded_TRC20_Parameters` (object; required): the generated shielded TRC-20 parameters. * `spend_authority_signature` (array; required): the spend authority signatures. * `amount` (string; required): an amount. * `transparent_to_address` (string; required): the receiver for the `burn` operation. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/gettriggerinputforshieldedtrc20contract' \ -H 'Content-Type: application/json' \ -d '{ "shielded_TRC20_Parameters": {"spend_description": [{"value_commitment": "e3fcc8609ff6a4b00b77a00ef624f305cec5f55cc7312ff5526d0b3057f2ef9e","anchor": "4c9cbebece033dc1d253b93e4a3682187daae4f905515761d10287b801e69816","nullifier": "74edce8798a3976ee41e045bb666f3a121c27235b0f1b44b3456d2c84bc725dc","rk": "9dcf4254aa7c4fb7c8bc6956d4b0c7c6c87c37a2552e7bf4e60c12cb5bc6c8cd","zkproof": "9926045cd1442a7d20153e6abda9f77a6526895f0a29a57cb1bc76ef6b7cacef2d0f4c94aa97c3acacdb95cabb065057b7edb4cbea098149a8aa7114a6a6b340c58007ac64b64e592eb18fdd299de5962a2a32ab0caebb2ab198704c751a9d0e143d68a50257d7c9e2230a7420fa46450299fd167141367e201726532d8e815413d8571d6c8c12937674dec92caf1f4583ebe560ac4c7eba290deee0a1c0da5f72c0b9df89fb3b338c683b654b3dc2373a4c2a4fef7f4fa489b44405fb7d2bfb"}],"binding_signature": "11e949887d9ec92eb32c78f0bc48afdc9a16a2ecbd5a0eca1be070fb900eeda347918bd6e9521d4baf1f74963bee0c1956559623a9e7cbc886941b227341ea06","message_hash": "7e6a00736c4f9e0036cb74c7fa3b1e3cd8f6bf0f038edeb03b668c4c5536a357","parameter_type": "burn"}, "spend_authority_signature": [ { "value": "eeaaecd725ac80ec398b95cf188b769c1be66cc8e76e6c90843b7f23818704595719ce8bf694ffb8cd7aaa8739d50fe8eea7ba39d5026c4b019c973185ca7201" } ], "amount": "6000", "transparent_to_address": "4140cd765f8e637a2bbe00f9bc458f6b21eb0e648f" }' ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/soliditynode-api-2/ title: TRON — SolidityNode API (1/4) source: docs/rpc-service/chains/chains-api/tron/soliditynode-api-2.mdx --- # TRON — SolidityNode API (1/4) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 1 of 4: 1 · [2](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p2/) · [3](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p3/) · [4](/rpc-service/chains/chains-api/tron/soliditynode-api-2-p4/) ### `wallet/getaccount` > Retrieves account information. #### Parameters * `address` (string; hex; required): an account address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getaccount' \ -H 'Content-Type: application/json' \ -d '{ "address": "41E552F6487585C2B58BC2C9BB4492BC1F17132CD0" }' ``` #### Response example ```json [ { "blockNumber": 49989959, "contractResult": [ "" ], "blockTimeStamp": 1680582663000, "receipt": { "net_usage": 268 }, "id": "1dca7ae3d0fc5b73b5bc3ede1d2eb1b63fc128fce39196088a2198ff83fbc5ed" }, { "blockNumber": 49989959, "contractResult": [ "" ], "blockTimeStamp": 1680582663000, "receipt": { "net_usage": 265 }, "id": "04d86b079842247e14cd0c4648e315b78c861eb91abcaf4e022f88155b73f628" }, { "blockNumber": 49989959, "contractResult": [ "" ], "blockTimeStamp": 1680582663000, "receipt": { "net_usage": 280 }, "id": "a1b550fa6681c4afc90f619a2fa4ca26305b09bc964bef5a833123626e451391" } ] ``` --- ### `wallet/listwitnesses` > Retrieves the list of witnesses. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/listwitnesses' ``` #### Response example ```json { "witnesses": [ { "address": "4100e9fdbd1d24ab56996bd37d76fb7b16dcf62ff1", "voteCount": 1087436, "url": "https://www.tronmacau.com" }, { "address": "41012f81bd368f632fb22b9ddfeb284155f1f04198", "voteCount": 314, "url": "https://firekraken.media" }, { "address": "4101c17562ee5a1ecb60f9ea6e49ef94ec0de99580", "voteCount": 377, "url": "https://tronpad.com" }, { "address": "41021957c4576cbeae8bdf0576248e3e486a4cf3fa", "voteCount": 5, "url": "HTTPS://BEFREE" }, { "address": "41022939a4a06cbc7b384096c1af8657ec435173af", "voteCount": 1404388255, "url": "antinvestmentgroup", "totalProduced": 895427, "totalMissed": 1119, "latestBlockNum": 49996531, "latestSlotNum": 560200795, "isJobs": true }, { "address": "4102a0ed82a9609e7ea9155f00137dc3fce818033f", "voteCount": 98954, "url": "XREGlobal.com" } ] } ``` --- ### `wallet/getassetissuelist` > Retrieves the list of all tokens. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getassetissuelist' ``` #### Response example ```json { "assetIssue": [ { "owner_address": "414d1ef8673f916debb7e2515a8f3ecaf2611034aa", "name": "53454544", "abbr": "53454544", "total_supply": 100000000000, "trx_num": 1000000, "num": 1, "start_time": 1529987043000, "end_time": 1530342060000, "description": "536573616d657365656420746f6b656e7320666f7220636f6d6d756e697479207265776172647320616e6420534545446765726d696e61746f7220696e766573746d656e74206f6620636f6d6d756e6974792d766f7465642070726f6a656374732e", "url": "687474703a2f2f7777772e736573616d65736565642e6f7267", "id": "1000001" }, { "owner_address": "410b53ce4aa6f0c2f3c849f11f682702ec99622e2e", "name": "545258", "abbr": "545258", "total_supply": 99000000000, "trx_num": 1000000, "num": 1, "start_time": 1529989896000, "end_time": 1537632000000, "description": "74726f6e546f6b656e", "url": "68747470733a2f2f74726f6e2e6e6574776f726b", "id": "1000002" }, { "owner_address": "41d13433f53fdf88820c2e530da7828ce15d6585cb", "name": "49504653", "abbr": "49504653", "total_supply": 100000000000, "trx_num": 1000000, "num": 1, "start_time": 1529990700000, "end_time": 1537632000000, "description": "4950465320636f696e", "url": "687474703a2f2f", "id": "1000003" } ] } ``` --- ### `wallet/getpaginatedassetissuelist` > Retrieves the list of all tokens by pagination. #### Parameters * `offset` (integer; required): the index of the start token. * `limit` (integer; required): the amount of tokens per page. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getpaginatedassetissuelist' \ -H 'Content-Type: application/json' \ -d '{ "offset": 0, "limit": 10 }' ``` #### Response example ```json { "assetIssue": [ { "owner_address": "416b1171698969a36e5eb2eb6ea7aa9204d5e10cfc", "name": "21212121474f4c44434f494e", "abbr": "474f4c44", "total_supply": 9000000000000000000, "trx_num": 1000000, "num": 1000, "start_time": 1556094180182, "end_time": 1871799840182, "description": "474f4c44", "url": "68747470733a2f2f676f6c64636861696e2e78797a", "id": "1002341" }, { "owner_address": "418f82a73b283c7bf8515fa3cc2c0399d4d593e2e3", "name": "21212121476f6c6453706f7421212121", "abbr": "476f6c64", "total_supply": 99000000000, "frozen_supply": [ { "frozen_amount": 2000000000, "frozen_days": 30 } ], "trx_num": 1000000, "num": 100, "start_time": 1559106000646, "end_time": 1609451940646, "description": "476f6c6453706f7420666f6c6c6f7720746865207072696365206f6620676f6c6420696e2074686520626c6f636b636861696e212121204f776e6572732077696c6c2067657420414753202861476f6c6453706f74292064726f70206d6f6e74686c792e20476f6c6453706f742077696c6c20626520757067726164656420746f206120747263323020696e20323032302e20496e7665737420696e2074686520676f6c64206d61726b657421212120476c6f62616c20476f6c6420547261646572732121", "url": "7777772e676f6c6473706f742e6575", "id": "1002467" } ] } ``` --- ### `wallet/getpaginatedproposallist` > Retrieves the list of all proposals by pagination. #### Parameters * `offset` (integer; required): the index of the proposals starting position. * `limit` (integer; required): the amount of proposals per page. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getpaginatedproposallist' \ -H 'Content-Type: application/json' \ -d '{ "offset": 0, "limit": 10 }' ``` #### Response example ```json { "proposals": [ { "proposal_id": 1, "proposer_address": "41c189fa6fc9ed7a3580c3fe291915d5c6a6259be7", "parameters": [ { "key": 9, "value": 1 } ], "expiration_time": 1539259200000, "create_time": 1538981229000, "approvals": [ "41c189fa6fc9ed7a3580c3fe291915d5c6a6259be7", "4167e39013be3cdd3814bed152d7439fb5b6791409", "418c66e4883782b793fcf2dcb92b23eece57769499", "41bac7378c4265ad2739772337682183b8864f517a", "414a193c92cd631c1911b99ca964da8fd342f4cddd", "41d25855804e4e65de904faf3ac74b0bdfc53fac76", "4193a8bc2e7d6bb1bd75fb2d74107ffbda81af439d", "41d1dbde8b8f71b48655bec4f6bb532a0142b88bc0", "417b88db9da8aacae0a7e967d24c0fc00129e815f6", "41243accc5241d97ce79272b06952ee88a34d8e1f9", "41f70386347e689e6308e4172ed7319c49c0f66e0b", "41d49bf5202b3dba65d46a5be73396b6b66d3555aa", "41beab998551416b02f6721129bb01b51fceceba08", "412fb5abdf8a1670f533c219e7251fe30b89849359", "4116440834509c59de4ee6ba4933678626f451befe", "414d1ef8673f916debb7e2515a8f3ecaf2611034aa", "415863f6091b8e71766da808b1dd3159790f61de7d", "4138e3e3a163163db1f6cfceca1d1c64594dd1f0ca", "41fc45da0e51966bd1af2cb1e0f66633f160603a8b", "41d376d829440505ea13c9d1c455317d51b62e4ab6", "41b487cdc02de90f15ac89a68c82f44cbfe3d915ea", "411103d62d8299e90fa011b4ce7fc6ba151e5f1a23" ], "state": "APPROVED" } ] } ``` --- ### `wallet/getpaginatedexchangelist` > Retrieves the list of all exchange pairs by pagination. #### Parameters * `offset` (integer; required): the index of the starting exchange pair. * `limit` (integer; required): the amount of exchange pairs per page. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getpaginatedexchangelist' \ -H 'Content-Type: application/json' \ -d '{ "offset": 0, "limit": 10 }' ``` #### Response example ```json { "exchanges": [ { "exchange_id": 1, "creator_address": "41f596e85bfd042744f76880979a133da0728679d9", "create_time": 1539673398000, "first_token_id": "31303030353634", "first_token_balance": 5, "second_token_id": "5f", "second_token_balance": 4326459 }, { "exchange_id": 2, "creator_address": "41cd3444bd2d493628b14d6dcec93181e15f94d169", "create_time": 1541678472000, "first_token_id": "31303031333035", "first_token_balance": 1, "second_token_id": "5f", "second_token_balance": 3015102 }, { "exchange_id": 3, "creator_address": "412d7bdb9846499a2e5e6c5a7e6fb05731c83107c7", "create_time": 1541717787000, "first_token_id": "31303030303138", "second_token_id": "5f" } ] } ``` --- ### `wallet/getnextmaintenancetime` > Retrieves the time interval till the next vote round. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getnextmaintenancetime' ``` #### Response example ```json { "num": 1680609600000 } ``` --- ### `wallet/validateaddress` > Checks the validity of the address. #### Parameters * `address` (string; hex; required): an address to check. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/validateaddress' \ -H 'Content-Type: application/json' \ -d '{ "address": "4189139CB1387AF85E3D24E212A008AC974967E561" }' ``` #### Response example ```json { "result": true, "message": "Hex string format" } ``` --- ### `wallet/deploycontract` > Deploys a smart contract. #### Parameters * `abi` (array of key-value pairs; required): an ABI. * `bytecode` (string; hex; required): bytecode. * `parameter` (string; hex; optional): the list of constructor parameters, converted to Hex after being encoded according to ABI encoder. * `call_value` (integer; required): a TRX transfer to the contract for each call. * `name` (string; required): a contract name. * `consume_user_resource_percent` (integer; required): the percentage of user's resource consumption; an integer between [0, 100]; 0 means it does not consume user's resource until the developer's resource has been used up. * `fee_limit` (integer; required): the maximum TRX burns for resource consumption. * `origin_energy_limit` (integer; required): the maximum resource consumption of the creator in one execution or creation. * `owner_address` (string; hex; required): an owner address of the contract. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/deploycontract' \ -H 'Content-Type: application/json' \ -d '{ "abi": "[{\"constant\":false,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]", "bytecode": "608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029", "parameter": "", "call_value": 100, "name": "SomeContract", "consume_user_resource_percent": 30, "fee_limit": 10, "origin_energy_limit": 10, "owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292" }' ``` #### Response example ```json { "visible": false, "txID": "b0311a4ac0b819f06be5957ca5ec707d6e1e2895db615f1e98d314780f821b89", "contract_address": "41a1bade45e57cd6883d745f3cfaa9e71e60a1ea70", "raw_data": { "contract": [ { "parameter": { "value": { "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292", "new_contract": { "bytecode": "608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029", "consume_user_resource_percent": 30, "name": "SomeContract", "origin_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292", "abi": { "entrys": [ { "inputs": [ { "name": "key", "type": "uint256" }, { "name": "value", "type": "uint256" } ], "name": "set", "stateMutability": "Nonpayable", "type": "Function" }, { "outputs": [ { "name": "value", "type": "uint256" } ], "constant": true, "inputs": [ { "name": "key", "type": "uint256" } ], "name": "get", "stateMutability": "View", "type": "Function" } ] }, "origin_energy_limit": 10, "call_value": 100 } }, "type_url": "type.googleapis.com/protocol.CreateSmartContract" }, "type": "CreateSmartContract" } ], "ref_block_bytes": "e938", "ref_block_hash": "16069bb4f2f73549", "expiration": 1680607314000, "fee_limit": 10, "timestamp": 1680607256012 }, "raw_data_hex": "0a02e938220816069bb4f2f7354940d08082e0f4305add03081e12d8030a30747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e437265617465536d617274436f6e747261637412a3030a1541d1e7a6bc354106cb410e65ff8b181c600ff142921289030a1541d1e7a6bc354106cb410e65ff8b181c600ff142921a5c0a2b1a03736574220e12036b65791a0775696e743235362210120576616c75651a0775696e74323536300240030a2d10011a03676574220e12036b65791a0775696e743235362a10120576616c75651a0775696e743235363002400222fd01608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b250400292864301e3a0c536f6d65436f6e7472616374400a70ccbbfedff43090010a" } ``` --- ### `wallet/triggersmartcontract` > Triggers a smart contract. Note: The unit of TRX in the parameters is SUN. #### Parameters * `contract_address` (string; hex; required): a contract address. * `function_selector` (string; required): a function call; must not leave any blank space. * `parameter` (string; required): the parameter passed to `function_selector`; the format must match with the VM's requirements; you can use a tool provided by remix to convert a parameter [1,2] into the format required by VM. * `fee_limit` (integer; required): the maximum TRX burns for resource consumption. * `call_value` (integer; required): the TRX transfer to the contract for each call. * `owner_address` (string; hex; required): an owner address that triggers the contract. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/triggersmartcontract' \ -H 'Content-Type: application/json' \ -d '{ "contract_address": "4189139CB1387AF85E3D24E212A008AC974967E561", "function_selector": "set(uint256,uint256)", "parameter": "00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002", "fee_limit": 10, "call_value": 100, "owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292" }' ``` #### Response example ```json { "result": { "code": "CONTRACT_VALIDATE_ERROR", "message": "4e6f20636f6e7472616374206f72206e6f7420612076616c696420736d61727420636f6e7472616374" } } ``` --- ### `wallet/getcontract` > Retrieves a contract. #### Parameters * `value` (string; hex; required): a contract address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getcontract' \ -H 'Content-Type: application/json' \ -d '{ "value": "4189139CB1387AF85E3D24E212A008AC974967E561" }' ``` --- ### `wallet/proposalcreate` > Creates a proposal. #### Parameters * `owner_address` (string; hex; required): a creator address. * `parameters` (array of objects): proposal parameters. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/proposalcreate' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "419844F7600E018FD0D710E2145351D607B3316CE9", "parameters": [ { "key": 0, "value": 100000 }, { "key": 1, "value": 2 } ] }' ``` --- ### `wallet/getproposalbyid` > Retrieves a proposal by proposal ID. #### Parameters * `id` (integer; required): a proposal ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getproposalbyid' \ -H 'Content-Type: application/json' \ -d '{ "id": 1 }' ``` #### Response example ```json { "proposal_id": 1, "proposer_address": "41c189fa6fc9ed7a3580c3fe291915d5c6a6259be7", "parameters": [ { "key": 9, "value": 1 } ], "expiration_time": 1539259200000, "create_time": 1538981229000, "approvals": [ "41c189fa6fc9ed7a3580c3fe291915d5c6a6259be7", "4167e39013be3cdd3814bed152d7439fb5b6791409", "418c66e4883782b793fcf2dcb92b23eece57769499", "41bac7378c4265ad2739772337682183b8864f517a", "414a193c92cd631c1911b99ca964da8fd342f4cddd", "41d25855804e4e65de904faf3ac74b0bdfc53fac76", "4193a8bc2e7d6bb1bd75fb2d74107ffbda81af439d", "41d1dbde8b8f71b48655bec4f6bb532a0142b88bc0", "417b88db9da8aacae0a7e967d24c0fc00129e815f6", "41243accc5241d97ce79272b06952ee88a34d8e1f9", "41f70386347e689e6308e4172ed7319c49c0f66e0b", "41d49bf5202b3dba65d46a5be73396b6b66d3555aa", "41beab998551416b02f6721129bb01b51fceceba08", "412fb5abdf8a1670f533c219e7251fe30b89849359", "4116440834509c59de4ee6ba4933678626f451befe", "414d1ef8673f916debb7e2515a8f3ecaf2611034aa", "415863f6091b8e71766da808b1dd3159790f61de7d", "4138e3e3a163163db1f6cfceca1d1c64594dd1f0ca", "41fc45da0e51966bd1af2cb1e0f66633f160603a8b", "41d376d829440505ea13c9d1c455317d51b62e4ab6", "41b487cdc02de90f15ac89a68c82f44cbfe3d915ea", "411103d62d8299e90fa011b4ce7fc6ba151e5f1a23" ], "state": "APPROVED" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/soliditynode-api-p2/ title: TRON — SolidityNode API (2/4) source: docs/rpc-service/chains/chains-api/tron/soliditynode-api-p2.mdx --- # TRON — SolidityNode API (2/4) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 2 of 4: [1](/rpc-service/chains/chains-api/tron/soliditynode-api/) · 2 · [3](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/) · [4](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/) ## SolidityNode API ### `/walletsolidity/getaccountbyid` > Retrieves an account information by account ID. #### Parameters * `account_id` (string; hex; required): an account ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getaccountbyid' \ -H 'Content-Type: application/json' \ -d '{ "account_id": "41712d3993327b916c33eea0c3e8ea3eab592e88da" }' ``` --- ### `/walletsolidity/getblockbyid` > Retrieves block information by block ID. #### Parameters * `value` (string; required): a block ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getblockbyid' \ -H 'Content-Type: application/json' \ -d '{ "value": "0000000002fa856df555c6441cf755a551b131a5ca8d84f116dc59c042ef18fa" }' ``` #### Response example ```json { "blockID": "0000000002fa856df555c6441cf755a551b131a5ca8d84f116dc59c042ef18fa", "block_header": { "raw_data": { "number": 49972589, "txTrieRoot": "354bd442f2111081081826ae638a0d07422609aeea8dc63c3ad208088525567e", "witness_address": "41022939a4a06cbc7b384096c1af8657ec435173af", "parentHash": "0000000002fa856c18e27615c5ea553ff7c8318059b555801f329e9533dec810", "version": 27, "timestamp": 1680530541000 }, "witness_signature": "aad4536d655327bcb64a0046f69fc2fa5be5dfc2f76e391736c1bf7e0a96c08c0498a3b5aae821360ffa2a2b1797731a06e02fa9fd314a3d3c23a4eda0301fe501" }, "transactions": [ { "ret": [ { "contractRet": "SUCCESS" } ], "signature": [ "c3c631c6d079838166807e67dbf2c734dec6f30cd981066c44758dcd1f4fe1e835d035e7f60501ea9bf42fdd0a54f8592771714c66a4f2a581c2b3d7c3f9d43f01" ], "txID": "eb337d551043fc90e2f3cbd4ad8a2a61f0e3496e0662114628f0f2ff8a231bb0", "raw_data": { "contract": [ { "parameter": { "value": { "data": "a9059cbb000000000000000000000000b034574a3a36a2e8c77d7d187facf91b8c3dd80300000000000000000000000000000000000000000000000000000000177bf680", "owner_address": "418695dfd9b3e39cb574fa3893372fa3c6e329320c", "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c" }, "type_url": "type.googleapis.com/protocol.TriggerSmartContract" }, "type": "TriggerSmartContract" } ], "ref_block_bytes": "8559", "ref_block_hash": "537fd1c2c65c4c31", "expiration": 1680530795000, "fee_limit": 100000000, "timestamp": 1680530537504 }, "raw_data_hex": "0a0285592208537fd1c2c65c4c3140f8d3c3bbf4305aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a15418695dfd9b3e39cb574fa3893372fa3c6e329320c121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb000000000000000000000000b034574a3a36a2e8c77d7d187facf91b8c3dd80300000000000000000000000000000000000000000000000000000000177bf68070a0f8b3bbf430900180c2d72f" } ] } ``` --- ### `/walletsolidity/getblockbylimitnext` > Retrieves a list of blocks by range. #### Parameters * `startNum` (integer; required): the block height to start from (included in the range). * `endNum` (integer; required): the block height to end with (excluded from the range). #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getblockbylimitnext' \ -H 'Content-Type: application/json' \ -d '{ "startNum": 1, "endNum": 2 }' ``` #### Response example ```json { "block": [ { "blockID": "00000000000000010ff5414c5cfbe9eae982e8cef7eb2399a39118e1206c8247", "block_header": { "raw_data": { "number": 1, "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", "witness_address": "415095d4f4d26ebc672ca12fc0e3a48d6ce3b169d2", "parentHash": "00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dc", "timestamp": 1529891469000 }, "witness_signature": "4544a6004c76286a1d6248f451bf148345a51e21881e84899758468da7b1c7e85b809735a1b2be29f166cfba8c5e69543f4f24294fbfa0498a39002166a397ba00" } } ] } ``` --- ### `/walletsolidity/getblockbylatestnum` > Retrieves several latest blocks. #### Parameters * `num` (integer; required): the number of blocks to return. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getblockbylatestnum' \ -H 'Content-Type: application/json' \ -d '{ "num": 1 }' ``` #### Response example ```json { "block": [ { "blockID": "0000000002fa889448bff265ae132d3ce3a61c02f5f2f3a8307df772014e2f66", "block_header": { "raw_data": { "number": 49973396, "txTrieRoot": "1c530d753117305b7ffdca38f6087dc4f5f2cf3f18f46f03f9353be6df733f32", "witness_address": "418440ffd578f7a5abf3537b5f46a6980d382db581", "parentHash": "0000000002fa88938e671ca492f416843f3d8e69ec12f0750955f72cf11604f1", "version": 27, "timestamp": 1680532962000 }, "witness_signature": "f2d71f8b28afc21f71c5a2e80a815cfe6f7cc6f56f8059cbb3d0dfed6ad36826299956284650041ca06aaae7f45657f2e2ed8363b9a6eb999d6c6207fa7a830400" }, "transactions": [ { "ret": [ { "contractRet": "SUCCESS" } ], "signature": [ "f072741d74c3d637b7f2070be99a8362383e119e08f00db5de31d025fee4cf817cc9f5551479bfb0ad9cf056cb76a76192ddd293ea67096aa94cb129cdc455be01" ], "txID": "929a0c3976c4fc26b3b8a5d922ec5fc1bf3685a0cd7e303d50d3c394120e1ffb", "raw_data": { "contract": [ { "parameter": { "value": { "data": "a9059cbb00000000000000000000004133751dd8f732e5c0f7c32eb247b524cb3f0b17b0000000000000000000000000000000000000000000000000000000000606f800", "owner_address": "41d1c4bb7b2f39aba5707711719b2236b5b605af2e", "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c" }, "type_url": "type.googleapis.com/protocol.TriggerSmartContract" }, "type": "TriggerSmartContract" } ], "ref_block_bytes": "8880", "ref_block_hash": "24c789571ad256f0", "expiration": 1680533018597, "fee_limit": 30000000, "timestamp": 1680532902000 }, "raw_data_hex": "0a028880220824c789571ad256f040e5afcbbcf4305aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541d1c4bb7b2f39aba5707711719b2236b5b605af2e121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb00000000000000000000004133751dd8f732e5c0f7c32eb247b524cb3f0b17b0000000000000000000000000000000000000000000000000000000000606f80070f0a0c4bcf43090018087a70e" } ] } ] } ``` --- [//]: # (### `/walletsolidity/getdeferredtransactionbyid`) [//]: # () [//]: # (> Retrieves the deferred transaction information by transaction ID.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `value` (string; required): a transaction ID.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getdeferredtransactionbyid' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "value": "309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2") [//]: # (}') [//]: # (```) [//]: # () [//]: # (POST not supported) [//]: # () [//]: # (---) [//]: # (### `/walletsolidity/getdeferredtransactioninfobyid`) [//]: # () [//]: # (> Retrieves the deferred transaction fee and block height by transaction ID.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `value` (string; required): a transaction ID.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getdeferredtransactioninfobyid' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "value": "309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2") [//]: # (}') [//]: # (```) [//]: # () [//]: # (POST not supported) [//]: # () [//]: # (---) [//]: # (### `/walletsolidity/getmerkletreevoucherinfo`) [//]: # () [//]: # (> Retrieves a merkle tree information of a note.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `out_points` (array of key-value pairs): note information.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getmerkletreevoucherinfo' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "out_points":[{) [//]: # ( "hash":"185b3e085723f5862b3a3c3cf54d52f5c1eaf2541e3a1e0ecd08bc12cd958d74",) [//]: # ( "index":0) [//]: # ( }]) [//]: # (}') [//]: # (```) [//]: # () [//]: # (POST not supported) [//]: # () [//]: # (---) [//]: # (### `/walletsolidity/scannotebyivk`) [//]: # () [//]: # (> Retrieves all the notes by ivk.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `start_block_index` (integer; required): a block height to start from (included in the range).) [//]: # ( * `end_block_index` (integer; required): a block height to end with (excluded from the range).) [//]: # ( * `ivk` (string; required): an incoming viewing key.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/scannotebyivk' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "start_block_index": 0,) [//]: # ( "end_block_index": 100,) [//]: # ( "ivk": "80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05") [//]: # (}') [//]: # (```) [//]: # () [//]: # (POST not supported) [//]: # () [//]: # (---) [//]: # (### `/walletsolidity/scanandmarknotebyivk`) [//]: # () [//]: # (> Retrieves all the notes with spent status by ivk.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `start_block_index` (integer; required): a block height to start from (included in the range).) [//]: # ( * `end_block_index` (integer; required): a block height to end with (excluded from the range).) [//]: # ( * `ivk` (string; required): an incoming viewing key.) [//]: # ( * `ak` (string; required): an ak key.) [//]: # ( * `nk` (string; required): an nk key.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/scanandmarknotebyivk' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "start_block_index": 0,) [//]: # ( "end_block_index": 100,) [//]: # ( "ivk": "80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05",) [//]: # ( "ak": "1d4f9b5551f4aa9443ceb263f0e208eb7e26080264571c5ef06de97a646fe418",) [//]: # ( "nk": "748522c7571a9da787e43940c9a474aa0c5c39b46c338905deb6726fa3678bdb") [//]: # (}') [//]: # (```) [//]: # () [//]: # (POST not supported.) [//]: # () [//]: # (---) [//]: # (### `/walletsolidity/scannotebyovk`) [//]: # () [//]: # (> Retrieves all the notes by ovk.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `start_block_index` (integer; required): a block height to start from (included in the range).) [//]: # ( * `end_block_index` (integer; required): a block height to end with (excluded from the range).) [//]: # ( * `ovk` (string; required): an outgoing viewing key.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/scannotebyovk' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "start_block_index": 0,) [//]: # ( "end_block_index": 100,) [//]: # ( "ovk": "705145aa18cbe6c11d5d0011419a98f3d5b1d341eb4727f1315597f4bdaf8539") [//]: # (}') [//]: # (```) [//]: # () [//]: # (POST not supported.) [//]: # () [//]: # (---) [//]: # (### `/walletsolidity/isspend`) [//]: # () [//]: # (> Checks whether a note is spent or not.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `ak` (string; required): an ak key.) [//]: # ( * `nk` (string; required): an nk key.) [//]: # ( * `note` (a list of key-value data): note information.) [//]: # ( * `txid` (string; required): a transaction ID.) [//]: # ( * `index` (integer): a note index.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/isspend' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "ak": "a3e65d509b675aaa2aeda977ceff11eebd76218079b6f543d78a615e396ca129",) [//]: # ( "nk": "62cfda9bea09a53cf2a21022057913734a8458969e11e0bb9c59ead48fbce83e",) [//]: # ( "note": {) [//]: # ( "payment_address": "ztron1aqgauawtkelxfu2w6s48cwh0mchjt6kwpj44l4wym3pullx0294j4r4v7kpm75wnclzycsw73mq",) [//]: # ( "rcm": "74a16c1b27ec7fbf06881d9d35ddaab1554838b1bddcd54f6bd8a9fb4ba0b80a",) [//]: # ( "value": 500000000) [//]: # ( },) [//]: # ( "txid": "7d09e471bb047d3ac044d5d6691b3721a2dddbb683ac02c207fbe78af6302463",) [//]: # ( "index": 1) [//]: # (}') [//]: # (```) [//]: # () [//]: # (POST not supported.) [//]: # () [//]: # (---) [//]: # (### `/walletsolidity/scanshieldedtrc20notesbyivk`) [//]: # () [//]: # (> Scans the shielded TRC-20 notes by ivk and marks their status of whether spent or not.) [//]: # () [//]: # (#### Parameters) [//]: # () [//]: # ( * `start_block_index` (integer; required): a block height to start from (included in the range).) [//]: # ( * `end_block_index` (integer; required): a block height to end with (excluded from the range).) [//]: # ( * `shielded_TRC20_contract_address` (string; required): a shielded TRC-20 contract address.) [//]: # ( * `ivk` (string; required): an incoming viewing key.) [//]: # ( * `ak` (string; required): an ak key.) [//]: # ( * `nk` (string; required): an nk key.) [//]: # () [//]: # (#### Request example) [//]: # () [//]: # (```shell) [//]: # (curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/scanshieldedtrc20notesbyivk' \) [//]: # (-H 'Content-Type: application/json' \) [//]: # (-d '{) [//]: # ( "start_block_index": 9200,) [//]: # ( "end_block_index": 9240,) [//]: # ( "shielded_TRC20_contract_address": "41274fc7464fadac5c00c893c58bce6c39bf59e4c7",) [//]: # ( "ivk": "9f8e74bb3d7188a2781dc1db38810c6914eef4570a79e8ec8404480948e4e305",) [//]: # ( "ak":"8072d9110c9de9d9ade33d5d0f5890a7aa65b0cde42af7816d187297caf2fd64",) [//]: # ( "nk":"590bf33f93f792be659fd404df91e75c3b08d38d4e08ee226c3f5219cf598f14") [//]: # (}') [//]: # (```) [//]: # () [//]: # (??? Does not exist.) [//]: # () [//]: # (---) **FullNode API**: ### `wallet/createtransaction` > Creates a transfer transaction. If `to_address` doesn't exist, creates an account on the blockchain. #### Parameters * `to_address` (string; hex; required): a destination address. * `owner_address` (string; hex; required): a sender address. * `amount` (integer; required): a transfer amount. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/createtransaction' \ -H 'Content-Type: application/json' \ -d '{ "to_address": "41e9d79cc47518930bc322d9bf7cddd260a0260a8d", "owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292", "amount": 1000 }' ``` --- ### `wallet/broadcasttransaction` > Broadcasts a transaction after signing. #### Parameters A transaction after signing, containing `signature`, `txID`, `raw_data` #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/broadcasttransaction' \ -H 'Content-Type: application/json' \ -d '{ "signature": [ "97c825b41c77de2a8bd65b3df55cd4c0df59c307c0187e42321dcc1cc455ddba583dd9502e17cfec5945b34cad0511985a6165999092a6dec84c2bdd97e649fc01" ], "txID": "454f156bf1256587ff6ccdbc56e64ad0c51e4f8efea5490dcbc720ee606bc7b8", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 1000, "owner_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0", "to_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, "type": "TransferContract" } ], "ref_block_bytes": "267e", "ref_block_hash": "9a447d222e8de9f2", "expiration": 1530893064000, "timestamp": 1530893006233 } }' ``` --- ### `wallet/broadcasthex` > Broadcasts a transaction hex string after signing. #### Parameters * `transaction` (string; hex; required): a transaction hex after signing. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/broadcasthex' \ -H 'Content-Type: application/json' \ -d '{ "transaction": "0A8A010A0202DB2208C89D4811359A28004098A4E0A6B52D5A730802126F0A32747970652E676F6F676C65617069732E636F6D2F70726F746F636F6C2E5472616E736665724173736574436F6E747261637412390A07313030303030311215415A523B449890854C8FC460AB602DF9F31FE4293F1A15416B0580DA195542DDABE288FEC436C7D5AF769D24206412418BF3F2E492ED443607910EA9EF0A7EF79728DAAAAC0EE2BA6CB87DA38366DF9AC4ADE54B2912C1DEB0EE6666B86A07A6C7DF68F1F9DA171EEE6A370B3CA9CBBB00" }' ``` #### Response example ```json { "result": false, "code": "SIGERROR", "txid": "38a0482d6d5a7d1439a50b848d68cafa7d904db48b82344f28765067a5773e1d", "message": "Validate signature error: 8bf3f2e492ed443607910ea9ef0a7ef79728daaaac0ee2ba6cb87da38366df9ac4ade54b2912c1deb0ee6666b86a07a6c7df68f1f9da171eee6a370b3ca9cbbb00 is signed by TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW but it is not contained of permission.", "transaction": "{\"raw_data\": {\"ref_block_bytes\": \"02db\",\"ref_block_hash\": \"c89d4811359a2800\",\"expiration\": 1560496575000,\"contract\": [{\"type\": \"TransferAssetContract\",\"parameter\": {\"type_url\": \"type.googleapis.com/protocol.TransferAssetContract\",\"value\": \"0a07313030303030311215415a523b449890854c8fc460ab602df9f31fe4293f1a15416b0580da195542ddabe288fec436c7d5af769d242064\"}}]},\"signature\": [\"8bf3f2e492ed443607910ea9ef0a7ef79728daaaac0ee2ba6cb87da38366df9ac4ade54b2912c1deb0ee6666b86a07a6c7df68f1f9da171eee6a370b3ca9cbbb00\"]}" } ``` --- ### `wallet/updateaccount` > Updates the name of an account. #### Parameters * `account_name` (string; hex; required): an account name. * `owner_address` (string; hex; required): an owner address. * `permission_id` (string; optional): for multi-sig use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/updateaccount' \ -H 'Content-Type: application/json' \ -d '{ "account_name": "0x7570646174654e616d6531353330383933343635353139", "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292" }' ``` #### Response example ```json { "visible": false, "txID": "5814a0c0b25f3cc8926f56b4742f4b7b32979f7c6c2dc240fcfd7bc3061de3a5", "raw_data": { "contract": [ { "parameter": { "value": { "account_name": "7570646174654e616d6531353330383933343635353139", "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292" }, "type_url": "type.googleapis.com/protocol.AccountUpdateContract" }, "type": "AccountUpdateContract" } ], "ref_block_bytes": "cd8f", "ref_block_hash": "4441a3e65f66075c", "expiration": 1680586065000, "timestamp": 1680586007964 }, "raw_data_hex": "0a02cd8f22084441a3e65f66075c40e888f1d5f4305a6a080a12660a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74557064617465436f6e747261637412300a177570646174654e616d6531353330383933343635353139121541d1e7a6bc354106cb410e65ff8b181c600ff14292709ccbedd5f430" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/soliditynode-api-p3/ title: TRON — SolidityNode API (3/4) source: docs/rpc-service/chains/chains-api/tron/soliditynode-api-p3.mdx --- # TRON — SolidityNode API (3/4) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 3 of 4: [1](/rpc-service/chains/chains-api/tron/soliditynode-api/) · [2](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/) · 3 · [4](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/) ## SolidityNode API ### `wallet/votewitnessaccount` > Votes for witnesses. #### Parameters * `owner_address` (string; hex; required): an owner address. * `votes` (array of key-value pairs): your votes description. * `vote_address` (string; hex; required): the address of the witness you want to vote for. * `vote_count` (integer; required): the number of votes you'd like to give. * `permission_id` (integer; optional): for multi-sig use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/votewitnessaccount' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292", "votes": [ { "vote_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0", "vote_count": 5 } ] }' ``` --- ### `wallet/getBrokerage` > Retrieves the ratio of brokerage of the witness. #### Parameters * `address` (string; hex; required): the address of the witness's account. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getBrokerage' \ -H 'Content-Type: application/json' \ -d '{ "address": "41E552F6487585C2B58BC2C9BB4492BC1F17132CD0" }' ``` #### Response example ```json { "brokerage": 20 } ``` --- ### `wallet/getReward` > Retrieves unclaimed reward. #### Parameters * `address` (string; hex; required): the address of the voter's account. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getReward' \ -H 'Content-Type: application/json' \ -d '{ "address": "41E552F6487585C2B58BC2C9BB4492BC1F17132CD0" }' ``` #### Response example ```json { "reward": 0 } ``` --- ### `wallet/updateBrokerage` > Updates the ratio of brokerage. #### Parameters * `owner_address` (string; hex; required): the address of the witness's account. * `brokerage` (integer; required): the ration of the brokerage you'd like to update to. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/updateBrokerage' \ -H 'Content-Type: application/json' \ -d '{ "owner_address":"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0", "brokerage":30 }' ``` --- ### `wallet/getaccountbalance` > Retrieves the account balance in a specific block. #### Parameters * `account_identifier` (required): an identifier of the account: * `address` (string; hex; required): an account address. * `block_identifier` (required): an identifier of the block: * `hash` (string; hex; required): a block hash. * `number` (integer): a block number. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getaccountbalance' \ -H 'Content-Type: application/json' \ -d '{ "account_identifier": { "address": "TLLM21wteSPs4hKjbxgmH1L6poyMjeTbHm" }, "block_identifier": { "hash": "0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9", "number": 68682 }, "visible": true }' ``` #### Response example ```json { "balance": 0, "block_identifier": { "hash": "0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9", "number": 68682 } } ``` --- ### `wallet/createassetissue` > Issues a token. #### Parameters * `owner_address` (string; hex; required): an owner address. * `name` (string; hex; required): a token name. * `abbr` (string; hex; required): a token name abbreviation. * `total_supply` (integer; required): token total supply. * `trx_num` (integer; required): defines the price by the ratio of `trx_num`/`num`. * `num` (integer; required): defines the price by the ratio of `trx_num`/`num`. * `start_time` (integer; required): ICO start time. * `end_time` (integer; required): ICO end time. * `description` (string; hex; required): a token description. * `url` (string; hex; required): a token's official website URL. * `free_asset_net_limit` (integer; required): a token's free asset net limit. * `public_free_asset_net_limit` (integer; required): a token's public asset net limit. * `frozen_supply` (object: required): token staked supply: * `frozen_amount` (integer; required): the amount staked. * `frozen_days` (integer; required): the number of days. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/createassetissue' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0", "name": "0x6173736574497373756531353330383934333132313538", "abbr": "0x6162627231353330383934333132313538", "total_supply": 4321, "trx_num": 1, "num": 1, "start_time": 1530894315158, "end_time": 1533894312158, "description": "007570646174654e616d6531353330363038383733343633", "url": "007570646174654e616d6531353330363038383733343633", "free_asset_net_limit": 10000, "public_free_asset_net_limit": 10000, "frozen_supply": { "frozen_amount": 1, "frozen_days": 2 } }' ``` --- ### `wallet/updatewitness` > Updates the witness's website URL. #### Parameters * `owner_address` (string; hex; required): an owner address. * `update_url` (string; hex; required): a website URL. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/updatewitness' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292", "update_url": "007570646174654e616d6531353330363038383733343633" }' ``` --- ### `wallet/createaccount` > Creates an account. #### Parameters * `owner_address` (string; hex; required): an owner address. * `account_address` (string; hex; required): a new address. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/createaccount' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292", "account_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0" }' ``` --- ### `wallet/createwitness` > Applies to become a witness. #### Parameters * `owner_address` (string; hex; required): an owner address. * `url` (string; hex; required): a website URL. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/createwitness' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292", "url": "007570646174654e616d6531353330363038383733343633" }' ``` --- ### `wallet/transferasset` > Transfers a token. #### Parameters * `owner_address` (string; hex; required): an owner address. * `to_address` (string; hex; required): a destination address. * `asset_name` (string; hex; required): a token ID. * `amount` (integer; required): a token transfer amount. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/transferasset' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292", "to_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0", "asset_name": "31303030303031", "amount": 100 }' ``` --- ### `wallet/participateassetissue` > Participates a token. Returns a transaction object. #### Parameters * `to_address` (string; hex; required): the issuer address of the token. * `owner_address` (string; hex; required): the participant address. * `amount` (integer; required): a participate token amount. * `asset_name` (string; hex; required): a token ID. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/participateassetissue' \ -H 'Content-Type: application/json' \ -d '{ "to_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0", "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1", "amount": 100, "asset_name": "3230313271756265696a696e67" }' ``` --- ### `wallet/freezebalance` > Stakes TRX. #### Parameters * `owner_address` (string; hex; required): an owner address. * `frozen_balance` (integer; required): a TRX stake amount. * `frozen_duration` (integer; required): TRX stake duration, at least 3 days. * `resource` (string; required): TRX stake type (`BANDWIDTH`/`ENERGY`). * `receiver_address` (string; hex; required): the address to receive the resource. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/freezebalance' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1", "frozen_balance": 10000, "frozen_duration": 3, "resource": "BANDWIDTH", "receiver_address": "414332f387585c2b58bc2c9bb4492bc1f17342cd1" }' ``` --- ### `wallet/unfreezebalance` > Unstakes the staked TRX that is due. #### Parameters * `owner_address` (string; hex; required): an owner address. * `resource` (string; required): staked TRX unstake type (`BANDWIDTH`/`ENERGY`). * `receiver_address` (string; hex; required): the address to lose the resource. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/unfreezebalance' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1", "resource": "BANDWIDTH", "receiver_address": "414332f387585c2b58bc2c9bb4492bc1f17342cd1" }' ``` --- ### `wallet/unfreezeasset` > Unstakes the staked token that is due. #### Parameters * `owner_address` (string; hex; required): an owner address. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/unfreezeasset' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1" }' ``` --- ### `wallet/withdrawbalance` > Withdraws a reward to an account balance for witnesses. #### Parameters * `owner_address` (string; hex; required): an owner address. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/withdrawbalance' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1" }' ``` --- ### `wallet/updateasset` > Updates token information. #### Parameters * `owner_address` (string; hex; required): an owner address. * `description` (string; hex; required): a token description. * `url` (string; hex): the token's website URL. * `new_limit` (integer; required): each token holder's free bandwidth. * `new_public_limit` (integer; required): the total free bandwidth of the token. * `permission_id` (string; optional): for multi-signature use. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/updateasset' \ -H 'Content-Type: application/json' \ -d '{ "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1", "description": "", "url": "", "new_limit": 1000000, "new_public_limit": 100 }' ``` --- ### `wallet/getassetissuebyaccount` > Retrieves the token issue information of an account. #### Parameters * `address` (string; hex; required): a token issuer's address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getassetissuebyaccount' \ -H 'Content-Type: application/json' \ -d '{ "address": "41F9395ED64A6E1D4ED37CD17C75A1D247223CAF2D" }' ``` --- ### `wallet/getaccountnet` > Retrieves the bandwidth information of an account. #### Parameters * `address` (string; hex; required): an account address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getaccountnet' \ -H 'Content-Type: application/json' \ -d '{ "address": "4112E621D5577311998708F4D7B9F71F86DAE138B5" }' ``` #### Response example ```json { "freeNetLimit": 1500, "assetNetUsed": [ { "key": "1000532", "value": 0 }, { "key": "1002962", "value": 0 }, { "key": "1002775", "value": 0 }, { "key": "1002573", "value": 0 }, { "key": "1003049", "value": 0 }, { "key": "1001871", "value": 0 }, { "key": "1002927", "value": 0 }, { "key": "1002636", "value": 0 } ], "assetNetLimit": [ { "key": "1000532", "value": 0 }, { "key": "1002962", "value": 0 } ], "TotalNetLimit": 43200000000, "TotalNetWeight": 39127812682 } ``` --- ### `wallet/getassetissuebyname` > Retrieves a token by token name. If the token name you query is not unique, this api will return an error. #### Parameters * `value` (string; hex; required): a token name. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getassetissuebyname' \ -H 'Content-Type: application/json' \ -d '{ "value": "44756354616E" }' ``` --- ### `wallet/getassetissuelistbyname` > Retrieves the list of tokens by name. #### Parameters * `value` (string; hex; required): a token name. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getassetissuelistbyname' \ -H 'Content-Type: application/json' \ -d '{ "value": "44756354616E" }' ``` --- ### `wallet/getassetissuebyid` > Retrieves a token by token ID. #### Parameters * `value` (string; hex; required): a token ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getassetissuebyid' \ -H 'Content-Type: application/json' \ -d '{ "value": "1000001" }' ``` #### Response example ```json { "owner_address": "414d1ef8673f916debb7e2515a8f3ecaf2611034aa", "name": "53454544", "abbr": "53454544", "total_supply": 100000000000, "trx_num": 1000000, "num": 1, "start_time": 1529987043000, "end_time": 1530342060000, "description": "536573616d657365656420746f6b656e7320666f7220636f6d6d756e697479207265776172647320616e6420534545446765726d696e61746f7220696e766573746d656e74206f6620636f6d6d756e6974792d766f7465642070726f6a656374732e", "url": "687474703a2f2f7777772e736573616d65736565642e6f7267", "id": "1000001" } ``` --- ### `wallet/getnowblock` > Retrieves the latest block information. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getnowblock' ``` #### Response example ```json { "blockID": "0000000002fae045b2c5caae3229fa17f2b9b00c603d19f535581f1ae934d63c", "block_header": { "raw_data": { "number": 49995845, "txTrieRoot": "3c06f5e0afe80d8eebf9bc4c019df67c72a4be68d609f69dc1d14147b7aabe02", "witness_address": "41d376d829440505ea13c9d1c455317d51b62e4ab6", "parentHash": "0000000002fae044905f37c65c913d5eac3ceaed495131f13aa657f7f336efe2", "version": 27, "timestamp": 1680600327000 }, "witness_signature": "01f4d3e47766bd5f763cf53520b0832add1743560a11e43ad1f4f9b1478f494b6c731d5e53096922c00fc5398fbbc68e77e9b5087d064bb33fa1d8685a35bba201" }, "transactions": [ { "ret": [ { "contractRet": "SUCCESS" } ], "signature": [ "af028c602ab25e6b701ce5266810d6353e6d7642cf6eb3630554b9e3c09da1e5763f386cc91b726f9fcbbe0a356ba295902397fb9e1d99079be816c2a9775cc701" ], "txID": "a0f90e85c0969407e8a02a8c25fd752e6a84c42230f05c71f0d07d23be68102d", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 2500000000, "owner_address": "4159f33c7dcdfb016f14e38f28a3e6ece9ade61c3a", "to_address": "4158c708263724a4b52701f80f63a0c314153317ed" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, "type": "TransferContract" } ], "ref_block_bytes": "e030", "ref_block_hash": "b977ba00ada6335d", "expiration": 1680600499747, "timestamp": 1680600319747 }, "raw_data_hex": "0a02e0302208b977ba00ada6335d40a38ce2dcf4305a69080112650a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412340a154159f33c7dcdfb016f14e38f28a3e6ece9ade61c3a12154158c708263724a4b52701f80f63a0c314153317ed1880f28ba80970838ed7dcf430" } ] } ``` --- ### `wallet/getblockbynum` > Retrieves block information by block height. #### Parameters * `num` (integer; required): a block height. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getblockbynum' \ -H 'Content-Type: application/json' \ -d '{ "num": 1 }' ``` #### Response example ```json { "blockID": "00000000000000010ff5414c5cfbe9eae982e8cef7eb2399a39118e1206c8247", "block_header": { "raw_data": { "number": 1, "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", "witness_address": "415095d4f4d26ebc672ca12fc0e3a48d6ce3b169d2", "parentHash": "00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dc", "timestamp": 1529891469000 }, "witness_signature": "4544a6004c76286a1d6248f451bf148345a51e21881e84899758468da7b1c7e85b809735a1b2be29f166cfba8c5e69543f4f24294fbfa0498a39002166a397ba00" } } ``` --- ### `wallet/getblockbyid` > Retrieves a block information by block ID. #### Parameters * `value` (string; hex; required): a block ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getblockbyid' \ -H 'Content-Type: application/json' \ -d '{ "value": "0000000002fac94622cce188d5cf0fe3e7d9c27e5a01bdf9356b7ef35eeab160" }' ``` #### Response example ```json { "blockID": "0000000002fac94622cce188d5cf0fe3e7d9c27e5a01bdf9356b7ef35eeab160", "block_header": { "raw_data": { "number": 49989958, "txTrieRoot": "05f50bb51b90efe53d2d9c6df915c679df083d34c30055a2fc87419980f246f6", "witness_address": "4178c842ee63b253f8f0d2955bbc582c661a078c9d", "parentHash": "0000000002fac9457ebb855883515d42995029edb217a405aa47aadd8252b6d1", "version": 27, "timestamp": 1680582660000 }, "witness_signature": "b973f3bfd45138beffbdcad06277886ade7941eefec2aebf5dc8061547c5846255dcb4b2316839b33f574ffe2c301d04c2c27f12a941faf3747b8c2dca325c1f01" }, "transactions": [ { "ret": [ { "contractRet": "SUCCESS" } ], "signature": [ "76b8a945442917034f7cfb2f6eed70c3f4e37f1ca396221bea0edf991cef8c8c7d8b93c944e6da2f76a4550d25eb64ffecb49b7617fc166398d566dfe9b1e80800" ], "txID": "4caa8909391afd3dfb28a3d332e735f3cdcddf1d4081ede54f82d9de208a85b9", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 300000000, "owner_address": "413c6120b82a61d0e0bb0c4d4ebfae56cb664ba5a6", "to_address": "411ba55baf1e61fa22907822730ebfe7a5cf573ad5" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, "type": "TransferContract" } ], "ref_block_bytes": "c932", "ref_block_hash": "6a781a380ccdd036", "expiration": 1680582714000, "timestamp": 1680582656449 }, "raw_data_hex": "0a02c93222086a781a380ccdd0364090c5a4d4f4305a69080112650a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412340a15413c6120b82a61d0e0bb0c4d4ebfae56cb664ba5a61215411ba55baf1e61fa22907822730ebfe7a5cf573ad51880c6868f0170c183a1d4f430" } ] } ``` --- ### `wallet/getblockbylimitnext` > Retrieves a list of blocks by range. #### Parameters * `startNum` (integer; required): the block height to start with (included in the range). * `endNum` (integer; required): the block height to end by (excluded from the range) #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getblockbylimitnext' \ -H 'Content-Type: application/json' \ -d '{ "startNum": 1, "endNum": 2 }' ``` #### Response example ```json { "block": [ { "blockID": "00000000000000010ff5414c5cfbe9eae982e8cef7eb2399a39118e1206c8247", "block_header": { "raw_data": { "number": 1, "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", "witness_address": "415095d4f4d26ebc672ca12fc0e3a48d6ce3b169d2", "parentHash": "00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dc", "timestamp": 1529891469000 }, "witness_signature": "4544a6004c76286a1d6248f451bf148345a51e21881e84899758468da7b1c7e85b809735a1b2be29f166cfba8c5e69543f4f24294fbfa0498a39002166a397ba00" } } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/soliditynode-api-p4/ title: TRON — SolidityNode API (4/4) source: docs/rpc-service/chains/chains-api/tron/soliditynode-api-p4.mdx --- # TRON — SolidityNode API (4/4) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 4 of 4: [1](/rpc-service/chains/chains-api/tron/soliditynode-api/) · [2](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/) · [3](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/) · 4 ## SolidityNode API ### `wallet/getblockbylatestnum` > Retrieves several latest blocks. #### Parameters * `num` (integer; required): the number of blocks to retrieve. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getblockbylatestnum' \ -H 'Content-Type: application/json' \ -d '{ "num": 2 }' ``` #### Response example ```json { "block": [ { "blockID": "0000000002fae13af77e3d41a08627787aac6d6b14b35a6a0f61d2f6406a6786", "block_header": { "raw_data": { "number": 49996090, "txTrieRoot": "8d3996515f1a5920b10654086f36bcf0f530884da714ed1c615199ad1cb51802", "witness_address": "4167e39013be3cdd3814bed152d7439fb5b6791409", "parentHash": "0000000002fae139af04335a42dcd2634f64a74b6f50eaabb7d7d4da3c6034f9", "version": 27, "timestamp": 1680601062000 }, "witness_signature": "999930eb33440390207ef38a1c5bc2dfe58f5b4daa6999a7da5f1befdace72e3046ee3d7546fc09df68af22e71f126f9f1a247cb1b9bded32651558b6d3ad2e801" }, "transactions": [ { "ret": [ { "contractRet": "SUCCESS" } ], "signature": [ "6830537a8b58835a7d1b1f97821e4adb16e8c508de08cc1a50408818593c84d972c7ad32cff868cbab506a4f1cf13e4be9eaf9348621f27f4097a53fc05901551b" ], "txID": "6702a31b744e701527f8b412da6430173dbb0e04e6a70341aa4fdc94719b799f", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 50000000, "owner_address": "41c0629df9ebfc8f5ec92e576c350afa72ef63ae5e", "to_address": "4194b0f036660971a160c434d3a021edbd966f524b" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, "type": "TransferContract" } ], "ref_block_bytes": "e125", "ref_block_hash": "f07be41bafac0989", "expiration": 1680601235964, "timestamp": 1680601055964 }, "raw_data_hex": "0a02e1252208f07be41bafac098940fc838fddf4305a68080112640a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412330a1541c0629df9ebfc8f5ec92e576c350afa72ef63ae5e12154194b0f036660971a160c434d3a021edbd966f524b1880e1eb1770dc8584ddf430" } ] } ] } ``` --- ### `wallet/getblockbalance` > Retrieves all balance change operations in a block. #### Parameters * `hash` (string; hex; required): a block hash (a hash must belong to a block number specified). * `number` (integer; required): a block number. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/getblockbalance' \ -H 'Content-Type: application/json' \ -d '{ "hash": "0000000002fac947605b4fd36f344e00ab9e79568574b74ac7575419e437956a", "number": 49989959, "visible": true }' ``` --- ### `wallet/gettransactionbyid` > Retrieves transaction information by transaction ID. #### Parameters * `value` (string; hex; required): a transaction ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/gettransactionbyid' \ -H 'Content-Type: application/json' \ -d '{ "value": "309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2" }' ``` --- ### `wallet/gettransactioninfobyid` > Retrieves the transaction fee and block height by transaction ID. #### Parameters * `value` (string; hex; required): a transaction ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/gettransactioninfobyid' \ -H 'Content-Type: application/json' \ -d '{ "value": "309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2" }' ``` --- ### `wallet/gettransactioncountbyblocknum` > Retrieves the number of transactions in a specific block. #### Parameters * `num` (integer; required): block height. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/gettransactioncountbyblocknum' \ -H 'Content-Type: application/json' \ -d '{ "num": 49989959 }' ``` #### Response example ```json { "count": 309 } ``` --- ### `wallet/gettransactioninfobyblocknum` > Retrieves the list of transaction information in a specific block. #### Parameters * `num` (integer; required): block height. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/wallet/gettransactioninfobyblocknum' \ -H 'Content-Type: application/json' \ -d '{ "num": 49989959 }' ``` #### Response example ```json [ { "blockNumber": 49989959, "contractResult": [ "" ], "blockTimeStamp": 1680582663000, "receipt": { "net_usage": 268 }, "id": "1dca7ae3d0fc5b73b5bc3ede1d2eb1b63fc128fce39196088a2198ff83fbc5ed" }, { "blockNumber": 49989959, "contractResult": [ "" ], "blockTimeStamp": 1680582663000, "receipt": { "net_usage": 265 }, "id": "04d86b079842247e14cd0c4648e315b78c861eb91abcaf4e022f88155b73f628" }, { "blockNumber": 49989959, "contractResult": [ "" ], "blockTimeStamp": 1680582663000, "receipt": { "net_usage": 280 }, "id": "a1b550fa6681c4afc90f619a2fa4ca26305b09bc964bef5a833123626e451391" } ] ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/tron/soliditynode-api/ title: TRON — SolidityNode API (1/4) source: docs/rpc-service/chains/chains-api/tron/soliditynode-api.mdx --- # TRON — SolidityNode API (1/4) > API reference for [TRON](/rpc-service/chains/chains-api/tron/). [All methods ->](/rpc-service/chains/chains-api/tron/#methods) > > Part 1 of 4: 1 · [2](/rpc-service/chains/chains-api/tron/soliditynode-api-p2/) · [3](/rpc-service/chains/chains-api/tron/soliditynode-api-p3/) · [4](/rpc-service/chains/chains-api/tron/soliditynode-api-p4/) ## SolidityNode API ### `/walletsolidity/getaccount` > Retrieves account information. #### Parameters * `address` (string; hex; required): a hex-encoded account address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getaccount' \ -H 'Content-Type: application/json' \ -d '{ "address": "41E552F6487585C2B58BC2C9BB4492BC1F17132CD0" }' ``` #### Response example ```json { "account_name": "636363797979636363", "address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0", "asset": [ { "key": "TRX", "value": 1 }, { "key": "DEX", "value": 0 }, { "key": "Kitty", "value": 0 }, { "key": "SEED", "value": 0 }, { "key": "WIN", "value": 0 }, { "key": "Perogies", "value": 0 }, { "key": "TRXTestCoin", "value": 0 } ] } ``` --- ### `walletsolidity/listwitnesses` > Retrieves the list of witnesses. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/listwitnesses' ``` #### Response example ```json { "witnesses": [ { "address": "4100e9fdbd1d24ab56996bd37d76fb7b16dcf62ff1", "voteCount": 1087436, "url": "https://www.tronmacau.com" }, { "address": "41012f81bd368f632fb22b9ddfeb284155f1f04198", "voteCount": 314, "url": "https://firekraken.media" }, { "address": "4101c17562ee5a1ecb60f9ea6e49ef94ec0de99580", "voteCount": 377, "url": "https://tronpad.com" }, { "address": "41021957c4576cbeae8bdf0576248e3e486a4cf3fa", "voteCount": 5, "url": "HTTPS://BEFREE" }, { "address": "41022939a4a06cbc7b384096c1af8657ec435173af", "voteCount": 1399832971, "url": "antinvestmentgroup", "totalProduced": 891304, "totalMissed": 1119, "latestBlockNum": 49885242, "latestSlotNum": 560089475, "isJobs": true }, { "address": "4102a0ed82a9609e7ea9155f00137dc3fce818033f", "voteCount": 98954, "url": "XREGlobal.com" }, { "address": "4102f95b2185f52ac539128b28033998ab01466986", "voteCount": 114, "url": "http://imcash.io" }, { "address": "41037e18c9ca44b2ba35f0bb7d0c075f252a191294", "voteCount": 175114359, "url": "https://trxultra.org", "totalProduced": 1164492, "totalMissed": 19127, "latestBlockNum": 41857315, "latestSlotNum": 552045590 } ] } ``` --- ### `/walletsolidity/getassetissuelist` > Retrieves the list of all tokens. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getassetissuelist' ``` #### Response example ```json { "assetIssue": [ { "owner_address": "414d1ef8673f916debb7e2515a8f3ecaf2611034aa", "name": "53454544", "abbr": "53454544", "total_supply": 100000000000, "trx_num": 1000000, "num": 1, "start_time": 1529987043000, "end_time": 1530342060000, "description": "536573616d657365656420746f6b656e7320666f7220636f6d6d756e697479207265776172647320616e6420534545446765726d696e61746f7220696e766573746d656e74206f6620636f6d6d756e6974792d766f7465642070726f6a656374732e", "url": "687474703a2f2f7777772e736573616d65736565642e6f7267", "id": "1000001" }, { "owner_address": "410b53ce4aa6f0c2f3c849f11f682702ec99622e2e", "name": "545258", "abbr": "545258", "total_supply": 99000000000, "trx_num": 1000000, "num": 1, "start_time": 1529989896000, "end_time": 1537632000000, "description": "74726f6e546f6b656e", "url": "68747470733a2f2f74726f6e2e6e6574776f726b", "id": "1000002" }, { "owner_address": "41d13433f53fdf88820c2e530da7828ce15d6585cb", "name": "49504653", "abbr": "49504653", "total_supply": 100000000000, "trx_num": 1000000, "num": 1, "start_time": 1529990700000, "end_time": 1537632000000, "description": "4950465320636f696e", "url": "687474703a2f2f", "id": "1000003" } ] } ``` --- ### `/walletsolidity/getpaginatedassetissuelist` > Retrieves the list of all tokens by pagination. #### Parameters * `offset` (integer; required): the index of the start token. * `limit` (integer; required): the amount of tokens per page. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getpaginatedassetissuelist' \ -H 'Content-Type: application/json' \ -d '{ "offset": 0, "limit": 10 }' ``` #### Response example ```json { "assetIssue": [ { "owner_address": "416b1171698969a36e5eb2eb6ea7aa9204d5e10cfc", "name": "21212121474f4c44434f494e", "abbr": "474f4c44", "total_supply": 9000000000000000000, "trx_num": 1000000, "num": 1000, "start_time": 1556094180182, "end_time": 1871799840182, "description": "474f4c44", "url": "68747470733a2f2f676f6c64636861696e2e78797a", "id": "1002341" }, { "owner_address": "418f82a73b283c7bf8515fa3cc2c0399d4d593e2e3", "name": "21212121476f6c6453706f7421212121", "abbr": "476f6c64", "total_supply": 99000000000, "frozen_supply": [ { "frozen_amount": 2000000000, "frozen_days": 30 } ], "trx_num": 1000000, "num": 100, "start_time": 1559106000646, "end_time": 1609451940646, "description": "476f6c6453706f7420666f6c6c6f7720746865207072696365206f6620676f6c6420696e2074686520626c6f636b636861696e212121204f776e6572732077696c6c2067657420414753202861476f6c6453706f74292064726f70206d6f6e74686c792e20476f6c6453706f742077696c6c20626520757067726164656420746f206120747263323020696e20323032302e20496e7665737420696e2074686520676f6c64206d61726b657421212120476c6f62616c20476f6c6420547261646572732121", "url": "7777772e676f6c6473706f742e6575", "id": "1002467" }, { "owner_address": "418225f3aa48a2d30643a64410abb1e914dfa0bd2f", "name": "212121363636", "abbr": "363636", "total_supply": 666666666666666666, "frozen_supply": [ { "frozen_amount": 666666666, "frozen_days": 30 } ], "trx_num": 1000000, "num": 666, "start_time": 1558134600062, "end_time": 1589755860062, "description": "46756e6e79", "url": "68747470733a2f7777772e736174616e2e696f", "id": "1002438" } ] } ``` --- ### `/walletsolidity/getassetissuebyname` > Retrieves a token by token name. #### Parameters * `value` (string; hex; required): a token name. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getassetissuebyname' \ -H 'Content-Type: application/json' \ -d '{ "value": "44756354616E" }' ``` --- ### `/walletsolidity/getassetissuelistbyname` > Retrieves the list of tokens by name. #### Parameters * `value` (string; hex; required): a token name. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getassetissuelistbyname' \ -H 'Content-Type: application/json' \ -d '{ "value": "44756354616E" }' ``` --- ### `/walletsolidity/getassetissuebyid` > Retrieves a token by token ID. #### Parameters * `value` (string; required): a token ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getassetissuebyid' \ -H 'Content-Type: application/json' \ -d '{ "value": "1000001" }' ``` #### Response example ```shell { "owner_address": "414d1ef8673f916debb7e2515a8f3ecaf2611034aa", "name": "53454544", "abbr": "53454544", "total_supply": 100000000000, "trx_num": 1000000, "num": 1, "start_time": 1529987043000, "end_time": 1530342060000, "description": "536573616d657365656420746f6b656e7320666f7220636f6d6d756e697479207265776172647320616e6420534545446765726d696e61746f7220696e766573746d656e74206f6620636f6d6d756e6974792d766f7465642070726f6a656374732e", "url": "687474703a2f2f7777772e736573616d65736565642e6f7267", "id": "1000001" } ``` --- ### `/walletsolidity/getnowblock` > Retrieves the latest block information. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getnowblock' ``` #### Response example ```json { "blockID": "0000000002fa7ad50ad1632efffc6f8376488681897834ac17bdf137e961b5f3", "block_header": { "raw_data": { "number": 49969877, "txTrieRoot": "9fb478348a2f48bd15eb5cff7d6b6a3845e7014a444125981e41c761c05c8898", "witness_address": "411761716b76c6a3d885299c366826046c09b08d26", "parentHash": "0000000002fa7ad442c90c1be8ab67467e1940017258cb28496bcafe7bcb1bbd", "version": 27, "timestamp": 1680522399000 }, "witness_signature": "50243f8d127f417f407e1df845c77bdf600d33d155cbcebe82b6b6903b8e74492c1bfabbf7be683ff0a20f9ce22565f9e6fe05c4202bb950e0390d4bbc38f7f301" }, "transactions": [ { "ret": [ { "contractRet": "SUCCESS" } ], "signature": [ "8939604c6e12c894a5c45abca9337121f172281522227b51a78ddeaf3105c6a959378ef0d7541473ae15b28ee6c744525552577cac04d4ec0a48925e69a2f1ca00" ], "txID": "e8a35f80078d8e7f562d7b19c91102388d400029f9454d90d4b638bf6094621e", "raw_data": { "contract": [ { "parameter": { "value": { "data": "a9059cbb000000000000000000000000149e4be8e140208f5640814249406404f475fb1700000000000000000000000000000000000000000000000000000000097a25c0", "owner_address": "41cebabc6a66da33d2135f11207d6ab88b82829813", "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c" }, "type_url": "type.googleapis.com/protocol.TriggerSmartContract" }, "type": "TriggerSmartContract" } ], "ref_block_bytes": "7ac2", "ref_block_hash": "182e27a1484a4f66", "expiration": 1680533174894, "fee_limit": 30000000, "timestamp": 1680522374779 }, "raw_data_hex": "0a027ac22208182e27a1484a4f6640eef4d4bcf4305aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541cebabc6a66da33d2135f11207d6ab88b82829813121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb000000000000000000000000149e4be8e140208f5640814249406404f475fb1700000000000000000000000000000000000000000000000000000000097a25c070fbdcc1b7f43090018087a70e" } ] } ``` --- ### `/walletsolidity/getblockbynum` > Retrieves a block information by block height. #### Parameters * `num` (integer; required): block height. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getblockbynum' \ -H 'Content-Type: application/json' \ -d '{ "num": 49970163 }' ``` #### Response example ```json { "blockID": "0000000002fa7bf3d33e148bbe2b498de606277c331d94432f07e449f76b3772", "block_header": { "raw_data": { "number": 49970163, "txTrieRoot": "cf8aa2f25d944b1f9ed76943447e5f628e583bc857fba96360eb57b00483a2c1", "witness_address": "41beab998551416b02f6721129bb01b51fceceba08", "parentHash": "0000000002fa7bf20d335ed60354f75054deab764811d0f461bb04970fb16318", "version": 27, "timestamp": 1680523263000 }, "witness_signature": "afd69d8ce7fc5418af3b090ee2e47ec57f072403bff6b60f51fa52bd4c27647b6f488a3aeaea140776d7cf35d4bb10570067b3155f069ab67591d6394f91d41000" }, "transactions": [ { "ret": [ { "contractRet": "SUCCESS" } ], "signature": [ "a08d1900639be505601be4d2187957abf8f21c9e650c56e8d863aa3392bdfae646069b56e963dcb4da6c9408103e24a0a517db34c62b7ff8ea30db2eda51c0ef00" ], "txID": "9c22bdf305f1cebc2bebbdfa854ec1cf1bea5dd9e6fd7dca408d871b993f6b10", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 5, "owner_address": "41e6443f26ecd0595895ec12a581e1f5775a6776ae", "to_address": "4179715c1c95034e146ac451363f8aa68a8ccdb462" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, "type": "TransferContract" } ], "ref_block_bytes": "7bdf", "ref_block_hash": "dfaa0a7cf8e86900", "expiration": 1680523317000, "timestamp": 1680523259702 }, "raw_data_hex": "0a027bdf2208dfaa0a7cf8e8690040889efbb7f4305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541e6443f26ecd0595895ec12a581e1f5775a6776ae12154179715c1c95034e146ac451363f8aa68a8ccdb462180570b6def7b7f430" } ] } ``` --- ### `/walletsolidity/gettransactionbyid` > Retrieves transaction information by transaction ID. #### Parameters * `value` (string; required): a transaction ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/gettransactionbyid' \ -H 'Content-Type: application/json' \ -d '{ "value": "041ad82f1aa2628441c4aff5eb6052fb5010d8610dc87927ccc4f66c992373da" }' ``` #### Response example ```json { "ret": [ { "contractRet": "SUCCESS" } ], "signature": [ "2caaa0c1dfd6e6ec87c6a00ade1fb287047737759b0aaba56bc03af7a9204f2b5f3deecbb58b3b8f66fe2fe6a1fc6c9d720ee7827c04bd67f450f4a094a31f2901" ], "txID": "041ad82f1aa2628441c4aff5eb6052fb5010d8610dc87927ccc4f66c992373da", "raw_data": { "contract": [ { "parameter": { "value": { "amount": 5, "owner_address": "415da7530953c34dfe4581d088e1d5bec80b295960", "to_address": "41ea46e0b8c0bf2d8400941188db659b7fb69ab4f4" }, "type_url": "type.googleapis.com/protocol.TransferContract" }, "type": "TransferContract" } ], "ref_block_bytes": "7dab", "ref_block_hash": "3eb7d8144eff0a3f", "expiration": 1680524697000, "timestamp": 1680524638448 }, "raw_data_hex": "0a027dab22083eb7d8144eff0a3f40a8bbcfb8f4305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a15415da7530953c34dfe4581d088e1d5bec80b295960121541ea46e0b8c0bf2d8400941188db659b7fb69ab4f4180570f0f1cbb8f430" } ``` --- ### `/walletsolidity/gettransactioncountbyblocknum` > Retrieves the number of transactions in a specific block. #### Parameters * `num` (integer; required): block height. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/gettransactioncountbyblocknum' \ -H 'Content-Type: application/json' \ -d '{ "num": 49970622 }' ``` #### Response example ```json { "count": 277 } ``` --- ### `/walletsolidity/gettransactioninfobyblocknum` > Retrieves the list of transaction information in a specific block. #### Parameters * `num` (integer; required): block height. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/gettransactioninfobyblocknum' \ -H 'Content-Type: application/json' \ -d '{ "num": 49970749 }' ``` #### Response example ```json [ { "log": [ { "address": "a614f803b6fd780986a42c78ec9c7f77e6ded13c", "data": "00000000000000000000000000000000000000000000000000000000603d7380", "topics": [ "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "000000000000000000000000f49dfc8143deb347b7724aef0e1f5d3c22a0035f", "000000000000000000000000a05367c1538d48e2491ba3094c2e68b2e076284c" ] } ], "blockNumber": 49970749, "contractResult": [ "0000000000000000000000000000000000000000000000000000000000000000" ], "blockTimeStamp": 1680525021000, "receipt": { "result": "SUCCESS", "energy_penalty_total": 17245, "energy_usage": 31895, "energy_usage_total": 31895, "net_usage": 345 }, "id": "578bd80976b42a50468c400fa59d6472295bb740a9d7ce3667616fa40d7f090b", "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c" }, { "blockNumber": 49970749, "contractResult": [ "" ], "blockTimeStamp": 1680525021000, "receipt": { "net_usage": 269 }, "id": "110d40b1ab398933dd0981b6dfffc634c3e7b04b2c2b14c889979f009f5b5c11" } ] ``` --- ### `/walletsolidity/gettransactioninfobyid` > Retrieves the transaction fee and block height by transaction ID. #### Parameters * `value` (string; required): a transaction ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/gettransactioninfobyid' \ -H 'Content-Type: application/json' \ -d '{ "value": "4267b26e1b8ef4d105bc86184df10fbdeafec64964ea18878e61bde8a27481e0" }' ``` #### Response example ```json { "id": "4267b26e1b8ef4d105bc86184df10fbdeafec64964ea18878e61bde8a27481e0", "blockNumber": 49971209, "blockTimeStamp": 1680526401000, "contractResult": [ "" ], "receipt": { "net_usage": 268 } } ``` --- ### `/walletsolidity/getdelegatedresource` > Retrieves the energy delegation information. #### Parameters * `fromAddress` (string; hex; required): a sender address. * `toAddress` (string; hex; required): a receiver address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getdelegatedresource' \ -H 'Content-Type: application/json' \ -d '{ "fromAddress": "41ca6a85e52ddf7ea4b52ead38b479180b2d6347af", "toAddress": "41085ae1e02fae8af2b83a5c4c4d0f6246d3b5821e" }' ``` #### Response example ```json { "delegatedResource": [ { "from": "41ca6a85e52ddf7ea4b52ead38b479180b2d6347af", "to": "41085ae1e02fae8af2b83a5c4c4d0f6246d3b5821e", "frozen_balance_for_energy": 1883000000, "expire_time_for_energy": 1680786519000 } ] } ``` --- ### `/walletsolidity/getdelegatedresourceaccountindex` > Retrieves the energy delegation index by an account. #### Parameters * `value` (string; hex; required): an address. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getdelegatedresourceaccountindex' \ -H 'Content-Type: application/json' \ -d '{ "value": "419844f7600e018fd0d710e2145351d607b3316ce9" }' ``` --- ### `/walletsolidity/getexchangebyid` > Retrieves an exchange pair by exchange pair ID. #### Parameters * `id` (integer; required): an exchange pair ID. #### Request example ```shell curl -X POST 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/getexchangebyid' \ -H 'Content-Type: application/json' \ -d '{ "id": 1 }' ``` #### Response example ```json { "exchange_id": 1, "creator_address": "41f596e85bfd042744f76880979a133da0728679d9", "create_time": 1539673398000, "first_token_id": "31303030353634", "first_token_balance": 5, "second_token_id": "5f", "second_token_balance": 4326459 } ``` --- ### `/walletsolidity/listexchanges` > Retrieves the list of all exchange pairs. #### Parameters None. #### Request example ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/YOUR_ANKR_API_KEY/walletsolidity/listexchanges' ``` #### Response example ```json { "exchanges": [ { "exchange_id": 184, "creator_address": "4165b29b92cb5f33342647c4cc32b6efcb59eb3f45", "create_time": 1615538445000, "first_token_id": "31303033333934", "first_token_balance": 100000000000000, "second_token_id": "31303032393232", "second_token_balance": 1341470000000 }, { "exchange_id": 183, "creator_address": "41f55075d3c88b65d65e0f4cb19881182adce446b8", "create_time": 1602234009000, "first_token_id": "31303032373537", "second_token_id": "5f" }, { "exchange_id": 182, "creator_address": "41d4af469119bab46909222e77e277c655f0de9054", "create_time": 1600277286000, "first_token_id": "31303033333031", "first_token_balance": 115545377, "second_token_id": "31303032303030", "second_token_balance": 86546095 }, { "exchange_id": 181, "creator_address": "41d4af469119bab46909222e77e277c655f0de9054", "create_time": 1600208667000, "first_token_id": "5f", "first_token_balance": 37777779, "second_token_id": "31303033333031", "second_token_balance": 66176472 } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xai/ title: Xai description: Xai operates as an Arbitrum Orbit chain, harnessing Anytrust technology to achieve maximum speed and minimal… 27 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/xai/index.mdx --- # Xai
> Xai API is available on [Web3 API platform](https://www.ankr.com/rpc/xai). *Xai* operates as an Arbitrum Orbit chain, harnessing Anytrust technology to achieve maximum speed and minimal costs. Unlike most Orbit chains that are "self-managed," Xai benefits from direct technical support courtesy of Offchain Labs. This support is not available to other orbit chains and is a crucial component of Xai as a strategic gaming initiative within the Arbitrum ecosystem. In order for your Web3 application to interact with Xai — either by reading blockchain data or sending transactions to the network — it must connect to a Xai node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/xai/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/xai/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/xai/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/xai/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/xai/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/xai/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/xai/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/xai/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/xai/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/xai/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/xai/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/xai/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/xai/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/xai/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/xai/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/xai/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/xai/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/xai/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/xai/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xai/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/xai/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/xai/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/xai/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/xai/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/xai/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/xai/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/xai/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/xai/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/xai/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/xai/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/xai/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/xai/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/xai/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/xai/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/xai/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/xai/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/xai/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/xai/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xai/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/xai/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/xai/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xai/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/xai/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xai/web3-p2/ title: Xai — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/xai/web3-p2.mdx --- # Xai — web3, net, eth (2/3) > API reference for [Xai](/rpc-service/chains/chains-api/xai/). [All methods ->](/rpc-service/chains/chains-api/xai/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/xai/web3/) · 2 · [3](/rpc-service/chains/chains-api/xai/web3-p3/) ## `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
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": null, "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x53c9" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xcf4d0158f20872ec5851fbe1676019f7d630d25ed7a09f9b020b98bd6ab20186", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5f5e100", "difficulty": "0x1", "extraData": "0xaa55d4025e441de59a39d7d3d2dac5fd5ac8938cbcb07f24339796db5682a8e1", "gasLimit": "0x4000000000000", "gasUsed": "0xd0a6", "hash": "0xcf4d0158f20872ec5851fbe1676019f7d630d25ed7a09f9b020b98bd6ab20186", "l1BlockNumber": "0x12b29aa", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000080000000000000000000100000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xa4b000000000000000000073657175656e636572", "mixHash": "0x000000000000038600000000012b29aa000000000000000b0000000000000000", "nonce": "0x00000000000039a4", "number": "0x3ff718", "parentHash": "0xc640a3a8b946f08965e7c125aec457cd7e2905527f5b59819e249b96e753d874", "receiptsRoot": "0xeb2f05e73fa4889bf6e2e753f574e10d7fc71e606be490cbf7a545b85105c9f1", "sendCount": "0x386", "sendRoot": "0xaa55d4025e441de59a39d7d3d2dac5fd5ac8938cbcb07f24339796db5682a8e1", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x44d", "stateRoot": "0x1580f815e9aa77771024bf93cc3db9439033220c86e8fa3aed354c6063d68ee1", "timestamp": "0x6612f583", "totalDifficulty": "0x3ff719", "transactions": [ "0x0a351df10b5e28c21a5f78946530d2bac586fece6def1b294a2e35f17f0244b4", "0xaa0026df8df2b26fe27ceb40fa69311b7fed829f587bbd4076a7897336a19d9d" ], "transactionsRoot": "0x7e1457eafc48baccccf063835c9df250cd9e215b89718d669eb70374406c1585", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x400058", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5f5e100", "difficulty": "0x1", "extraData": "0xaa55d4025e441de59a39d7d3d2dac5fd5ac8938cbcb07f24339796db5682a8e1", "gasLimit": "0x4000000000000", "gasUsed": "0xd0a4", "hash": "0x5378dc646fd7bdb48b9032252b1206e0112815356a1b7287bfbbe8e78c860c11", "l1BlockNumber": "0x12b2a82", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000080000000000000000000100000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xa4b000000000000000000073657175656e636572", "mixHash": "0x000000000000038600000000012b2a82000000000000000b0000000000000000", "nonce": "0x00000000000039a7", "number": "0x400058", "parentHash": "0x702dc9f21f76d1bd96929dea907edd4768de77113d1838d7acb7521a499a125e", "receiptsRoot": "0x94c3c053e7e7f1f0888957d9c9a7c4236962a1f4c5c2a8440aea7204d8fe010e", "sendCount": "0x386", "sendRoot": "0xaa55d4025e441de59a39d7d3d2dac5fd5ac8938cbcb07f24339796db5682a8e1", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x44d", "stateRoot": "0xa07443c552f914c72817d4a130916ba3aa4d3791299420748b92ffd32c026565", "timestamp": "0x6612ffd4", "totalDifficulty": "0x400059", "transactions": [ "0x14280c773783b86df783663b640fd83d257fd63ac9e991b9739feb8c33055609", "0xeaf34ebcca662f529bcdcee3e4f4f6cd91a3d471b88f9dab0818a3e5d0599256" ], "transactionsRoot": "0x78417b25cdf0f498f759bb4eeaf5cc8b2f28aab02daa2d2cfe973852db813290", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xa98bf9be2a7f8f88ee46f738d3f27f5f50cde686322616c461e9300cc909ad22"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4633726357538ef4d0840a589e7dc7207702e65f7ebd855a7ce0fbb332693bb5", "blockNumber": "0x5f2338", "from": "0x3bdcdb2610d2f2d4f8e7bf71c830cb8493216e6b", "gas": "0x26370", "gasPrice": "0x5f5e100", "maxFeePerGas": "0xbebc200", "maxPriorityFeePerGas": "0x0", "hash": "0xa98bf9be2a7f8f88ee46f738d3f27f5f50cde686322616c461e9300cc909ad22", "input": "0x3804df03000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000cc42023103307866663063636633393561343862643363366139396639346135346330666234383039336431623934033078383835363866326162326239356338653538653162383539626365623736323563653663613831663663653535346431313735363936393432386330383062373363363262316636356434353639373338613036623735353038616632306263373030336330343938323930323538613633353166316137656533346535313331620340667c3530307c35303003313731353836383730333637330000000000000000000000000000000000000000", "nonce": "0x255c0b", "to": "0xf7cd914bd083ba44025300911be54b2db670f41d", "transactionIndex": "0x1", "value": "0x2540be400", "type": "0x2", "accessList": [], "chainId": "0xa1337", "v": "0x0", "r": "0x64b1459cef2b064f66f739ae05dc4976e3e391216932b9bcfe9781c141e1c2e6", "s": "0x6289d05793846a80ede6eaa17403b6309610bb8432df587b25db96d21f76fa8e", "yParity": "0x0" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xcf4d0158f20872ec5851fbe1676019f7d630d25ed7a09f9b020b98bd6ab20186", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0xcf4d0158f20872ec5851fbe1676019f7d630d25ed7a09f9b020b98bd6ab20186", "blockNumber": "0x3ff718", "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasPrice": "0x0", "hash": "0x0a351df10b5e28c21a5f78946530d2bac586fece6def1b294a2e35f17f0244b4", "input": "0x6bf6a42d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012b29aa00000000000000000000000000000000000000000000000000000000003ff7180000000000000000000000000000000000000000000000000000000000000002", "nonce": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "transactionIndex": "0x0", "value": "0x0", "type": "0x6a", "chainId": "0xa1337", "v": "0x0", "r": "0x0", "s": "0x0" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x400058", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x5378dc646fd7bdb48b9032252b1206e0112815356a1b7287bfbbe8e78c860c11", "blockNumber": "0x400058", "from": "0x00000000000000000000000000000000000a4b05", "gas": "0x0", "gasPrice": "0x0", "hash": "0x14280c773783b86df783663b640fd83d257fd63ac9e991b9739feb8c33055609", "input": "0x6bf6a42d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012b2a8200000000000000000000000000000000000000000000000000000000004000580000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0", "to": "0x00000000000000000000000000000000000a4b05", "transactionIndex": "0x0", "value": "0x0", "type": "0x6a", "chainId": "0xa1337", "v": "0x0", "r": "0x0", "s": "0x0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xai/web3-p3/ title: Xai — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/xai/web3-p3.mdx --- # Xai — web3, net, eth (3/3) > API reference for [Xai](/rpc-service/chains/chains-api/xai/). [All methods ->](/rpc-service/chains/chains-api/xai/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/xai/web3/) · [2](/rpc-service/chains/chains-api/xai/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xa98bf9be2a7f8f88ee46f738d3f27f5f50cde686322616c461e9300cc909ad22"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x4633726357538ef4d0840a589e7dc7207702e65f7ebd855a7ce0fbb332693bb5", "blockNumber": "0x5f2338", "contractAddress": null, "cumulativeGasUsed": "0x7b3c", "effectiveGasPrice": "0x5f5e100", "from": "0x3bdcdb2610d2f2d4f8e7bf71c830cb8493216e6b", "gasUsed": "0x7b3c", "gasUsedForL1": "0x24", "l1BlockNumber": "0x12f6427", "logs": [ { "address": "0xf7cd914bd083ba44025300911be54b2db670f41d", "topics": [ "0xffa7cf79b6173c04d5ec2b41bce25acc6e48f9cf86349011288bab7da23fc517", "0x0000000000000000000000003bdcdb2610d2f2d4f8e7bf71c830cb8493216e6b" ], "data": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000002540be40000000000000000000000000000000000000000000000000000000000000000cc42023103307866663063636633393561343862643363366139396639346135346330666234383039336431623934033078383835363866326162326239356338653538653162383539626365623736323563653663613831663663653535346431313735363936393432386330383062373363363262316636356434353639373338613036623735353038616632306263373030336330343938323930323538613633353166316137656533346535313331620340667c3530307c35303003313731353836383730333637330000000000000000000000000000000000000000", "blockNumber": "0x5f2338", "transactionHash": "0xa98bf9be2a7f8f88ee46f738d3f27f5f50cde686322616c461e9300cc909ad22", "transactionIndex": "0x1", "blockHash": "0x4633726357538ef4d0840a589e7dc7207702e65f7ebd855a7ce0fbb332693bb5", "logIndex": "0x0", "removed": false } ], "logsBloom": "0x00000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000002000100000000000000000000000000000000000000000000000000800000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000040000000000080000000000000000000000000000000000000", "status": "0x1", "to": "0xf7cd914bd083ba44025300911be54b2db670f41d", "transactionHash": "0xa98bf9be2a7f8f88ee46f738d3f27f5f50cde686322616c461e9300cc909ad22", "transactionIndex": "0x1", "type": "0x2" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x2549ca537e118d5e4adf5192143a5794d9eb5d697d1c908ec19a40b7c2ef15e9", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": null } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{ "fromBlock": "0x4A817C", "toBlock": "0x4A8186", "address": "0x6b175474e89094c44da98b954eedeac495271d0f", "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"] }], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xai/web3/ title: Xai — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/xai/web3.mdx --- # Xai — web3, net, eth (1/3) > API reference for [Xai](/rpc-service/chains/chains-api/xai/). [All methods ->](/rpc-service/chains/chains-api/xai/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/xai/web3-p2/) · [3](/rpc-service/chains/chains-api/xai/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "nitro/v2.3.3-6a1c1a7/linux-amd64/go1.20.14", "id": 1 } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "660279" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5f5e100" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5f20f3" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x261a7acefed3b8e6f3f81d08bf60d1a0c853c3f6", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xab588c5740" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x2f318C334780961FB129D2a6c30D0763d9a5C970", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xA4b000000000000000000073657175656e636572", "0x400058"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xcf4d0158f20872ec5851fbe1676019f7d630d25ed7a09f9b020b98bd6ab20186"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x400058"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xcf4d0158f20872ec5851fbe1676019f7d630d25ed7a09f9b020b98bd6ab20186"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x400058"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x2f318C334780961FB129D2a6c30D0763d9a5C970", "0x400058"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/xai/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_transaction_data"], "id": 1 }' ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/xai/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{ "to": "0x2f318C334780961FB129D2a6c30D0763d9a5C970", "data": "0x70a082310000000000000000000000007cB57B5A97eAbe94205C07890BE4c1D51F80F8a5" }, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xdc/ title: XDC Network description: The XDC Network is a global, open-source, delegated proof of stake consensus network (XDPoS), with near-zero gas… 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/xdc/index.mdx --- # XDC Network
> XDC Network API is available on [Web3 API platform](https://www.ankr.com/rpc/xdc). The *XDC Network* is a global, open-source, delegated proof of stake consensus network (XDPoS), with near-zero gas fees, 2 second block finality, and interoperability with ISO 20022 financial messaging standards. The network’s enterprise-grade architecture is designed to support institutional use in trade finance and asset tokenization. Featuring interoperable smart contracts, 2,000 transactions per second, and Ethereum Virtual Machine compatibility, the XDC Network provides a scalable infrastructure for enterprises and independent community contributors. In order for your Web3 application to interact with XDC Network — either by reading blockchain data or sending transactions to the network — it must connect to an XDC Network node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported
* [`web3_clientVersion`](/rpc-service/chains/chains-api/xdc/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/xdc/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/xdc/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/xdc/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/xdc/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/xdc/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/xdc/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/xdc/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/xdc/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/xdc/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/xdc/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/xdc/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/xdc/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/xdc/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/xdc/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/xdc/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/xdc/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/xdc/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/xdc/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xdc/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/xdc/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/xdc/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/xdc/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/xdc/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/xdc/web3/#net_listening) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/xdc/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/xdc/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/xdc/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/xdc/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/xdc/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/xdc/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/xdc/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/xdc/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/xdc/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/xdc/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/xdc/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/xdc/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/xdc/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/xdc/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_call) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xdc/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/xdc/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/xdc/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xdc/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/xdc/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xdc/web3-p2/ title: XDC Network — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/xdc/web3-p2.mdx --- # XDC Network — web3, net, eth (2/3) > API reference for [XDC Network](/rpc-service/chains/chains-api/xdc/). [All methods ->](/rpc-service/chains/chains-api/xdc/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/xdc/web3/) · 2 · [3](/rpc-service/chains/chains-api/xdc/web3-p3/) ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":"0x6b175474e89094c44da98b954eedeac495271d0f","to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x3f0e87cc7aaa2237cd0604efa2628524ccb157deb73711217e1a633a2fdc663f", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x69", "extraData": "0xd8830104068358444389676f312e31342e3135856c696e757800000000000000ad06ff351f6abcc105f13d35fd94057c9c2008999d33e040a85c7b3a70d0e630003f3b3b4546dfc7bc9b4f8038586834d5b9e19da23c95a1495684253866b4c700", "gasLimit": "0x1908b100", "gasUsed": "0x110af1", "hash": "0x3f0e87cc7aaa2237cd0604efa2628524ccb157deb73711217e1a633a2fdc663f", "logsBloom": "0x01000000000000002000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000004000000000000000000000000080000000000000000000000004000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000400000000000000000000002000000000000000002000000000000000800000000000000000000000000000000000000004000000000000000000000000000000000000000000000040000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x3f728d8", "parentHash": "0x8efa1c9612fdd3cc1c667cf11ea7f2c37164612473ce78a6115e0e5f5911c42e", "penalties": "0x", "receiptsRoot": "0x5affc94f43e8d5a831a6518c315b71d769deb57cf7c4399142c33e938f81fd76", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x6195", "stateRoot": "0xe83b52b00aaf7354cda48f7916ab25418789d3c52483f30c1678cac07dc6c159", "timestamp": "0x6526023a", "totalDifficulty": "0x165af526b", "transactions": [ "0xcc29a830157f101ba8f433e260a7b89592568fcc34ba430d140bad685f838976", "0xec78b3f57a258e76fe6deb7a62380a76535bbc939bc2d6858ee3660664abc483", "0xd4e502073ecbb559349564de1ec28d43d21c7390ca65a8cfeab8e1582494e0d5" ], "transactionsRoot": "0xbb9aed73b5025e83697cd684c3580e05b5a6e551c2c8506842342730fceb0a32", "uncles": [], "validator": "0x72a1b42fd233e392cd684ada430b980468f0acb949902693149a855bf293c8bb56ee6f4f443219f1a89deb24a225d1fe8a04d4252894337c74bba04e805fd97f01", "validators": "0x" } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x69", "extraData": "0xd8830104068358444389676f312e31342e3135856c696e757800000000000000bb5add6de1e34d806d9d3621026a322bb24add21ecbbb96201cad0ca181d5f8530553aca94742293e119e20e6418224dfe4d9bff35a63c4a48b1dfbfc37b4a9e00", "gasLimit": "0x1908b100", "gasUsed": "0x12342e", "hash": "0x49cbf7dd52a46c0265db6b2336dd25328877ea5f3b06b6d99284f4104df13343", "logsBloom": "0x01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x3f7791f", "parentHash": "0x54ae275305cecdeb41a3f8a8424805b09aa5b43d337a9e6cdfb011f50b3ed0c3", "penalties": "0x", "receiptsRoot": "0xd2c66d08255ceb2a5362147dc75093c68ad917e2d00a00ede8bafe871685605a", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x69f9", "stateRoot": "0x7c032d0af39bcd44c590ab7a8e37f72a4ab03e3577d04c80c5d924d6f577f803", "timestamp": "0x6526a74f", "totalDifficulty": "0x165d04646", "transactions": [ "0x7964dcae3fe130a6ac9714a65c7965af1e48673230ce1788323978a22590df47", "0x64444edbd611a4f5494039f55a202607801813ac371a8b1b695fc737b3ba5a76", "0x2d035cc42fcfa857068596e18e439ed2173af5cb30ff3a1999c9efb91b9e7d3f" ], "transactionsRoot": "0x907b74396468cee06e7401d92b33ce39bc6899e2c1c4e099f8fe4cedcdcb5c34", "uncles": [], "validator": "0xc1e12fb19456c03183fd055d5a4517f10c321bd8e786494f3dcf469933fb5e6765a698b75f3073bbcf82a758f53ac32d9c9688a008fc82bf25383db9015f865701", "validators": "0x" } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x209450d19777f1b87bf018371de99bdacf12b79c261560162538fde8bea3801d"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x87ba9f6918c9d7fe067052eda66aa01eb7c5bed5298e36ac6a8acbf2dbe0b7a0", "blockNumber": "0x3f728da", "from": "0xfb2115c7868917b1a5d8f5db686da1d030b2ebea", "gas": "0x7a120", "gasPrice": "0x3b9aca00", "hash": "0x209450d19777f1b87bf018371de99bdacf12b79c261560162538fde8bea3801d", "input": "0x9e281a980000000000000000000000008a3cc832bb6b255622e92dc9d4611f2a94d200da0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x253", "to": "0x6fe764b38ebb585654836321e863b4fd22764307", "transactionIndex": "0x1", "value": "0x0", "v": "0x88", "r": "0x808bc5ce03f0c7c03dc9cebd24ecd14b14233e07ffc17ca800607a32f4ff19ee", "s": "0x4c3b1778a7ebb00b2b4141c3101b6cc963d84e8fb3218a70e93531478ff46091" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x87ba9f6918c9d7fe067052eda66aa01eb7c5bed5298e36ac6a8acbf2dbe0b7a0", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x87ba9f6918c9d7fe067052eda66aa01eb7c5bed5298e36ac6a8acbf2dbe0b7a0", "blockNumber": "0x3f728da", "from": "0xf3b713d68e4f8eb8e717753bb1e3c3c994111111", "gas": "0x2faf080", "gasPrice": "0xee6b280", "hash": "0x390d7efd80223a491164ef2e5c177dd10ae02728c90be7cbfa16867e2e6db582", "input": "0x6c697c11000000...", "nonce": "0xc6cc9", "to": "0x6fe764b38ebb585654836321e863b4fd22764307", "transactionIndex": "0x2", "value": "0x0", "v": "0x88", "r": "0xafb872c72eb23e7f78d2912ea47dba57250304f3a9f9576d8dd77be5305ab529", "s": "0x2d8f1462d92ebd54c46a6a9e9c3b57706b969e1759840c09e260a96b88124458" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns
* `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x403380f8c7e67da813167dfc5404313bc229bb38898d187692c7d62c7055ffed", "blockNumber": "0x3f77980", "from": "0x4cf46a2bd39133c8ca1e41bd4548eb3a07000000", "gas": "0x2faf080", "gasPrice": "0xee6b280", "hash": "0xdf64a8231f75ec2d12d08e2979891ee2f67329823dc623ca5eaf5d368a182b54", "input": "0x6c697c11000000000000000000000000951857744785e80e2de051c32ee7b25f9c458c420...", "nonce": "0x1f604", "to": "0x6fe764b38ebb585654836321e863b4fd22764307", "transactionIndex": "0x2", "value": "0x0", "v": "0x87", "r": "0x6feaafdedb2bfb3eb89b2c8622e6d11ee09b9c4be877fd4f77b077439e8a34d6", "s": "0x43cd96d219973d9e098654c8b5e20cdcb6a08a84eeb5f9cc21a7c5acce452e9f" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xdc/web3-p3/ title: XDC Network — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/xdc/web3-p3.mdx --- # XDC Network — web3, net, eth (3/3) > API reference for [XDC Network](/rpc-service/chains/chains-api/xdc/). [All methods ->](/rpc-service/chains/chains-api/xdc/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/xdc/web3/) · [2](/rpc-service/chains/chains-api/xdc/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns
* `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x209450d19777f1b87bf018371de99bdacf12b79c261560162538fde8bea3801d"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x87ba9f6918c9d7fe067052eda66aa01eb7c5bed5298e36ac6a8acbf2dbe0b7a0", "blockNumber": "0x3f728da", "contractAddress": null, "cumulativeGasUsed": "0x66aa", "from": "0xfb2115c7868917b1a5d8f5db686da1d030b2ebea", "gasUsed": "0x66aa", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0x6fe764b38ebb585654836321e863b4fd22764307", "transactionHash": "0x209450d19777f1b87bf018371de99bdacf12b79c261560162538fde8bea3801d", "transactionIndex": "0x1" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x87ba9f6918c9d7fe067052eda66aa01eb7c5bed5298e36ac6a8acbf2dbe0b7a0", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the uncle's index position. ### Returns
* ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns
* `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "xdc6fE764b38EbB585654836321e863b4fD22764307"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xdc/web3/ title: XDC Network — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/xdc/web3.mdx --- # XDC Network — web3, net, eth (1/3) > API reference for [XDC Network](/rpc-service/chains/chains-api/xdc/). [All methods ->](/rpc-service/chains/chains-api/xdc/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/xdc/web3-p2/) · [3](/rpc-service/chains/chains-api/xdc/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "XDC/v1.4.6-stable/linux-amd64/go1.14.15" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "50" } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": true } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x3f", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xee6b280" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns
* `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3f76e18" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["xdc4Cf46A2bD39133C8cA1E41bd4548EB3A07000000", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1e4b477832345fed00" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["xdcb9a3a97F6A02a86483bf02cB33F8B33d2D117708", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["xdcb9a3a97F6A02a86483bf02cB33F8B33d2D117708", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3543bd" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x9e189854f75ecfba5a19aecd147715fc5936ad84e9f5b58316066611bd462cee"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5c" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x3F77780"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5c" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x9e189854f75ecfba5a19aecd147715fc5936ad84e9f5b58316066611bd462cee"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0x3F77780"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns
* `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["xdcF3B713D68e4f8Eb8E717753bb1e3c3c994111111", "0x2"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns
* `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/xdc/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/xdc/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xlayer/ title: X Layer description: X Layer is a decentralized Ethereum Layer 2 network that offers a secure and user-friendly blockchain experience… 27 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/xlayer/index.mdx --- # X Layer > X Layer API is available on [Web3 API platform](https://www.ankr.com/rpc/xlayer/). *X Layer* is a decentralized Ethereum Layer 2 network that offers a secure and user-friendly blockchain experience to all users, using advanced cryptographic zero-knowledge proofs to provide validity and near-instant finality to off-chain transaction computations. In order for your Web3 application to interact with X Layer — either by reading blockchain data or sending transactions to the network — it must connect to a X Layer node. Developers interact with the blockchain using the methods provided by the API. ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/xlayer/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/xlayer/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/xlayer/web3/#net_version) — returns the current network ID. * [`eth_protocolVersion`](/rpc-service/chains/chains-api/kava/methods/#eth_protocolversion) — returns the current protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/xlayer/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/xlayer/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_blockNumber`](/rpc-service/chains/chains-api/xlayer/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/xlayer/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/xlayer/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/xlayer/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/xlayer/web3-p3/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/xlayer/web3-p3/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xlayer/web3-p3/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. * [`eth_getLogs`](/rpc-service/chains/chains-api/xlayer/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/xlayer/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/xlayer/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/xlayer/web3/#net_version) - [`eth_protocolVersion`](/rpc-service/chains/chains-api/xlayer/web3/#eth_protocolversion) - [`eth_syncing`](/rpc-service/chains/chains-api/xlayer/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/xlayer/web3/#eth_gasprice) - [`eth_blockNumber`](/rpc-service/chains/chains-api/xlayer/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/xlayer/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/xlayer/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/xlayer/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/xlayer/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xlayer/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/xlayer/web3-p3/#eth_gettransactionreceipt) - [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/xlayer/web3-p3/#eth_getunclebyblockhashandindex) - [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xlayer/web3-p3/#eth_getunclebyblocknumberandindex) - [`eth_getLogs`](/rpc-service/chains/chains-api/xlayer/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xlayer/web3-p2/ title: X Layer — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/xlayer/web3-p2.mdx --- # X Layer — web3, net, eth (2/3) > API reference for [X Layer](/rpc-service/chains/chains-api/xlayer/). [All methods ->](/rpc-service/chains/chains-api/xlayer/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/xlayer/web3/) · 2 · [3](/rpc-service/chains/chains-api/xlayer/web3-p3/) ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0xe4D6Ad015e1b200Dc7cbbB41613Cb9a38F0495f0"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xbf6fa9adaaf1713bc7fc1ace2c6296488421c9b7c59b8ec921307c321271eab4", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "parentHash": "0xf0e490916877f17097e172c06fa9fa34e6f18d4f2caae07524d4c5c54ed37ad5", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0x5e7b89ab3b2de21f0f35da4920b9d7310ccbe259", "stateRoot": "0x3d522fc5b9b8b9a1a0030945a8b16acc32bf6ab8336d32c825c03809a701438a", "transactionsRoot": "0xc6553bc0708f12ad4005ca0b51fe014edb6092c1697054282129f985117d980e", "receiptsRoot": "0x330d424403ff29fb401fb9cfb602934c904341de77c60660621c23ec336ac3a1", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "difficulty": "0x0", "totalDifficulty": "0x0", "size": "0x275", "number": "0x4a04e", "gasLimit": "0x1c9c380", "gasUsed": "0x5208", "timestamp": "0x655c6340", "extraData": "0x", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "hash": "0xbf6fa9adaaf1713bc7fc1ace2c6296488421c9b7c59b8ec921307c321271eab4", "transactions": [ "0xe823e9625a528f71683206890fba3f458500ed484666fd6081aad6cc216785b6" ], "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "parentHash": "0x75f161ff10756f007ff1492f9f04f8b9abf22d10e98163f86679d22da907a187", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "miner": "0xd6dda5aa7749142b7fda3fe4662c9f346101b8a6", "stateRoot": "0x2ba34a4bb0f07ebe752d2d6e56e195446a8d36f3e4386a474e726e8e46f5ddbd", "transactionsRoot": "0xbc22d9ff83bd15db0cea823a62385b2f4764021deb0adb0aa1b472ce126883d0", "receiptsRoot": "0x460c9add647519380c76ebf72b2f7239d2916de30fba67453c2a5af9dcf191db", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "difficulty": "0x0", "totalDifficulty": "0x0", "size": "0x2af", "number": "0xa11873", "gasLimit": "0x1c9c380", "gasUsed": "0x56df", "timestamp": "0x65d88a41", "extraData": "0x", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "hash": "0xb740fe5320fcb1ff7364645f393276932f58d51fd81d90e96977e6b5edd73f5e", "transactions": [ "0xc7f144c0bba8bdad352cfe5ac586ef3d33f9678529001f64741f824cfed75bd2" ], "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x2cc965dfd19c2d4c91ee32435f288dea4bf8a0c4e25bf9efc4dfd8014e40000e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "nonce": "0x2", "gasPrice": "0x1f4153d80", "gas": "0x5208", "to": "0xe4d6ad015e1b200dc7cbbb41613cb9a38f0495f0", "value": "0x811931561ddb2bfd3400", "input": "0x", "v": "0x1aa", "r": "0x5370b6c7e7055a56c78c7f654a10e85a0abf2e49d40c4d63c3c16439a31151da", "s": "0x515b336303ca184486f6b17ecc94cbaeed29733040cfee1f948195805fcaa54e", "hash": "0x2cc965dfd19c2d4c91ee32435f288dea4bf8a0c4e25bf9efc4dfd8014e40000e", "from": "0xf5c039e13be4541ee76e6a65a364e898cac230db", "blockHash": "0x5244f5e2f1e0fa5d2befec92a028e06581973618dad8a201c6f791c00ddafd2d", "blockNumber": "0x47b92", "transactionIndex": "0x0", "chainId": "0xc3", "type": "0x0" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x5244f5e2f1e0fa5d2befec92a028e06581973618dad8a201c6f791c00ddafd2d", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "nonce": "0x2", "gasPrice": "0x1f4153d80", "gas": "0x5208", "to": "0xe4d6ad015e1b200dc7cbbb41613cb9a38f0495f0", "value": "0x811931561ddb2bfd3400", "input": "0x", "v": "0x1aa", "r": "0x5370b6c7e7055a56c78c7f654a10e85a0abf2e49d40c4d63c3c16439a31151da", "s": "0x515b336303ca184486f6b17ecc94cbaeed29733040cfee1f948195805fcaa54e", "hash": "0x2cc965dfd19c2d4c91ee32435f288dea4bf8a0c4e25bf9efc4dfd8014e40000e", "from": "0xf5c039e13be4541ee76e6a65a364e898cac230db", "blockHash": "0x5244f5e2f1e0fa5d2befec92a028e06581973618dad8a201c6f791c00ddafd2d", "blockNumber": "0x47b92", "transactionIndex": "0x0", "chainId": "0xc3", "type": "0x0" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x47B92", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "nonce": "0x2", "gasPrice": "0x1f4153d80", "gas": "0x5208", "to": "0xe4d6ad015e1b200dc7cbbb41613cb9a38f0495f0", "value": "0x811931561ddb2bfd3400", "input": "0x", "v": "0x1aa", "r": "0x5370b6c7e7055a56c78c7f654a10e85a0abf2e49d40c4d63c3c16439a31151da", "s": "0x515b336303ca184486f6b17ecc94cbaeed29733040cfee1f948195805fcaa54e", "hash": "0x2cc965dfd19c2d4c91ee32435f288dea4bf8a0c4e25bf9efc4dfd8014e40000e", "from": "0xf5c039e13be4541ee76e6a65a364e898cac230db", "blockHash": "0x5244f5e2f1e0fa5d2befec92a028e06581973618dad8a201c6f791c00ddafd2d", "blockNumber": "0x47b92", "transactionIndex": "0x0", "chainId": "0xc3", "type": "0x0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xlayer/web3-p3/ title: X Layer — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/xlayer/web3-p3.mdx --- # X Layer — web3, net, eth (3/3) > API reference for [X Layer](/rpc-service/chains/chains-api/xlayer/). [All methods ->](/rpc-service/chains/chains-api/xlayer/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/xlayer/web3/) · [2](/rpc-service/chains/chains-api/xlayer/web3-p2/) · 3 ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x2cc965dfd19c2d4c91ee32435f288dea4bf8a0c4e25bf9efc4dfd8014e40000e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "root": "0x3b22762bddfb57cab53fb31809172d24cff63bc65b1685f6cb285e0feb644348", "cumulativeGasUsed": "0x5208", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "logs": [], "status": "0x1", "transactionHash": "0x2cc965dfd19c2d4c91ee32435f288dea4bf8a0c4e25bf9efc4dfd8014e40000e", "transactionIndex": "0x0", "blockHash": "0x5244f5e2f1e0fa5d2befec92a028e06581973618dad8a201c6f791c00ddafd2d", "blockNumber": "0x47b92", "gasUsed": "0x5208", "from": "0xf5c039e13be4541ee76e6a65a364e898cac230db", "to": "0xe4d6ad015e1b200dc7cbbb41613cb9a38f0495f0", "contractAddress": null, "type": "0x0", "effectiveGasPrice": "0x1f4153d80" } } ``` --- ## `eth_getUncleByBlockHashAndIndex` > Returns information about an uncle of a block by hash and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the hash of a block. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x5244f5e2f1e0fa5d2befec92a028e06581973618dad8a201c6f791c00ddafd2d", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x4ea3f27bc", "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171", "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843", "nonce": "0x689056015818adbe", "number": "0x1b4", "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x220", "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d", "timestamp": "0x55ba467c", "totalDifficulty": "0x78ed983323d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getUncleByBlockNumberAndIndex` > Returns information about an uncle of a block by number and uncle index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): the hex value of a _block number_. 2. `` (quantity): the uncle's index position. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": ["0xC2DB7", "0x0"], "id": 1 }' ``` ### Response example ```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": "0xc46826a2c6a", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x22Fa33E4116A80F865f2646A2101c052Ac89b8BE"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xlayer/web3/ title: X Layer — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/xlayer/web3.mdx --- # X Layer — web3, net, eth (1/3) > API reference for [X Layer](/rpc-service/chains/chains-api/xlayer/). [All methods ->](/rpc-service/chains/chains-api/xlayer/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/xlayer/web3-p2/) · [3](/rpc-service/chains/chains-api/xlayer/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "v0.2.6-RC3-28-g91c6491a" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns * `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "195" } ``` --- ## `eth_protocolVersion` > Returns the current Ethereum protocol version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``: the current Ethereum protocol version. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0x0", "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x22739480" } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): None. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xa11647" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xe4D6Ad015e1b200Dc7cbbB41613Cb9a38F0495f0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x128764fd2ed98a54d2e01" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0xe4D6Ad015e1b200Dc7cbbB41613Cb9a38F0495f0", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xe4D6Ad015e1b200Dc7cbbB41613Cb9a38F0495f0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x385" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x46e4772b66e5d2df46fc6f4914a339c2b463d3dcc1635ba0696a0eaf56321ccc"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0xA03D7B"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0xbf6fa9adaaf1713bc7fc1ace2c6296488421c9b7c59b8ec921307c321271eab4"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["0xC2DB7"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x00bbC006A40EeE701D0f9aEbB41C5588a9b22ECc", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/xlayer/web3-p3/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x00bbC006A40EeE701D0f9aEbB41C5588a9b22ECc","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xphere/ title: Xphere description: Xphere is an EVM-compatible Layer-1 with a dual-chain architecture that separates consensus and heavy… 22 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/xphere/index.mdx --- # Xphere
> Xphere API is available on [Web3 API platform](https://www.ankr.com/rpc/xphere). Xphere is an EVM-compatible Layer-1 with a dual-chain architecture that separates consensus and heavy computation for scalability and security. A PBFT-based Main Chain finalizes transactions via a Council/Committee model to cut communication overhead, while a Proof Chain uses SHA-256 Proof-of-Work to select validators and generate cryptographic proofs. The design preserves decentralization, boosts throughput, and stays developer-friendly with Ethereum tooling. In order for your Web3 application to interact with Xphere — either by reading blockchain data or sending transactions to the network — it must connect to an Xphere node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. ## EVM JSON-RPC methods * [`web3_clientVersion`](/rpc-service/chains/chains-api/xphere/web3/#web3_clientversion) — returns the current client version. * [`web3_sha3`](/rpc-service/chains/chains-api/xphere/web3/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. * [`net_version`](/rpc-service/chains/chains-api/xphere/web3/#net_version) — returns the current network ID. * [`eth_syncing`](/rpc-service/chains/chains-api/xphere/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/xphere/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_blockNumber`](/rpc-service/chains/chains-api/xphere/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/xphere/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/xphere/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/xphere/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/xphere/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/xphere/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getCode`](/rpc-service/chains/chains-api/xphere/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/xphere/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/xphere/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/xphere/web3/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getLogs`](/rpc-service/chains/chains-api/xphere/web3-p3/#eth_getlogs) — returns logs matching the parameters specified. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/xphere/web3/#web3_clientversion) - [`web3_sha3`](/rpc-service/chains/chains-api/xphere/web3/#web3_sha3) - [`net_version`](/rpc-service/chains/chains-api/xphere/web3/#net_version) - [`eth_syncing`](/rpc-service/chains/chains-api/xphere/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/xphere/web3/#eth_gasprice) - [`eth_blockNumber`](/rpc-service/chains/chains-api/xphere/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/xphere/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/xphere/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/xphere/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/xphere/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/xphere/web3/#eth_getblocktransactioncountbynumber) - [`eth_getCode`](/rpc-service/chains/chains-api/xphere/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/xphere/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/xphere/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/xphere/web3/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_gettransactionbyblocknumberandindex) - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_gettransactionreceipt) - [`eth_getLogs`](/rpc-service/chains/chains-api/xphere/web3-p3/#eth_getlogs) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xphere/web3-p2/ title: Xphere — web3, net, eth (2/3) source: docs/rpc-service/chains/chains-api/xphere/web3-p2.mdx --- # Xphere — web3, net, eth (2/3) > API reference for [Xphere](/rpc-service/chains/chains-api/xphere/). [All methods ->](/rpc-service/chains/chains-api/xphere/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/xphere/web3/) · 2 · [3](/rpc-service/chains/chains-api/xphere/web3-p3/) ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x6413d13ea1b4d4e893b94f709352b619da472381064667d1b66c13dbeee9c194", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "baseFeePerGas": "0x5d21dba00", "difficulty": "0x1", "extraData": "0x", "gasLimit": "0xe8d4a50fff", "gasUsed": "0x5208", "hash": "0x6413d13ea1b4d4e893b94f709352b619da472381064667d1b66c13dbeee9c194", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x2c7691e5b367b69adabb4b355c41a0367ff0e046", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0xf25158", "parentHash": "0x63af8085cd2c47d2939912032f72711ba1fa34f7fd91f279fdc45c24acadd432", "proposer": "0x17d525d6437014abf62df0695338b46b3a0ce137", "receiptsRoot": "0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x818", "stateRoot": "0x572b4572e99691930895dec0fe102d659b86907e9e91e34f1fa5339203ccc641", "timestamp": "0x68b006a5", "totalDifficulty": "0xf25159", "transactions": [ "0x426c8714611a6c4492816bc0e17eb584034269b667fe9681e93973abc47ad53e" ], "transactionsRoot": "0xb3afa8423cfe188107965af767732f49c638dc68cb8b59ac7ce4ee503af7db0f", "uncles": [] } } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0xF25158", false], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "baseFeePerGas": "0x5d21dba00", "difficulty": "0x1", "extraData": "0x", "gasLimit": "0xe8d4a50fff", "gasUsed": "0x5208", "hash": "0x6413d13ea1b4d4e893b94f709352b619da472381064667d1b66c13dbeee9c194", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x2c7691e5b367b69adabb4b355c41a0367ff0e046", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0xf25158", "parentHash": "0x63af8085cd2c47d2939912032f72711ba1fa34f7fd91f279fdc45c24acadd432", "proposer": "0x17d525d6437014abf62df0695338b46b3a0ce137", "receiptsRoot": "0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x818", "stateRoot": "0x572b4572e99691930895dec0fe102d659b86907e9e91e34f1fa5339203ccc641", "timestamp": "0x68b006a5", "totalDifficulty": "0xf25159", "transactions": [ "0x426c8714611a6c4492816bc0e17eb584034269b667fe9681e93973abc47ad53e" ], "transactionsRoot": "0xb3afa8423cfe188107965af767732f49c638dc68cb8b59ac7ce4ee503af7db0f", "uncles": [] } } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x55ed3824020c485682032c76e336e1b404ee75d6808c9e05c7a288d6f4608f02"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x3dcac91f3f5d8efae67678ae98ce5f4f353b59051bb41f79d187685a1ca94232", "blockNumber": "0x1174632", "from": "0xf31177119a1b4a6b0a393d1a091d664e1b7ada27", "gas": "0x27100", "gasPrice": "0xef3bc5c300", "hash": "0x55ed3824020c485682032c76e336e1b404ee75d6808c9e05c7a288d6f4608f02", "input": "0x", "nonce": "0x710", "to": "0xa43c9a6014560ac6123f728da489aacddc261248", "transactionIndex": "0x0", "value": "0x2376ace13750dac0000", "type": "0x0", "v": "0x269fcf6", "r": "0x3e94799f02cb2bc23c08ca865bc97aaff4019278e81327d63d7f10d076df9835", "s": "0x57c06bc4db81f347c2b5a611753e2670715d52e2307f314c543ca1248b670aa1" } } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ "0x7c07a5572586ffbe47b2f1b550da010ab43d778d9a07a64e8ab614a9f37fcc09", "0x0" ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x7c07a5572586ffbe47b2f1b550da010ab43d778d9a07a64e8ab614a9f37fcc09", "blockNumber": "0x10c55e9", "from": "0x12f93a0a77d7a3ccfdb766733c5d33a341fe29a5", "gas": "0x5208", "gasPrice": "0x66720b300", "hash": "0x199c03187b6c5806ca2c710080e10b3a01f1bcb77ea572a7ccac0ca18b0c9b2e", "input": "0x", "nonce": "0x3353", "to": "0xa43c9a6014560ac6123f728da489aacddc261248", "transactionIndex": "0x0", "value": "0x3ee23bde0e7d200000", "type": "0x0", "v": "0x269fcf6", "r": "0x7025ebd2001a7dafba413071ac53992082bde32ba568248ade372c11a6f881c5", "s": "0x49f3ba56c81a23096121aeb100f2bf66e0b33a00013378465b566096734582fd" } } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x10C55E9", "0x0"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "blockHash": "0x7c07a5572586ffbe47b2f1b550da010ab43d778d9a07a64e8ab614a9f37fcc09", "blockNumber": "0x10c55e9", "from": "0x12f93a0a77d7a3ccfdb766733c5d33a341fe29a5", "gas": "0x5208", "gasPrice": "0x66720b300", "hash": "0x199c03187b6c5806ca2c710080e10b3a01f1bcb77ea572a7ccac0ca18b0c9b2e", "input": "0x", "nonce": "0x3353", "to": "0xa43c9a6014560ac6123f728da489aacddc261248", "transactionIndex": "0x0", "value": "0x3ee23bde0e7d200000", "type": "0x0", "v": "0x269fcf6", "r": "0x7025ebd2001a7dafba413071ac53992082bde32ba568248ade372c11a6f881c5", "s": "0x49f3ba56c81a23096121aeb100f2bf66e0b33a00013378465b566096734582fd" } } ``` --- ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x199c03187b6c5806ca2c710080e10b3a01f1bcb77ea572a7ccac0ca18b0c9b2e"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockHash": "0x7c07a5572586ffbe47b2f1b550da010ab43d778d9a07a64e8ab614a9f37fcc09", "blockNumber": "0x10c55e9", "contractAddress": null, "cumulativeGasUsed": "0x5208", "effectiveGasPrice": "0x66720b300", "from": "0x12f93a0a77d7a3ccfdb766733c5d33a341fe29a5", "gasUsed": "0x5208", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": "0x1", "to": "0xa43c9a6014560ac6123f728da489aacddc261248", "transactionHash": "0x199c03187b6c5806ca2c710080e10b3a01f1bcb77ea572a7ccac0ca18b0c9b2e", "transactionIndex": "0x0", "type": "0x0" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xphere/web3-p3/ title: Xphere — web3, net, eth (3/3) source: docs/rpc-service/chains/chains-api/xphere/web3-p3.mdx --- # Xphere — web3, net, eth (3/3) > API reference for [Xphere](/rpc-service/chains/chains-api/xphere/). [All methods ->](/rpc-service/chains/chains-api/xphere/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/xphere/web3/) · [2](/rpc-service/chains/chains-api/xphere/web3-p2/) · 3 ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "fromBlock": "0x13452C2", "toBlock": "0x13452C3" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0x730ad30e0a37c9ef3e38817365cab05fabf6a778", "topics": [ "0xbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972" ], "data": "0x", "blockNumber": "0x13452c2", "transactionHash": "0x7dc46269888ee4049b0ff1a3d096cb9af5261badf4c859a467e6496f2cb709e6", "transactionIndex": "0x0", "blockHash": "0x48e0fdec7ca5114d51781c1daa8f294a24f46eb9def9478959cc8e8e6b9e4242", "logIndex": "0x0", "removed": false }, { "address": "0xd64cd2aff75b156193fcc6dabcb17c4014675497", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x00000000000000000000000010aff64c17bbedb97086c3a13677e1ba42d9a3e8", "0x00000000000000000000000049692095a22385110253cb8f6746b5719cbe0c57" ], "data": "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "blockNumber": "0x13452c2", "transactionHash": "0x7dc46269888ee4049b0ff1a3d096cb9af5261badf4c859a467e6496f2cb709e6", "transactionIndex": "0x0", "blockHash": "0x48e0fdec7ca5114d51781c1daa8f294a24f46eb9def9478959cc8e8e6b9e4242", "logIndex": "0x1", "removed": false }, { "address": "0x68f250db5ac2457f430a32b25ed5ff80abf331cf", "topics": [ "0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31", "0x00000000000000000000000010aff64c17bbedb97086c3a13677e1ba42d9a3e8", "0x00000000000000000000000049692095a22385110253cb8f6746b5719cbe0c57" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", "blockNumber": "0x13452c2", "transactionHash": "0x7dc46269888ee4049b0ff1a3d096cb9af5261badf4c859a467e6496f2cb709e6", "transactionIndex": "0x0", "blockHash": "0x48e0fdec7ca5114d51781c1daa8f294a24f46eb9def9478959cc8e8e6b9e4242", "logIndex": "0x2", "removed": false }, { "address": "0x730ad30e0a37c9ef3e38817365cab05fabf6a778", "topics": [ "0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f", "0xf35488dbc35c63477f2a0ebd34ed3ee474192eae37de17eb66be3c1a300580c8", "0x00000000000000000000000010aff64c17bbedb97086c3a13677e1ba42d9a3e8", "0x00000000000000000000000029f4771750a71716336f8bded6c6064546563e29" ], "data": "0x0000000000000000000000000000000000000199f19935b70000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000004e1693ee73c8000000000000000000000000000000000000000000000000000000000000d19dcc8", "blockNumber": "0x13452c2", "transactionHash": "0x7dc46269888ee4049b0ff1a3d096cb9af5261badf4c859a467e6496f2cb709e6", "transactionIndex": "0x0", "blockHash": "0x48e0fdec7ca5114d51781c1daa8f294a24f46eb9def9478959cc8e8e6b9e4242", "logIndex": "0x3", "removed": false } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xphere/web3/ title: Xphere — web3, net, eth (1/3) source: docs/rpc-service/chains/chains-api/xphere/web3.mdx --- # Xphere — web3, net, eth (1/3) > API reference for [Xphere](/rpc-service/chains/chains-api/xphere/). [All methods ->](/rpc-service/chains/chains-api/xphere/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/xphere/web3-p2/) · [3](/rpc-service/chains/chains-api/xphere/web3-p3/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "Xphere/v0.9.0/linux-amd64/go1.22.12" } ``` --- ## `web3_sha3` > Returns Keccak-256 (not the standardized SHA3-256) of the given data. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (data): the data to convert into a SHA3 hash. ### Returns
* `` (data): the SHA3 result of the given string. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_sha3", "params": ["0x68656c6c6f20776f726c64"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "20250217" } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "Ok": false } } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x66720b300" } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x134612e" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x906D5f92e166c330229294140E366EEcE52e38fC", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x263051bf2a700ef9f1a2c0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x0A02726C17b2aaC299c89d579beCA4D0c9524b4b", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x8" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xb8e8c8c7a6f12189bf26f12226e2b5473b9d2e245de3a1bd20e13651679ca8db"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["0x13453D8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/xphere/web3-p2/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["signed_tx_data"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x0A02726C17b2aaC299c89d579beCA4D0c9524b4b", "data": "0x70a08231000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf9" }, "latest" ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "from": "0xf31177119A1b4a6B0a393D1a091d664e1B7AdA27", "to": "0xA43c9A6014560Ac6123f728DA489AACDDc261248", "data": "0xa9059cbb000000000000000000000000a0df350d2637096571f7a701cb08f08f0775fcf90000000000000000000000000000000000000000000000000000000000000064" } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6c98" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/account-p2/ title: XRP — account (2/3) source: docs/rpc-service/chains/chains-api/xrp/account-p2.mdx --- # XRP — account (2/3) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/xrp/account/) · 2 · [3](/rpc-service/chains/chains-api/xrp/account-p3/) ## `account_lines` > Retrieves info on the account's trust lines. The `account_lines` method returns information about an account's trust lines, which contain balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): look up trust lines connected to this account, from this account’s perspective. * `ignore_default` (boolean; optional): if `true`, omits trust lines where this account’s side is in the default state. Default: `false`. * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): the unique hash of the ledger version to use (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `ledger_index` (number or string; optional): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger version to use, or a shortcut string to choose a ledger automatically (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `limit` (number; optional): limits the number of trust lines to retrieve. Must be between 10 and 400. Values outside this range are adjusted to the nearest valid option. Default: `200`. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): value from a previous paginated response; resumes retrieving data where that response left off. * `peer` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); optional): a second account; if provided, filters results to trust lines connecting the two accounts. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the address of the account and an array of trust line objects. Specifically, the result object contains the following fields: * `account` (string): the unique [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses) of the account this request corresponds to — the perspective account for the listed trust lines. * `lines` (array of objects): array of trust line objects associated with the specified account. If the number of trust lines is large, only returns up to the limit at a time. Each object contains the following fields: * `account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses)): the counterparty to this trust line. * `balance` (string — [number](https://xrpl.org/docs/references/protocol/data-types/currency-formats#string-numbers)): the current balance held on this line. * A positive balance indicates that the perspective account holds value. * A negative balance indicates that the perspective account owes value. * `currency` (string — currency code): the currency code of the token that this trust line represents. * `limit` (string — [number](https://xrpl.org/docs/references/protocol/data-types/currency-formats#string-numbers)): the maximum amount of the given currency that this account is willing to owe the peer account. * `limit_peer` (string — [number](https://xrpl.org/docs/references/protocol/data-types/currency-formats#string-numbers)): the maximum amount of the given currency that the counterparty is willing to owe the perspective account. * `quality_in` (number): rate at which the account values incoming balances on this trust line, as a ratio of this value per 1 billion units. For example, a value of 500 million represents a `0.5:1` ratio. As a special case, 0 is treated as a `1:1` ratio. * `quality_out` (number): rate at which the account values outgoing balances on this trust line, as a ratio of this value per 1 billion units. For example, a value of 500 million represents a `0.5:1` ratio. As a special case, 0 is treated as a `1:1` ratio. * `no_ripple` (boolean; optional): if `true`, this account has enabled the [No Ripple flag](https://xrpl.org/docs/concepts/tokens/fungible-tokens/rippling) for this trust line. If `false`, the flag is disabled, but this is not considered [default](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/ripplestate#contributing-to-the-owner-reserve) when Default Ripple is also disabled. If omitted, No Ripple is disabled and Default Ripple is enabled. * `no_ripple_peer` (boolean; optional): if `true`, the peer account has enabled the [No Ripple flag](https://xrpl.org/docs/concepts/tokens/fungible-tokens/rippling) for this trust line. If `false`, the flag is disabled, but this is not considered [default](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/ripplestate#contributing-to-the-owner-reserve) when Default Ripple is also disabled. If omitted, No Ripple is disabled and Default Ripple is enabled. * `authorized` (boolean; optional): if true, the perspective account [has authorized this trust line](https://xrpl.org/docs/concepts/tokens/fungible-tokens/authorized-trust-lines). Default: `false`. * `peer_authorized` (boolean; optional): if `true`, the counterparty [has authorized this trust line](https://xrpl.org/docs/concepts/tokens/fungible-tokens/authorized-trust-lines). Default: `false`. * `freeze` (boolean; optional): if `true`, the perspective account [has frozen this trust line](https://xrpl.org/docs/concepts/tokens/fungible-tokens/authorized-trust-lines). Default: `false`. * `freeze_peer` (boolean; optional): if `true`, the counterparty [has frozen this trust line](https://xrpl.org/docs/concepts/tokens/fungible-tokens/authorized-trust-lines). Default: `false`. * `ledger_current_index` (integer; optional): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) used when retrieving this data. Present only when using an open ledger version. * `ledger_index` (integer; optional): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) used when retrieving this data. Present only when using a closed ledger version. * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): the identifying hash of the ledger version used when retrieving this data. This field is only provided when using a closed ledger version. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): server-defined value indicating pagination; pass this to the next call to resume retrieving results from where this response ended. Omitted when there are no additional pages. * `limit` (number; optional): the maximum number of trust lines retrieved. The server may return fewer than the specified limit even if more results are available. Default: `200`. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "account_lines", "params": [ { "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "api_version": 2 } ] }' ``` ### Response example ```json { "result": { "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "ledger_current_index": 99673270, "lines": [ { "account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", "balance": "0", "currency": "ASP", "limit": "0", "limit_peer": "10", "quality_in": 0, "quality_out": 0 }, { "account": "rE6R3DWF9fBD7CyiQciePF9SqK58Ubp8o2", "balance": "0", "currency": "JOE", "limit": "0", "limit_peer": "100", "no_ripple_peer": true, "quality_in": 0, "quality_out": 0 } ], "status": "success", "validated": false } } ``` --- ## `account_nfts` > Retrieves a list of all NFTs for an account. The `account_nfts` method returns a list of `NFToken` objects for the specified account. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string; required): the unique identifier of an account (typically, [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses)). Returns a list of NFTs owned by this account. * `ledger_hash` (string; optional): the unique hash of the ledger version to use (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `ledger_index` (string or number; optional): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger version to use, or a shortcut string to choose a ledger automatically (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `limit` (integer; optional): limits the number of [token pages](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/nftokenpage) to retrieve. Each page can contain up to 32 NFTs. * Must be between `20` and `400`; values outside this range are adjusted to the nearest valid option. * Default: `100`. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): value from a previous paginated response; resumes retrieving data where that response left off. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `account` (string): the account that owns the list of NFTs. * `account_nfts` (array of objects): list of NFTs owned by the account. Each object represents one NFToken and includes the following fields: * `Flags` (number): a bitmap of boolean flags enabled for this NFToken. See [NFToken Flags](https://xrpl.org/docs/references/protocol/data-types/nftoken#nftoken-flags) for possible values. * `Issuer` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses)): the account that issued this NFToken. * `NFTokenID` (string): the unique identifier of this NFToken, represented as a hexadecimal string. * `NFTokenTaxon` (number): the unscrambled version of this token’s [taxon](https://xrpl.org/docs/references/protocol/data-types/nftoken#nftokentaxon). Tokens sharing the same taxon may represent multiple instances of a limited series. * `URI` (string): the URI data associated with this NFToken, represented in hexadecimal format. * `nft_serial` (number): the token sequence number of this NFToken, unique per issuer. * `ledger_hash` (string; optional): the identifying hash of the ledger version used to generate this response. * `ledger_index` (number; optional): the ledger index of the ledger version used to generate this response. * `ledger_current_index` (number; optional): the ledger index of the current in-progress ledger version used to generate this response. * `validated` (boolean): if true, the information in this response comes from a validated ledger version; otherwise, the information is subject to change. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): server-defined value indicating pagination. Pass this to the next call to resume fetching results from where this response ended. Omitted when there are no additional pages. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "account_nfts", "params": [ { "account": "rpoYSH7mntUSWF41gD7RhJQzrNHxogAb6W" } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "account": "rpoYSH7mntUSWF41gD7RhJQzrNHxogAb6W", "account_nfts": [], "ledger_current_index": 99893274, "status": "success", "validated": false } } ``` --- ## `account_objects` > Retrieves all ledger objects owned by an account. The `account_objects` command returns all ledger entries owned by an account, in their raw [ledger format](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types). There are other API methods that are specialized for getting certain types of ledger entry, such as the `account_lines` method for trust lines, or `account_offers` method for offers. These methods provide a processed view of the data that is more suitable for typical use cases. Use `account_objects` if you want to get ledger entries of types that don't have a specialized method, or if you want to get the entries in their canonical format. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): retrieves ledger entries associated with this account. * `deletion_blockers_only` (boolean; optional): if `true`, returns only ledger entries that would prevent this account from being deleted. Default: `false`. * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): the unique hash of the ledger version to use (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `ledger_index` (number or string; optional): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger version to use, or a shortcut string to choose a ledger automatically (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `limit` (number; optional): the maximum number of ledger entries to include in the results. Must be between `10` and `400` for non-admin connections. Default: `200`. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): value from a previous paginated response; resumes retrieving data where that response left off. * `type` (string; optional): filters results by a specific type of ledger entry. Accepts canonical or [short names](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/ledger-entry-short-names) of [ledger entry types](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types) (case-insensitive). Ledger entry types that cannot appear in an owner directory are not allowed. If omitted, all types are returned. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses)): the account this request corresponds to. * `account_objects` (array of objects): array of ledger entries found in this account’s owner directory. Includes both: * Entries owned directly by this account, and * Entries linked to this account but owned by others (for example, escrows where this account is the destination). * Each member is a ledger entry in its raw [ledger format](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types). The number of entries may be fewer than the value specified in `limit`. * `ledger_hash` (string; optional): the identifying hash of the ledger used to generate this response. * `ledger_index` (number; optional): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger version used to generate this response. * `ledger_current_index` (number; optional): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the open ledger version used to generate this response. * `limit` (number; optional): the limit value that was applied in this request, if specified. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): server-defined value indicating pagination. Pass this to the next call to resume retrieving data where this response ended. Omitted when there are no additional pages. * `validated` (boolean; optional): if `true`, the data in this response originates from a validated ledger version; otherwise, it may be subject to change. :::warning The `account_objects` array may be empty even if there are additional ledger entries to retrieve. This is especially likely when using `type` to filter ledger entry types. If the response includes a `marker` field, there are additional pages of data; if the response does not include a `marker`, then this is the end of the data. This behavior is a consequence of how the API method iterates through the account's owner directory, and a precaution against requests putting excessive load on the server. ::: ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "account_objects", "params": [ { "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "ledger_index": "validated", "type": "state", "deletion_blockers_only": false, "limit": 10 } ] }' ``` ### Response example ```json { "result": { "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "account_objects": [ { "Balance": { "currency": "ASP", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "0" }, "Flags": 65536, "HighLimit": { "currency": "ASP", "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "value": "0" }, "HighNode": "0", "LedgerEntryType": "RippleState", "LowLimit": { "currency": "ASP", "issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", "value": "10" }, "LowNode": "0", "PreviousTxnID": "BF7555B0F018E3C5E2A3FF9437A1A5092F32903BE246202F988181B9CED0D862", "PreviousTxnLgrSeq": 1438879, "index": "2243B0B630EA6F7330B654EFA53E27A7609D9484E535AB11B7F946DF3D247CE9" } ], "ledger_hash": "3E5A1F0602C9699922CBE7BD3846D0C22A584867FFAF9787A1C676315F0797B0", "ledger_index": 99893571, "limit": 10, "marker": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93,94A9F05FEF9A153229E2E997E64919FD75AAE2028C8153E8EBDB4440BD3ECBB5", "status": "success", "validated": true } } ``` --- ## `account_offers` > Retrieves info on the account's currency exchange offers. The `account_offers` method retrieves a list of offers made by a given account that are outstanding as of a particular ledger version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): Look up Offers placed by this account. * `ledger_hash` ([hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The unique hash of the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `ledger_index` (ledger index; optional): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `limit` (number; optional): Limit the number of Offers to retrieve. The server may return fewer than this number of results. Must be within the inclusive range `10` to `400`. Positive values outside this range are replaced with the closest valid option. The default is `200`. * `marker` (marker; optional): Value from a previous paginated response. Resume retrieving data where that response left off. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `account` (string): Unique [Address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses) identifying the account that made the offers. * `offers` (array): Array of objects, where each object represents an offer made by this account that is outstanding as of the requested ledger version. If the number of offers is large, only returns up to `limit` at a time. * `ledger_current_index` (number — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): Omitted if `ledger_hash` or `ledger_index` is provided. The ledger index of the current in-progress ledger version, which was used when retrieving this data. * `ledger_index` (number — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): Omitted if `ledger_current_index` is provided instead. The ledger index of the ledger version that was used when retrieving this data, as requested. * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The identifying hash of the ledger version that was used when retrieving this data. * `marker` ([marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. Omitted when there are no pages of information after this one. Each `offer` object contains the following fields: * `flags` (unsigned integer): Options set for this offer entry as bit-flags. * `seq` (unsigned integer): Sequence number of the transaction that created this entry. (Transaction [sequence numbers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#account-sequence) are relative to accounts.) * `taker_gets` (string or object): The amount the account accepting the offer receives, as a String representing an amount in XRP, or a currency specification object. (See [Specifying Currency Amounts](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts)). * `taker_pays` (string or object): The amount the account accepting the offer provides, as a String representing an amount in XRP, or a currency specification object. (See [Specifying Currency Amounts](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts)). * `quality` (string): The exchange rate of the offer, as the ratio of the original `taker_pays` divided by the original `taker_gets`. When executing offers, the offer with the most favorable (lowest) quality is consumed first; offers with the same quality are executed from oldest to newest. * `expiration` (unsigned integer; optional): A time after which this offer is considered unfunded, as the number of [seconds since the Ripple Epoch](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time). See also: [Offer Expiration](https://xrpl.org/docs/concepts/tokens/decentralized-exchange/offers#offer-expiration). ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "account_offers", "params": [ { "account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM" } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM", "ledger_current_index": 99895001, "offers": [], "status": "success", "validated": false } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/account-p3/ title: XRP — account (3/3) source: docs/rpc-service/chains/chains-api/xrp/account-p3.mdx --- # XRP — account (3/3) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/xrp/account/) · [2](/rpc-service/chains/chains-api/xrp/account-p2/) · 3 ## `account_tx` > Retrieves a list of transactions affecting an account. The `account_tx` method retrieves a list of validated transactions that involve a given account. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string; required): the unique identifier of the account, typically its address. * `tx_type` (string; optional): (Clio only) filters results to a specific transaction type (for example "Clawback", "AccountSet", "AccountDelete"). Case-insensitive. See [Transaction Types](https://xrpl.org/docs/references/protocol/transactions/types#transaction-types). * `ledger_index_min` (integer; optional): earliest ledger index to include transactions from. A value of `-1` uses the earliest validated ledger available. * `ledger_index_max` (integer; optional): most recent ledger index to include transactions from. A value of `-1` uses the most recent validated ledger available. * `ledger_hash` (string — hash; optional): specifies a single ledger by its unique hash (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `ledger_index` (string or unsigned integer; optional): specifies a single ledger by its index or a shortcut keyword (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `binary` (boolean; optional): if `true`, returns transactions as hex strings instead of JSON. Default: `false`. * `forward` (boolean; optional): if `true`, returns results indexed with the oldest ledger first; otherwise, the newest ledger first. Each page may not be internally ordered, but pages overall follow the chosen order. Default: `false`. * `limit` (integer; optional): limits the number of transactions to retrieve. The default varies depending on server configuration. The server is not required to honor this value. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): value from a previous paginated response; resumes retrieving data where that response left off. Stable even if the server’s available ledger range changes. **Iterating over queried data**: As with other paginated methods, you can use the `marker` field to return multiple pages of data. In the time between requests, `"ledger_index_min": -1` and `"ledger_index_max": -1` may change to refer to different ledger versions than they did before. The `marker` field can safely paginate even if there are changes in the ledger range from the request, so long as the marker does not indicate a point outside the range of ledgers specified in the request. ### Returns #### API v2 * `account` (string): Unique [Address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses) identifying the related account. * `ledger_index_min` (integer — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The ledger index of the earliest ledger actually searched for transactions. * `ledger_index_max` (integer — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The ledger index of the most recent ledger actually searched for transactions. * `limit` (integer): The `limit` value used in the request. (This may differ from the actual limit value enforced by the server.) * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination)): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. * `transactions` (array): Array of transactions matching the request's criteria, as explained below. * `validated` (boolean): If included and set to `true`, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change. :::tip The server may respond with different values of `ledger_index_min` and `ledger_index_max` than you provided in the request, for example if it did not have the versions you specified on hand. ::: Each `transaction` object includes the following fields, depending on whether it was requested in JSON or hex string (`"binary": true`) format: * `close_time_iso` (string): The ledger close time represented in ISO 8601 time format. * `hash` (string): The unique hash identifier of the transaction. * `ledger_hash` (string): A hex string of the ledger version that included this transaction. * `ledger_index` (integer): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger version that included this transaction. * `tx_json` (object — JSON): (JSON mode) JSON object defining the transaction. * `tx_blob` (string — binary): (Binary mode) A unique hex string defining the transaction. * `meta` (object — JSON): (JSON mode) The transaction results metadata in JSON. * `meta_blob` (string — binary): (Binary mode) The transaction results metadata as a hex string. * `validated` (boolean): Whether the transaction is included in a validated ledger or not. Any transaction not yet in a validated ledger is subject to change. #### API v1 * `account` (string): Unique [Address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses) identifying the related account. * `ledger_index_min` (integer — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The ledger index of the earliest ledger actually searched for transactions. * `ledger_index_max` (integer — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The ledger index of the most recent ledger actually searched for transactions. * `limit` (integer): The `limit` value used in the request. (This may differ from the actual limit value enforced by the server.) * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination)): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. * `transactions` (array): Array of transactions matching the request's criteria, as explained below. * `validated` (boolean): If included and set to `true`, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change. :::tip The server may respond with different values of `ledger_index_min` and `ledger_index_max` than you provided in the request, for example if it did not have the versions you specified on hand. ::: Each `transaction` object includes the following fields, depending on whether it was requested in JSON or hex string (`"binary": true`) format. * `ledger_index` (integer): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger version that included this transaction. * `tx` (object — JSON): (JSON mode) JSON object defining the transaction. * `tx_blob` (string — binary): (Binary mode) Hex string representing the transaction. * `meta` (object — JSON or string — binary): If `binary` is `true`, then this is a hex string of the transaction results metadata. Otherwise, the transaction results metadata is included in JSON format. * `validated` (boolean): Whether the transaction is included in a validated ledger or not. Any transaction not yet in a validated ledger is subject to change. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "account_tx", "params": [ { "account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", "binary": false, "forward": false, "ledger_index_max": -1, "ledger_index_min": -1, "limit": 2, "api_version": 2 } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", "ledger_index_max": 100184671, "ledger_index_min": 99766025, "limit": 2, "status": "success", "transactions": [], "validated": true } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/account/ title: XRP — account (1/3) source: docs/rpc-service/chains/chains-api/xrp/account.mdx --- # XRP — account (1/3) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/xrp/account-p2/) · [3](/rpc-service/chains/chains-api/xrp/account-p3/) ## `account_channels` > Retrieves a list of payment channels where the account is the source of the channel. The `account_channels` method returns information about an account's Payment Channels. This includes only channels where the specified account is the channel's source, not the destination. (A channel's "source" and "owner" are the same.) All information retrieved is relative to a particular version of the ledger. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): look up channels where this account is the channel’s owner/source. * `destination_account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); optional): a second account; if provided, filters results to payment channels whose destination is this account. * `ledger_hash` (string; optional): the unique hash of the ledger version to use (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `ledger_index` (number or string; optional): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `limit` (number; optional): limits the number of transactions to retrieve. Must be between 10 and 400; values outside this range are adjusted to the nearest valid value. Default: 200. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): value from a previous paginated response; resumes retrieving data where that response left off. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `account` (string): the address of the source/owner of the payment channels. Corresponds to the `account` field of the request. * `channels` (array of objects): list of payment channels owned by this `account`. Each object contains the following fields: * `account` (string): the owner of the channel, as an [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses). * `channel_id` (string): a unique ID for this channel, represented as a 64-character hexadecimal string. This is also the [ID of the channel object](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/paychannel#paychannel-id-format) in the ledger’s state data. * `destination_account` (string): the destination account of the channel, as an address. Only this account can receive the `amount` in the channel while it is open. * `settle_delay` (unsigned integer): the number of seconds the payment channel must remain open after the owner requests to close it. * `public_key` (string; optional): the public key for the payment channel in the XRP Ledger’s [base58](https://xrpl.org/docs/references/protocol/data-types/base58-encodings) format. Signed claims against this channel must be redeemed with the matching key pair. * `public_key_hex` (string; optional): the public key for the payment channel in hexadecimal format, if one was specified at channel creation. Signed claims against this channel must be redeemed with the matching key pair. * `expiration` (unsigned integer; optional): time in [seconds since the Ripple Epoch](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time) when this channel is set to expire. This expiration date is mutable. If this value is before the close time of the most recent validated ledger, the channel is expired. * `cancel_after` (unsigned integer; optional): time in [seconds since the Ripple Epoch](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time) representing this channel’s immutable expiration, if one was specified at creation. If this is before the close time of the most recent validated ledger, the channel is expired. * `source_tag` (unsigned integer; optional): a 32-bit unsigned integer used as a [source tag](https://xrpl.org/docs/concepts/transactions/source-and-destination-tags) for payments through this payment channel, if specified at creation. This indicates the channel’s originator or purpose. Conventionally, if you bounce payments from this channel, you should include this value in the `DestinationTag` of the return payment. * `destination_tag` (unsigned integer; optional): a 32-bit unsigned integer used as a [destination tag](https://xrpl.org/docs/concepts/transactions/source-and-destination-tags) for payments through this payment channel, if specified at creation. This indicates the payment channel’s beneficiary or purpose at the destination account. * `ledger_hash` (string; optional): the identifying [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes) of the ledger version used to generate this response. * `ledger_index` (number): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger version used to generate this response. * `validated` (boolean; optional): if `true`, the information in this response comes from a validated ledger version; otherwise, the information is subject to change. * `limit` (number; optional): the limit defining how many channel objects were actually returned by this request. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): server-defined value for pagination; pass this value to the next call to resume fetching results from where this call left off. Omitted when there are no more pages of data. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "account_channels", "params": [ { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "ledger_index": "validated" } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "channels": [ { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "amount": "1000", "balance": "0", "channel_id": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7", "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "public_key": "aBR7mdD75Ycs8DRhMgQ4EMUEmBArF8SEh1hfjrT2V9DQTLNbJVqw", "public_key_hex": "03CFD18E689434F032A4E84C63E2A3A6472D684EAF4FD52CA67742F3E24BAE81B2", "settle_delay": 60 } ], "ledger_hash": "42C4F4E81710B015B3BA2A81E357E30E261F58964A6AB6C012734FADB67AB40D", "ledger_index": 99672209, "status": "success", "validated": true } } ``` --- ## `account_currencies` > Retrieves a list of currencies an account can send or receive. The `account_currencies` command retrieves a list of currencies that an account can send or receive, based on its trust lines. This is not a thoroughly confirmed list, but it can be used to populate user interfaces. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): look up currencies this account can send or receive. * `ledger_hash` (string; optional): the unique hash of the ledger version to use (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `ledger_index` (number or string; optional): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): the identifying hash of the ledger version used to retrieve this data, represented as a hexadecimal string. * `ledger_index` (integer): the [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger version used to retrieve this data. * `receive_currencies` (array of strings): list of [currency codes](https://xrpl.org/docs/references/protocol/data-types/currency-formats#currency-codes) that this account can receive. * `send_currencies` (array of strings): list of [currency codes](https://xrpl.org/docs/references/protocol/data-types/currency-formats#currency-codes) that this account can send. * `validated` (boolean): if `true`, the data in this response comes from a validated ledger. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "account_currencies", "params": [ { "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "account_index": 0, "ledger_index": "validated" } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "ledger_hash": "26C97A5C542BB50D6C084EF158AC35AC4D3A94CEA57286F60552A2D55BC2DDCA", "ledger_index": 99672360, "receive_currencies": [ "BTC", "CNY", "DYM", "EUR", "JOE", "MXN", "USD", "015841551A748AD2C1F76FF6ECB0CCCD00000000" ], "send_currencies": [ "ASP", "BTC", "CHF", "CNY", "DYM", "EUR", "JOE", "JPY", "MXN", "USD", "5553445400000000000000000000000000000000" ], "status": "success", "validated": true } } ``` --- ## `account_info` > Retrieves basic data on the account. The `account_info` command retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a particular version of the ledger. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): the account to look up. * `ledger_hash` (string; optional): the unique hash of the ledger version to use (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `ledger_index` (number or string; optional): the ledger index of the ledger to use, or a shortcut string to choose a ledger automatically (see [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `queue` (boolean; optional): if `true`, returns stats about [queued transactions](https://xrpl.org/docs/concepts/transactions/transaction-queue) sent by this account. Can only be used when querying data from the current open ledger. * `signer_lists` (boolean; optional): if `true`, returns any [`SignerList` objects](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/signerlist) associated with this account. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with the result containing the requested account, its data, and a ledger to which it applies, as the following fields: * `account_data` (object): the [AccountRoot ledger object](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/accountroot) containing this account’s information as stored in the ledger. * `account_flags` (object): the account’s flag statuses, derived from the `Flags` field of the account. Contains the following nested fields: * `defaultRipple` (boolean): if `true`, the account allows [rippling](https://xrpl.org/docs/concepts/tokens/fungible-tokens/rippling) on its trust lines by default. * `depositAuth` (boolean): if `true`, the account uses [Deposit Authorization](https://xrpl.org/docs/concepts/accounts/depositauth) and does not accept payments from unknown parties. * `disableMasterKey` (boolean): if `true`, the account’s [master key pair](https://xrpl.org/docs/concepts/accounts/cryptographic-keys) is disabled. * `disallowIncomingCheck` (boolean): if `true`, the account does not allow others to send [Checks](https://xrpl.org/docs/concepts/payment-types/checks) to it. * `disallowIncomingNFTokenOffer` (boolean): if `true`, the account does not allow others to make [NFT buy or sell offers](https://xrpl.org/docs/concepts/tokens/nfts/trading) to it. * `disallowIncomingPayChan` (boolean): if `true`, the account does not allow others to create [Payment Channels](https://xrpl.org/docs/concepts/payment-types/payment-channels) to it. * `disallowIncomingTrustline` (boolean): if `true`, the account does not allow others to create [trust lines](https://xrpl.org/docs/concepts/tokens/fungible-tokens) to it. * `disallowIncomingXRP` (boolean): if `true`, the account prefers not to receive XRP from others. This setting is advisory and not enforced at the protocol level. * `globalFreeze` (boolean): if `true`, all tokens issued by the account are currently frozen. * `noFreeze` (boolean): if `true`, the account has permanently renounced the ability to freeze individual trust lines or enforce a global freeze. See [No Freeze](https://xrpl.org/docs/concepts/tokens/fungible-tokens/freezes#no-freeze) for details. * `passwordSpent` (boolean): if `false`, the account can send a special [key-reset transaction](https://xrpl.org/docs/concepts/transactions/transaction-cost#key-reset-transaction) with zero transaction cost. The protocol automatically toggles this flag; it is not user-controlled. * `requireAuthorization` (boolean): if `true`, the account uses [Authorized Trust Lines](https://xrpl.org/docs/concepts/tokens/fungible-tokens/authorized-trust-lines) to restrict who can hold its issued tokens. * `requireDestinationTag` (boolean): if `true`, the account [requires a destination tag](https://xrpl.org/docs/tutorials/how-tos/manage-account-settings/require-destination-tags) on all incoming payments. * `signer_lists` (array; optional): * API v1: omitted unless the request specified signer_lists and at least one SignerList is associated with the account. Contains an array of SignerList ledger objects for multi-signing. Since an account can own at most one SignerList, this array contains exactly one member if present. The field is nested under account_data. * API v2: identical to API v1, but the field is returned at the root level of the response. (Clio implements API v2 behavior in all cases.) * `ledger_current_index` (integer; optional): the ledger index of the current in-progress ledger used when retrieving this information. Omitted if ledger_index is provided instead. * `ledger_index` (integer; optional): the ledger index of the ledger version used to retrieve this information. This data does not include any changes from newer ledger versions. * `queue_data` (object; optional): information about [queued transactions](https://xrpl.org/docs/concepts/transactions/transaction-cost#queued-transactions) sent by this account. Returned only if queue was set to `true` and the current open ledger was queried. Describes the local rippled server’s queue state, which may differ across the network. Some fields may be omitted because certain values are computed lazily by the queuing mechanism. Contains the following nested fields: * `txn_count` (integer): number of queued transactions from this address. * `auth_change_queued` (boolean; optional): whether a transaction in the queue changes this address’s [ways of authorizing transactions](https://xrpl.org/docs/concepts/transactions#authorizing-transactions). If `true`, no further transactions can be queued until that transaction executes or drops from the queue. * `lowest_sequence` (integer; optional): the lowest [sequence number](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#account-sequence) among transactions queued by this address. * `highest_sequence` (integer; optional): the highest [sequence number](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#account-sequence) among transactions queued by this address. * `max_spend_drops_total` (string; optional): the total number of [drops of XRP](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts) that could be debited from this account if every queued transaction consumes the maximum possible amount. * `transactions` (array; optional): information about each queued transaction from this account. * `validated` (boolean): `true` if this data originates from a validated ledger version; if omitted or `false`, the data is not final. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "account_info", "params": [ { "account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn", "ledger_index": "current", "queue": true } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "account_data": { "Account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn", "Balance": "88986679", "Flags": 1048576, "LedgerEntryType": "AccountRoot", "MessageKey": "0200000000000000000000000038901D3A772963CF12FF7C0E010FE350B6CCC45D", "OwnerCount": 0, "PreviousTxnID": "083A5D87E0E10D8632A62B67CCE8C68C0E94615371E92AD591CD068DE600117A", "PreviousTxnLgrSeq": 99424162, "RegularKey": "rhLkGGNZdjSpnHJw4XAFw1Jy7PD8TqxoET", "Sequence": 192223, "index": "92FA6A9FC8EA6018D5D16532D7795C91BFB0831355BDFDA177E86C8BF997985F" }, "account_flags": { "allowTrustLineClawback": false, "defaultRipple": false, "depositAuth": false, "disableMasterKey": true, "disallowIncomingCheck": false, "disallowIncomingNFTokenOffer": false, "disallowIncomingPayChan": false, "disallowIncomingTrustline": false, "disallowIncomingXRP": false, "globalFreeze": false, "noFreeze": false, "passwordSpent": false, "requireAuthorization": false, "requireDestinationTag": false }, "ledger_current_index": 99672810, "queue_data": { "txn_count": 0 }, "status": "success", "validated": false } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/book-p2/ title: XRP — book, deposit, get, nft, ripple, channel, Methods, server (2/2) source: docs/rpc-service/chains/chains-api/xrp/book-p2.mdx --- # XRP — book, deposit, get, nft, ripple, channel, Methods, server (2/2) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/xrp/book/) · 2 ## `ripple_path_find` > Finds a path for payment between two accounts, once. Although the rippled server tries to find the cheapest path or combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths. Caution: Be careful with the pathfinding results from untrusted servers. A server could be modified to return less-than-optimal paths to earn money for its operators. A server may also return poor results when under heavy load. If you do not have your own server that you can trust with pathfinding, you should compare the results of pathfinding from multiple servers run by different parties, to minimize the risk of a single server returning poor results. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `source_account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The account that would send funds. * `destination_account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The account that would receive funds. * `destination_amount` ([currency amount](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts); required): How much the destination account would receive. Special case: You can specify `-1` (for XRP) or provide `-1` as the `value` field (for tokens). This requests a path to deliver as much as possible, while spending no more than the amount specified in `send_max` (if provided). * `domain` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The ledger entry ID of a permissioned domain. If provided, only return paths that use the corresponding [permissioned DEX](https://xrpl.org/docs/concepts/tokens/decentralized-exchange/permissioned-dexes). (Requires the [PermissionedDEX amendment](https://xrpl.org/resources/known-amendments#permissioneddex)) * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The unique hash of the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `send_max` ([currency amount](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts); optional): Maximum amount that would be spent. Cannot be used with `source_currencies`. * `source_currencies` (array; optional): Array of currencies that the source account might want to spend. Each entry in the array should be a JSON object with a mandatory `currency` field and optional `issuer` field, like how [currency amounts](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts) are specified. Cannot contain more than 18 source currencies. By default, uses all source currencies available up to a maximum of 88 different currency/issuer pairs. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `alternatives` (array): Array of objects with possible paths to take, as described below. If empty, then there are no paths connecting the source and destination accounts. * `destination_account` (string): Unique address of the account that would receive a payment transaction. * `destination_currencies` (array): Array of strings representing the currencies that the destination accepts, as 3-letter codes like `USD` or as 40-character hex like `015841551A748AD2C1F76FF6ECB0CCCD00000000`. Each element in the `alternatives` array is an object that represents a path from one possible source currency (held by the initiating account) to the destination account and currency. This object has the following fields: * `paths_computed` (array): Array of arrays of objects defining [payment paths](https://xrpl.org/docs/concepts/tokens/fungible-tokens/paths). * `source_amount` (string or object): [Currency Amount](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts) that the source would have to send along this path for the destination to receive the desired amount. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ripple_path_find", "params": [ { "destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "destination_amount": { "currency": "USD", "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", "value": "0.001" }, "source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "source_currencies": [ { "currency": "XRP" }, { "currency": "USD" } ] } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "alternatives": [ { "paths_canonical": [], "paths_computed": [ [ { "currency": "USD", "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", "type": 48 } ] ], "source_amount": "461" }, { "paths_canonical": [], "paths_computed": [], "source_amount": { "currency": "USD", "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "value": "0.0010015" } } ], "destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "destination_amount": { "currency": "USD", "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", "value": "0.001" }, "destination_currencies": [ "JOE", "MXN", "USD", "DYM", "CNY", "015841551A748AD2C1F76FF6ECB0CCCD00000000", "EUR", "BTC", "XRP" ], "full_reply": true, "source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "status": "success" } } ``` --- **Payment Channel Methods**: Payment channels are a tool for facilitating repeated, unidirectional payments, or temporary credit between two parties. Use these methods to work with payment channels. ## `channel_verify` > Checks a payment channel claim's signature. The `channel_verify` method checks the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `amount` (string; required): The amount of [XRP, in drops](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts), that the provided `signature` authorizes. * `channel_id` (string; required): The Channel ID of the channel that provides the amount. This is a 64-character hexadecimal string. * `public_key` (string; required): The public key of the channel and the key pair that was used to create the signature, in hexadecimal or the XRP Ledger's `base58` format. * `signature` (string; required): The signature to verify, in hexadecimal. ### Returns * `signature_verified` (boolean): If `true`, the signature is valid for the stated amount, channel, and public key. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "channel_verify", "params": [ { "channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3", "signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064", "public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3", "amount": "1000000" } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "signature_verified": true, "status": "success" } } ``` --- **Server Info Methods**: Use these methods to retrieve information about the current state of the rippled server. ## `fee` > Retrieves information on the transaction cost. The `fee` command reports the current state of the open-ledger requirements for the [transaction cost](https://xrpl.org/docs/concepts/transactions/transaction-cost). This requires the [FeeEscalation amendment](https://xrpl.org/resources/known-amendments#feeescalation) to be enabled. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `current_ledger_size` (string — integer): Number of transactions provisionally included in the in-progress ledger. * `current_queue_size` (string — integer): Number of transactions currently queued for the next ledger. * `drops` (object): Various information about the transaction cost (the `Fee` field of a transaction), in [drops of XRP](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts). * `drops.base_fee` (string — integer): The transaction cost required for a [reference transaction](https://xrpl.org/docs/concepts/transactions/transaction-cost#reference-transaction-cost) to be included in a ledger under minimum load, represented in drops of XRP. * `drops.median_fee` (string — integer): An approximation of the median transaction cost among transactions included in the previous validated ledger, represented in drops of XRP. * `drops.minimum_fee` (string — integer): The minimum transaction cost for a [reference transaction](https://xrpl.org/docs/concepts/transactions/transaction-cost#reference-transaction-cost) to be queued for a later ledger, represented in drops of XRP. If greater than `base_fee`, the transaction queue is full. * `drops.open_ledger_fee` (string — integer): The minimum transaction cost that a [reference transaction](https://xrpl.org/docs/concepts/transactions/transaction-cost#reference-transaction-cost) must pay to be included in the current open ledger, represented in drops of XRP. * `expected_ledger_size` (string — integer): The approximate number of transactions expected to be included in the current ledger. This is based on the number of transactions in the previous ledger. * `ledger_current_index` (number): The Ledger Index of the current open ledger these stats describe. * `levels` (object): Various information about the transaction cost, in [fee levels](https://xrpl.org/docs/concepts/transactions/transaction-cost#fee-levels). The ratio in fee levels applies to any transaction relative to the minimum cost of that particular transaction. * `levels.median_level` (string — integer): The median transaction cost among transactions in the previous validated ledger, represented in [fee levels](https://xrpl.org/docs/concepts/transactions/transaction-cost#fee-levels). * `levels.minimum_level` (string — integer): The minimum transaction cost required to be queued for a future ledger, represented in [fee levels](https://xrpl.org/docs/concepts/transactions/transaction-cost#fee-levels). * `levels.open_ledger_level` (string — integer): The minimum transaction cost required to be included in the current open ledger, represented in [fee levels](https://xrpl.org/docs/concepts/transactions/transaction-cost#fee-levels). * `levels.reference_level` (string — integer): The equivalent of the minimum transaction cost, represented in [fee levels](https://xrpl.org/docs/concepts/transactions/transaction-cost#fee-levels). * `max_queue_size` (string — integer): The maximum number of transactions that the [transaction queue](https://xrpl.org/docs/concepts/transactions/transaction-cost#queued-transactions) can currently hold. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "fee", "params": [{}] }' ``` ### Response example ```json { "result": { "current_ledger_size": "89", "current_queue_size": "0", "drops": { "base_fee": "10", "median_fee": "5000", "minimum_fee": "10", "open_ledger_fee": "10" }, "expected_ledger_size": "396", "ledger_current_index": 100647307, "levels": { "median_level": "128000", "minimum_level": "256", "open_ledger_level": "256", "reference_level": "256" }, "max_queue_size": "7920", "status": "success" } } ``` --- ## `feature` > Retrieves information on the protocol amendments. The `feature` command returns information about [amendments](https://xrpl.org/docs/concepts/networks-and-servers/amendments) this server knows about, including whether they are enabled and if the server knows how to apply the amendments. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `feature` (string; optional): The unique ID of an amendment, as hexadecimal; or the short name of the amendment. If provided, limits the response to one amendment. Otherwise, the response lists all amendments. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing a map of amendments as a JSON object. The keys of the object are amendment IDs. The values for each key are amendment objects that describe the status of the amendment with that ID. If the request specified a `feature`, the map contains only the requested amendment object, after applying any changes from the request. Each amendment object has the following fields: * `enabled` (boolean): Whether this amendment is currently enabled in the latest ledger. * `name` (string; optional): The human-readable name for this amendment, if known. * `supported` (boolean): Whether the server knows how to apply this amendment. If this field is set to `false` (the server does not know how to apply this amendment) and `enabled` is set to `true` (this amendment is enabled in the latest ledger), this amendment may cause your server to be [amendment blocked](https://xrpl.org/docs/concepts/networks-and-servers/amendments#amendment-blocked-servers). ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "fee", "params": [ { "feature": "4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373" } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "current_ledger_size": "36", "current_queue_size": "0", "drops": { "base_fee": "10", "median_fee": "5000", "minimum_fee": "10", "open_ledger_fee": "10" }, "expected_ledger_size": "396", "ledger_current_index": 100647615, "levels": { "median_level": "128000", "minimum_level": "256", "open_ledger_level": "256", "reference_level": "256" }, "max_queue_size": "7920", "status": "success" } } ``` --- ## `manifest` > Retrieves public information on a known validator. The `manifest` method reports the current "manifest" information for a given validator public key. The "manifest" is a block of data that authorizes an ephemeral signing key with a signature from the validator's master key pair. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `public_key` (string; required): The [base58](https://xrpl.org/docs/references/protocol/data-types/base58-encodings)-encoded public key of the validator to look up. This can be the master public key or ephemeral public key. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `details` (object; optional): The data contained in this manifest. Omitted if the server does not have a manifest for the `public_key` from the request. See Details Object below for a full description of its contents. * `manifest` (string; optional): The full manifest data in base64 format. This data is serialized to binary before being base64-encoded. Omitted if the server does not have a manifest for the `public_key` from the request. * `requested` (string): The `public_key` from the request. #### Details Object If provided, the `details` object contains the following fields: * `domain` (string): The domain name this validator claims to be associated with. If the manifest does not contain a domain, this is an empty string. * `ephemeral_key` (string): The ephemeral public key for this validator, in [base58](https://xrpl.org/docs/references/protocol/data-types/base58-encodings). * `master_key` (string): The master public key for this validator, in [base58](https://xrpl.org/docs/references/protocol/data-types/base58-encodings). * `seq` (number): The sequence number of this manifest. This number increases whenever the validator operator updates the validator's token to rotate ephemeral keys or change settings. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "manifest", "params": [ { "public_key":"nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p" } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "details": { "domain": "alloy.ee", "ephemeral_key": "n9LMfcjE6dMyshCqiftLFXpB9K3Mnd2r5bG7K8osmrkFpHUoR3c1", "master_key": "nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p", "seq": 4 }, "manifest": "JAAAAARxIe3AkJgOyqs3y+UuiAI27Ff3Mrfbt8e7mjdo06bnGEp5XnMhAu2LSAwZEQnm/mq9K6sSZJk5JkbcKCv6C7vQW2C8RnZVdkcwRQIhAI9uwQ1p58oyob1E+DaFLwjTdiRbVIKSMPqaaUwnJdN2AiB79DlPXHwztNULraVTkehbDsCAyDdf3VZB3FvkCZNOFHcIYWxsb3kuZWVwEkBf6A9ktcj2H4a61Av8ujQFL2KNcmr/FuEKbwlZEniJvhf0UqNiYc2bAsTJE5wMn00E0JBbw2m9OFwto50DcdkC", "requested": "nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p", "status": "success" } } ``` --- ## `server_definitions` > Retrieves an SDK-compatible `definitions.json` generated from the currently running `rippled` instance. The `server_definitions` command returns an SDK-compatible `definitions.json`, generated from the `rippled` instance currently running. You can use this to query a node in a network, quickly receiving the definitions necessary to serialize/deserialize its binary data. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns To see a full `definitions.json` file and descriptions of the top-level fields, see the [Definitions File](https://xrpl.org/docs/references/protocol/binary-format#definitions-file). ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "server_definitions", "params": [] }' ``` ### Response example ```json { "id": 1, "result": { "FIELDS": [ [ "Generic", { "isSerialized": false, "isSigningField": false, "isVLEncoded": false, "nth": 0, "type": "Unknown" } ], [ "Invalid", { "isSerialized": false, "isSigningField": false, "isVLEncoded": false, "nth": -1, "type": "Unknown" } ], [ "ObjectEndMarker", { "isSerialized": true, "isSigningField": true, "isVLEncoded": false, "nth": 1, "type": "STObject" } ], [ "ArrayEndMarker", { "isSerialized": true, "isSigningField": true, "isVLEncoded": false, "nth": 1, "type": "STArray" } ] ... ] } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/book/ title: XRP — book, deposit, get, nft, ripple, channel, Methods, server (1/2) source: docs/rpc-service/chains/chains-api/xrp/book.mdx --- # XRP — book, deposit, get, nft, ripple, channel, Methods, server (1/2) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/xrp/book-p2/) ## `book_offers` > Retrieves info on the currency exchange offers. The `book_offers` method retrieves a list of [offers](https://xrpl.org/docs/concepts/tokens/decentralized-exchange/offers) between two currencies, also known as an order book. The response omits [unfunded offers](https://xrpl.org/docs/concepts/tokens/decentralized-exchange/offers#lifecycle-of-an-offer) and reports how much of each remaining offer's total is currently funded. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `taker_gets` (object; required): The asset the account taking the offer would receive, as a [currency without an amount](https://xrpl.org/docs/references/protocol/data-types/currency-formats#specifying-without-amounts). * `taker_pays` (object; required): The asset the account taking the offer would pay, as a [currency without an amount](https://xrpl.org/docs/references/protocol/data-types/currency-formats#specifying-without-amounts). * `domain` ([hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The ledger entry ID of a permissioned domain. If provided, return offers from the corresponding [permissioned DEX](https://xrpl.org/docs/concepts/tokens/decentralized-exchange/permissioned-dexes) instead of using the open DEX. (Requires the [PermissionedDEX amendment](https://xrpl.org/resources/known-amendments#permissioneddex). Open for Voting: 48.57%) * `ledger_hash` ([hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The unique hash of the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `limit` (number; optional): The maximum number of offers to return. The response may include fewer results. * `taker` (string; optional): The [Address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses) of an account to use as a perspective. The response includes this account's Offers even if they are unfunded. (You can use this to see what Offers are above or below yours in the order book.) ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `ledger_current_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): Omitted if `ledger_index` is provided. The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the current in-progress ledger version, which was used to retrieve this information. * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): Omitted if `ledger_current_index` is provided. The ledger index of the ledger version that was used when retrieving this data, as requested. * `ledger_hash` ([hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The identifying hash of the ledger version that was used when retrieving this data, as requested. * `offers` (array): Array of offer objects, as described below. Each member of the `offers` array contains canonical fields of an [Offer entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/offer) and can also contain the following additional fields: * `owner_funds` (string): Amount of the `TakerGets` currency the side placing the offer has available to be traded. (XRP is represented as drops; any other currency is represented as a decimal value.) If a trader has multiple offers in the same book, only the highest-ranked offer includes this field. * `taker_gets_funded` ([currency amount](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts); optional): (Only included in partially-funded offers) The maximum amount of currency that the taker can get, given the funding status of the offer. * `taker_pays_funded` ([currency amount](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts); optional): (Only included in partially-funded offers) The maximum amount of currency that the taker would pay, given the funding status of the offer. * `quality` (string): The exchange rate, as the ratio `taker_pays` divided by `taker_gets`. For fairness, offers that have the same quality are automatically taken first-in, first-out. (In other words, if multiple people offer to exchange currency at the same rate, the oldest offer is taken first.) ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "book_offers", "params": [ { "taker": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "taker_gets": { "currency": "XRP" }, "taker_pays": { "currency": "USD", "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" }, "limit": 10 } ] }' ``` ### Response example ```json { "result": { "ledger_current_index": 100604206, "offers": [ { "Account": "rdmZRvr9aBdGwzF2DwYBnHxTUDomJoiaQ", "BookDirectory": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4F07346FDFE9BD33", "BookNode": "0", "Flags": 0, "LedgerEntryType": "Offer", "OwnerNode": "8", "PreviousTxnID": "4F34894FC227EBC36B0469672C533DB245DB8CB9FAC59E49A7B058D3A0ED08F6", "PreviousTxnLgrSeq": 100604145, "Sequence": 99505926, "TakerGets": "9117876", "TakerPays": { "currency": "USD", "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", "value": "18.49086962" }, "index": "8FA868A2EFF6B0CF195126639615DBE9251AE5E5559E428450D7F260E2D16CBA", "owner_funds": "16902114", "quality": "0.000002027979939626291" } ], "status": "success", "validated": false } } ``` --- ## `deposit_authorized` > Checks whether an account is authorized to send money directly to another account. The `deposit_authorized` command indicates whether one account is authorized to send payments directly to another. See [Deposit Authorization](https://xrpl.org/docs/concepts/accounts/depositauth) for information on how to require authorization to deliver money to your account. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `source_account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The sender of a possible payment. * `destination_account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The recipient of a possible payment. * `ledger_hash` ([hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): A 32-byte hex string for the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `credentials` (array; optional): A set of credentials to take into account when checking if the sender can send funds to the destination. Each member of the array must be the unique ID of a [Credential entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/credential) in the ledger. Cannot be an empty array. Note: If you provide a set of credentials that does not exactly match a set of credentials preauthorized by the destination, the payment is not authorized, even if the destination has preauthorized a subset of those credentials. This matches the behavior of transaction processing. ### Returns * `credentials` (array of [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The credentials specified in the request, if any. * `deposit_authorized` (boolean; required): Whether the specified source account is authorized to send payments directly to the destination account. If `true`, either the destination account does not require [deposit authorization](https://xrpl.org/docs/concepts/accounts/depositauth) or the source account is preauthorized. * `destination_account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The destination account specified in the request. * `ledger_hash` (string; optional): The identifying hash of the ledger that was used to generate this response. * `ledger_index` (number — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): The ledger index of the ledger version that was used to generate this response. * `ledger_current_index` (number — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): The ledger index of the current in-progress ledger version, which was used to generate this response. * `source_account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The source account specified in the request. * `validated` (boolean; optional): If `true`, the information comes from a validated ledger version. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "deposit_authorized", "params": [ { "source_account": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de", "destination_account": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8", "credentials": [ "A182EFBD154C9E80195082F86C1C8952FC0760A654B886F61BB0A59803B4387B", "383D269D6C7417D0A8716B09F5DB329FB17B45A5EFDBAFB82FF04BC420DCF7D5" ], "ledger_index": "validated" } ] }' ``` ### Response example ```json { "result": { "credentials": [ "A182EFBD154C9E80195082F86C1C8952FC0760A654B886F61BB0A59803B4387B", "383D269D6C7417D0A8716B09F5DB329FB17B45A5EFDBAFB82FF04BC420DCF7D5" ], "deposit_authorized": true, "destination_account": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8", "ledger_hash": "BD03A10653ED9D77DCA859B7A735BF0580088A8F287FA2C5403E0A19C58EF322", "ledger_index": 8, "source_account": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de", "status": "success", "validated": true } } ``` --- ## `get_aggregate_price` > Calculates the aggregate price of specified Oracle instances. The `get_aggregate_price` method retrieves the aggregate price of specified `Oracle` objects, returning three price statistics: mean, median, and trimmed mean. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `base_asset` (string; required): The currency code of the asset to be priced. * `quote_asset` (string; required): The currency code of the asset to quote the price of the base asset. * `trim` (number; optional): The percentage of outliers to trim. Valid trim range is 1–25. If included, the API returns statistics for the `trimmed mean`. * `trim_threshold` (number; optional): Defines a time range in seconds for filtering out older price data. Default value is 0, which doesn't filter any data. * `oracles` (array; required): An array of oracle identifier objects. You must list between 1 and 200 oracle identifiers. Each member of the `oracles` array is an oracle identifier object with the following fields: * `account` (string; required): The XRPL account that controls the `Oracle` object. * `oracle_document_id` (number; required): A unique identifier of the price oracle for the `Account`. ### Returns * `entire_set` (object): The statistics from the collected oracle prices. * `entire_set.mean` (string — number): The simple mean. * `entire_set.size` (number): The size of the data set to calculate the mean. * `entire_set.standard_deviation` (string — number): The standard deviation. * `trimmed_set` (object; optional): The trimmed statistics from the collected oracle prices. Only appears if the `trim` field was specified in the request. * `trimmed_set.mean` (string — number): The simple mean of the trimmed data. * `trimmed_set.size` (number): The size of the data to calculate the trimmed mean. * `trimmed_set.standard_deviation` (string — number): The standard deviation of the trimmed data. * `time` (number): The most recent timestamp out of all `LastUpdateTime` values, represented in Unix time. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "get_aggregate_price", "params": [ { "ledger_index": "current", "base_asset": "XRP", "quote_asset": "USD", "trim": 20, "oracles": [ { "account": "rNZ9m6AP9K7z3EVg6GhPMx36V4QmZKeWds", "oracle_document_id": 34 }, { "account": "rMVKq8zrVsJZQFEiTARyC6WfZznhhLMcNi", "oracle_document_id": 100 }, { "account": "r92kJTnUbUUq15t2BBZYGYxY79RnNc7rLQ", "oracle_document_id": 2 } ] } ] }' ``` ### Response example ```json { "result": { "entire_set": { "mean": "0.78", "size": 3, "standard_deviation": "0.03464101615137754" }, "ledger_current_index": 3677185, "median": "0.8", "time": 1724877762, "trimmed_set": { "mean": "0.78", "size": 3, "standard_deviation": "0.03464101615137754" }, "validated": false }, "status": "success", "type": "response" } ``` --- ## `nft_buy_offers` > Retrieves a list of all buy offers for the NFT specified. The `nft_buy_offers` method returns a list of buy offers for a given `NFToken` object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `nft_id` (string; required): The unique identifier of a [NFToken](https://xrpl.org/docs/references/protocol/data-types/nftoken) object. * `ledger_hash` (string; optional): The unique hash of the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `ledger_index` (string or number; optional): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `limit` (integer; optional): Limit the number of NFT buy offers to retrieve. This value cannot be lower than 50 or more than 500. Positive values outside this range are replaced with the closest valid option. The default is 250. * `marker` ([marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): Value from a previous paginated response. Resume retrieving data where that response left off. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `nft_id` (string): The NFToken these offers are for, as specified in the request. * `offers` (array): A list of buy offers for the token. Each of these is formatted as a **Buy Offer** (see below). * `limit` (number; optional): The `limit`, as specified in the request. * `marker` ([marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. Omitted when there are no pages of information after this one. #### Buy Offers Each member of the `offers` array represents one [NFTokenOffer object](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/nftokenoffer) to buy the NFT in question and has the following fields: * `amount` (string or object): The amount offered to buy the NFT for, as a String representing an amount in drops of XRP, or an object representing an amount of a fungible token. (See [Specifying Currency Amounts](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts)) * `flags` (number): A set of bit-flags for this offer. See [NFTokenOffer flags](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/nftokenoffer#nftokenoffer-flags) for possible values. * `nft_offer_index` (string): The [ledger object ID](https://xrpl.org/docs/references/protocol/ledger-data/common-fields) of this offer. * `owner` (string): The account that placed this offer. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "nft_buy_offers", "params": [ { "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007", "ledger_index": "validated" } ] }' ``` ### Response example ```json { "result": { "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007", "offers": [ { "amount": "1500", "flags": 0, "nft_offer_index": "3212D26DB00031889D4EF7D9129BB0FA673B5B40B1759564486C0F0946BA203F", "owner": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx" } ], "status": "success" } } ``` --- ## `nft_sell_offers` > Retrieves a list of all sell offers for the NFT specified. The `nft_sell_offers` method returns a list of sell offers for a given [NFToken](https://xrpl.org/docs/references/protocol/data-types/nftoken) object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `nft_id` (string; required): The unique identifier of a [NFToken](https://xrpl.org/docs/references/protocol/data-types/nftoken) object. * `ledger_hash` (string; optional): The unique hash of the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `ledger_index` (string or number; optional): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `limit` (integer; optional): Limit the number of NFT sell offers to retrieve. This value cannot be lower than 50 or more than 500. Positive values outside this range are replaced with the closest valid option. The default is 250. * `marker` (marker; optional): Value from a previous paginated response. Resume retrieving data where that response left off. ### Returns * `nft_id` (string): The NFToken these offers are for, as specified in the request. * `offers` (array): A list of buy offers for the token. Each of these is formatted as a **Sell Offer** (see below). * `limit` (number; optional): The `limit`, as specified in the request. * `marker` (marker; optional): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. Omitted when there are no pages of information after this one. #### Sell Offers Each member of the `offers` array represents one [NFTokenOffer object](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/nftokenoffer) to buy the NFT in question and has the following fields: * `amount` (string or object): The amount offered to sell the NFT for, as a String representing an amount in drops of XRP, or an object representing an amount of a fungible token. (See [Specifying Currency Amounts](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts)) * `flags` (number): A set of bit-flags for this offer. See [NFTokenOffer flags](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/nftokenoffer#nftokenoffer-flags) for possible values. * `nft_offer_index` (string): The [ledger object ID](https://xrpl.org/docs/references/protocol/ledger-data/common-fields) of this offer. * `owner` (string): The account that placed this offer. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "nft_sell_offers", "params": [ { "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007" } ] }' ``` ### Response example ```json { "result": { "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007", "offers": [ { "amount": "1000", "flags": 1, "nft_offer_index": "9E28E366573187F8E5B85CE301F229E061A619EE5A589EF740088F8843BF10A1", "owner": "rLpSRZ1E8JHyNDZeHYsQs1R5cwDCB3uuZt" } ], "status": "success" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/gateway-p2/ title: XRP — gateway, noripple, Methods, ledger (2/2) source: docs/rpc-service/chains/chains-api/xrp/gateway-p2.mdx --- # XRP — gateway, noripple, Methods, ledger (2/2) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/xrp/gateway/) · 2 ## `ledger_closed` > Retrieves the latest closed ledger version. The `ledger_closed` method returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.) ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `ledger_hash` (string): The unique [Hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes) of this ledger version, in hexadecimal. * `ledger_index` (unsigned integer): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of this ledger version. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_closed", "params": [ {} ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "ledger_hash": "3E6CF37B032E232ED6D77900C937647A275C8FE1F9F784F361B1022BB4608172", "ledger_index": 100204931, "status": "success" } } ``` --- ## `ledger_current` > Retrieves the current working ledger version. The `ledger_current` method returns the unique identifiers of the current in-progress [ledger](https://xrpl.org/docs/concepts/ledgers). This command is mostly useful for testing, because the ledger returned is still in flux. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following field: * `ledger_current_index` (unsigned integer — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The ledger index of this ledger version. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_current", "params": [ {} ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "ledger_current_index": 100205074, "status": "success" } } ``` --- ## `ledger_data` > Retrieves the raw contents of a ledger version. The `ledger_data` method retrieves contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): A 20-byte hex string identifying the ledger version to use. * `ledger_index` (number or string; optional): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers).) * `binary` (boolean; optional): If `true`, return ledger entries as hexadecimal strings instead of JSON. The default is `false`. * `limit` (number; optional): Limit the number of ledger entries to retrieve. The server may return fewer than this number of entries. Cannot be more than 2048 (when requesting binary) or 256 (when requesting JSON). Positive values outside this range are replaced with the closest valid option. The default is the maximum. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): Value from a previous paginated response. Resume retrieving data where that response left off. * `type` (string; optional): Filter results to a specific type of ledger entry. This field accepts canonical names of [ledger entry types](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types) (case-insensitive) or [short names](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/ledger-entry-short-names). If omitted, return ledger entries of all types. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `ledger_index` (unsigned integer — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The ledger index of this ledger version. * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes)): Unique identifying hash of this ledger version. * `state` (array): Array of JSON objects containing data from the ledger's state tree, as defined below. * `marker` (string — [marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination)): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. If a `type` field is mentioned in the request, the `state` array will be empty if the first set of array objects does not match the type requested. In such cases, you can use the `marker` from this response to paginate and retrieve further data. The format of each object in the `state` array depends on whether `binary` was set to true or not in the request. Each `state` object may include the following fields: * `data` (string): (Only included if `"binary": true`) Hex representation of the requested data. * `LedgerEntryType` (string): (Only included if `"binary": false`) String indicating what type of ledger object this object represents. See [ledger object types](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types) for the full list. * **(Additional fields)** (various): (Only included if `"binary": false`) Additional fields describing this object, depending on which [ledger object type](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types) it is. * `index` (string): Unique identifier for this ledger entry, as hex. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_data", "params": [ { "binary": true, "ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8", "limit": 5 } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "error": "lgrNotFound", "error_code": 21, "error_message": "ledgerNotFound", "request": { "binary": true, "command": "ledger_data", "ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8", "limit": 5 }, "status": "error" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/gateway/ title: XRP — gateway, noripple, Methods, ledger (1/2) source: docs/rpc-service/chains/chains-api/xrp/gateway.mdx --- # XRP — gateway, noripple, Methods, ledger (1/2) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/xrp/gateway-p2/) ## `gateway_balances` > Calculates total amounts issued by an account. The `gateway_balances` method calculates the total balances issued by a given account, optionally excluding amounts held by [operational addresses](https://xrpl.org/docs/concepts/accounts/account-types). ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string): The [Address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses) to check. This should be the [issuing address](https://xrpl.org/docs/concepts/accounts/account-types). * `strict` (boolean; optional): If `true`, only accept an address or public key for the account parameter. Defaults to `false`. * `hotwallet` (string or array; optional): An [operational address](https://xrpl.org/docs/concepts/accounts/account-types) to exclude from the balances issued, or an array of such addresses. * `ledger_hash` (string; optional): The unique hash of the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers).) * `ledger_index` (string or unsigned integer; optional): The ledger index of the ledger version to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers).) ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses)): The address of the account that issued the balances. * `obligations` (object; omitted if empty): Total amounts issued to addresses not excluded, as a map of currencies to the total value issued. * `balances` (object; omitted if empty): Amounts issued to the `hotwallet` addresses from the request. The keys are addresses and the values are arrays of currency amounts they hold. * `assets` (object; omitted if empty): Total amounts held that are issued by others. In the recommended configuration, the [issuing address](https://xrpl.org/docs/concepts/accounts/account-types) should have none. * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The identifying hash of the ledger version that was used to generate this response. * `ledger_index` (number — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): The ledger index of the ledger version that was used to generate this response. * `ledger_current_index` (number — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): (Omitted if `ledger_current_index` is provided). The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the current in-progress ledger version, which was used to retrieve this information. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "gateway_balances", "params": [ { "account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", "hotwallet": [ "rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ", "ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt" ], "ledger_index": "validated", "strict": true } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", "assets": { "r9F6wk8HkXrgYWoJ7fsv4VrUBVoqDVtzkH": [ { "currency": "BTC", "value": "5444166510000000e-26" } ], "rPU6VbckqCLW4kb51CWqZdxvYyQrQVsnSj": [ { "currency": "BTC", "value": "1029900000000000e-26" } ], "rpR95n1iFkTqpoy1e878f4Z1pVHVtWKMNQ": [ { "currency": "BTC", "value": "4000000000000000e-30" } ], "rwmUaXsWtXU4Z843xSYwgt1is97bgY8yj6": [ { "currency": "BTC", "value": "8700000000000000e-30" } ] }, "balances": { "rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ": [ { "currency": "EUR", "value": "144816.1965999999" } ], "ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt": [ { "currency": "USD", "value": "6677.38614" } ] }, "frozen_balances": { "r4keXr5myiU4iTLh68ZqZ2CgsJ8dM9FSW6": [ { "currency": "BTC", "value": "0.091207822800868" } ] }, "ledger_hash": "9F04F45FC6A7B4BE8DA04580F7E4E23DCCE58A9FD73178296CA70319C5B799F1", "ledger_index": 100185180, "obligations": { "BTC": "1761.964986208178", "EUR": "813788.3511514511", "GBP": "4973.797603049582", "USD": "6734902.401181124" }, "status": "success", "validated": true } } ``` --- ## `noripple_check` > Gets recommended changes to an account's Default Ripple and No Ripple settings. The `noripple_check` command provides a quick way to check the status of [the Default Ripple field for an account and the No Ripple flag of its trust lines](https://xrpl.org/docs/concepts/tokens/fungible-tokens/rippling), compared with the recommended settings. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string): A unique identifier for the account, most commonly the account's address. * `role` (string): Whether the address refers to a `gateway` or `user`. Recommendations depend on the role of the account. Issuers must have Default Ripple enabled and must disable No Ripple on all trust lines. Users should have Default Ripple disabled, and should enable No Ripple on all trust lines. * `transactions` (boolean; optional): If `true`, include an array of suggested [transactions](https://xrpl.org/docs/references/protocol/transactions), as JSON objects, that you can sign and submit to fix the problems. The default is `false`. * `limit` (unsigned integer; optional): The maximum number of trust line problems to include in the results. Defaults to 300. * `ledger_hash` (string; optional): The unique hash of the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers).) * `ledger_index` (string or unsigned integer; optional): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers).) ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `ledger_current_index` (number): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger used to calculate these results. * `problems` (array): Array of strings with human-readable descriptions of the problems. This includes up to one entry if the account's Default Ripple setting is not as recommended, plus up to `limit` entries for trust lines whose No Ripple setting is not as recommended. * `transactions` (array; optional): If the request specified `transactions` as `true`, this is an array of JSON objects, each of which is the JSON form of a [transaction](https://xrpl.org/docs/references/protocol/transactions) that should fix one of the described problems. The length of this array is the same as the `problems` array, and each entry is intended to fix the problem described at the same index into that array. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "noripple_check", "params": [ { "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "ledger_index": "current", "limit": 2, "role": "gateway", "transactions": true } ] }' ``` ### Response example ```json { "result": { "ledger_current_index": 100203014, "problems": [ "You should immediately set your default ripple flag", "You should clear the no ripple flag on your USD line to rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", "You should clear the no ripple flag on your EUR line to rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun", "You should clear the no ripple flag on your CNY line to rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK", "You should clear the no ripple flag on your XAU line to r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", "You should clear the no ripple flag on your 015841551A748AD2C1F76FF6ECB0CCCD00000000 line to rs9M85karFkCRjvc6KMWn8Coigm9cbcgcx", "You should clear the no ripple flag on your AUX line to r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", "You should clear the no ripple flag on your CNY line to razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA", "You should clear the no ripple flag on your JPY line to rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", "You should clear the no ripple flag on your USD line to rfF3PNkwkq1DygW2wum2HK3RGfgkJjdPVD", "You should clear the no ripple flag on your USD line to r9vbV3EHvXWjSkeQ6CAcYVPGeq7TuiXY2X" ], "status": "success", "transactions": [ { "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "Fee": 10, "Sequence": 1406, "SetFlag": 8, "TransactionType": "AccountSet" }, { "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "Fee": 10, "Flags": 262144, "LimitAmount": { "currency": "USD", "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", "value": "5" }, "Sequence": 1407, "TransactionType": "TrustSet" } ], "validated": false } } ``` --- **Ledger Methods**: A ledger version contains a header, a transaction tree, and a state tree, which contain account settings, trustlines, balances, transactions, and other data. Use these methods to retrieve ledger info. ## `ledger` > Retrieves info on the ledger. Retrieves information about the public [ledger](https://xrpl.org/docs/concepts/ledgers). ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): A 32-byte hex string for the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `ledger_index` (number or string; optional): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `transactions` (boolean; optional): If `true`, return information on transactions in the specified ledger version. The default is `false`. Ignored if you did not specify a ledger version. * `expand` (boolean; optional): Provide full JSON-formatted information for transaction/account information instead of only hashes. The default is `false`. Ignored unless you request transactions, accounts, or both. * `owner_funds` (boolean; optional): If `true`, include `owner_funds` field in the metadata of OfferCreate transactions in the response. The default is `false`. Ignored unless transactions are included and `expand` is `true`. * `binary` (boolean; optional): If `true`, and `transactions` and `expand` are both also `true`, return transaction information in binary format (hexadecimal string) instead of JSON format. * `queue` (boolean; optional): If `true`, and the command is requesting the `current` ledger, includes an array of [queued transactions](https://xrpl.org/docs/concepts/transactions/transaction-cost#queued-transactions) in the results. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing information about the ledger, including the following fields: * `ledger` (object): The complete [ledger header data](https://xrpl.org/docs/references/protocol/ledger-data/ledger-header) of this ledger, with some additional fields added for convenience. * `ledger.account_hash` (string): [Hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes) of all account state information in this ledger, as hexadecimal. * `ledger.close_flags` (number): A bit-map of [flags relating to the closing of this ledger](https://xrpl.org/docs/references/protocol/ledger-data/ledger-header#close-flags). * `ledger.close_time` (number): The time this ledger was closed, in [seconds since the Ripple Epoch](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time). * `ledger.close_time_human` (string): The time this ledger was closed, in human-readable format. Always uses the UTC time zone. * `ledger.close_time_resolution` (number): Ledger close times are rounded to within this many seconds. * `ledger.closed` (boolean): Whether this ledger has been closed or not. * `ledger.ledger_hash` (string): Unique identifying hash of the entire ledger. * `ledger.ledger_index` (string — [API v1](https://xrpl.org/docs/references/http-websocket-apis#api-versioning); number — [API v2](https://xrpl.org/docs/references/http-websocket-apis#api-versioning)): The [Ledger Index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of this ledger. * `ledger.parent_close_time` (number): The time at which the previous ledger was closed. * `ledger.parent_hash` (string): The unique identifying hash of the ledger that came immediately before this one, as hexadecimal. * `ledger.total_coins` (string): Total number of XRP drops in the network, as a quoted integer. (This decreases as transaction costs destroy XRP.) * `ledger.transaction_hash` (string): [Hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes) of the transaction information included in this ledger. * `ledger.transactions` (array; optional): Transactions applied in this ledger version. By default, members are the transactions’ identifying [Hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes) strings. If the request specified `expand` as `true`, members are full representations of the transactions instead, in either JSON or binary depending on whether the request specified `binary` as `true`. * `ledger_hash` (string): The unique identifying hash of the entire ledger, as hexadecimal. * `ledger_index` (number): The [Ledger Index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of this ledger. * `validated` (boolean; optional): If `true`, this is a validated ledger version. If omitted or set to `false`, this ledger’s data is not final. * `queue_data` (array; optional): (Omitted unless requested with the `queue` parameter) Array of objects describing queued transactions, in the same order as the queue. If the request specified `expand` as `true`, members contain full representations of the transactions, in either JSON or binary depending on whether the request specified `binary` as `true`. Each member of the `queue_data` array represents one transaction in the queue. Some fields of this object may be omitted because they have not yet been calculated. The fields of this object are as follows: * `account` (string): The [Address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses) of the sender for this queued transaction. * `tx` (string or object): By default, this is a string containing the identifying hash of the transaction. If transactions are expanded in binary format, this is an object whose only field is `tx_blob`, containing the binary form of the transaction as a decimal string. If transactions are expanded in JSON format, this is an object containing the transaction object including the transaction's identifying hash in the `hash` field. * `retries_remaining` (number): How many times this transaction can be retried before being dropped. * `preflight_result` (string): The tentative result from preliminary transaction checking. This is always `tesSUCCESS`. * `last_result` (string; optional): If this transaction was left in the queue after getting a [retriable (`ter`) result](https://xrpl.org/docs/references/protocol/transactions/transaction-results/ter-codes), this is the exact `ter` result code it got. * `auth_change` (boolean; optional): Whether this transaction changes this address's [ways of authorizing transactions](https://xrpl.org/docs/concepts/transactions#authorizing-transactions). * `fee` (string; optional): The [Transaction Cost](https://xrpl.org/docs/concepts/transactions/transaction-cost) of this transaction, in [drops of XRP](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts). * `fee_level` (string; optional): The transaction cost of this transaction, relative to the minimum cost for this type of transaction, in fee levels. * `max_spend_drops` (string; optional): The maximum amount of [XRP, in drops](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts), this transaction could potentially send or destroy. If the request specified `"owner_funds": true` and expanded transactions, the response has a field `owner_funds` in the `metaData` object of each [OfferCreate transaction](https://xrpl.org/docs/references/protocol/transactions/types/offercreate). The purpose of this field is to make it easier to track the [funding status of offers](https://xrpl.org/docs/concepts/tokens/decentralized-exchange/offers#lifecycle-of-an-offer) with each new validated ledger. This field is defined slightly differently than the version of this field in [Order Book subscription streams](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/subscription-methods/subscribe#order-book-streams): * `owner_funds` (string): Numeric amount of the `TakerGets` currency that the `Account` sending this OfferCreate transaction has after the execution of all transactions in this ledger. This does not check whether the currency amount is [frozen](https://xrpl.org/docs/concepts/tokens/fungible-tokens/freezes). ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger", "params": [ { "ledger_index": "validated", "transactions": false, "expand": false, "owner_funds": false } ] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "ledger": { "account_hash": "E8C6EF996B38EFC2E297B3165F6B687433B1DF137BDCF804C0B0F9E393E0D045", "close_flags": 0, "close_time": 816442750, "close_time_human": "2025-Nov-14 13:39:10.000000000 UTC", "close_time_iso": "2025-11-14T13:39:10Z", "close_time_resolution": 10, "closed": true, "ledger_hash": "344AC8FCFC579E9EAC59CAFEBCC1E2EA36A261F4EB2A6CC649380C351F402397", "ledger_index": "100204822", "parent_close_time": 816442741, "parent_hash": "ADA5D8A5A554881A9E45A8EC88FBDADD5D4D47213F0FFBCE23001AD7E37B5768", "total_coins": "99985759346884737", "transaction_hash": "03E26EC74BFBEEFEBD19FD512A16809C1A165B1A2F9CFF4BFD987994FCA60334" }, "ledger_hash": "344AC8FCFC579E9EAC59CAFEBCC1E2EA36A261F4EB2A6CC649380C351F402397", "ledger_index": 100204822, "status": "success", "validated": true } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/ title: XRP description: The XRP Ledger (XRPL) is a decentralized blockchain optimized for fast, low-cost payments and asset transfers. 43 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/xrp/index.mdx --- # XRP
> XRP API is available on [Web3 API platform](https://www.ankr.com/rpc/xrp). The XRP Ledger (XRPL) is a decentralized blockchain optimized for fast, low-cost payments and asset transfers. It uses a federated consensus algorithm in which a trusted set of validators propose and agree on transactions; once 80%+ reach consensus, a new ledger is finalized in 3–5 seconds with deterministic finality. XRPL supports native issued assets, a built-in DEX, escrows, payment channels, and multi-signing. In order for your Web3 application to interact with XRP — either by reading blockchain data or sending transactions to the network — it must connect to an XRP node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. :::info **Transaction history window.** Ankr XRP Ledger nodes are full nodes (not archive): they retain roughly the last **2 weeks** of history (~360,000-380,000 ledgers). Requests for older ledgers or transactions will fail - there is no archive backfill and genesis history is unavailable. For deep historical XRPL data, use a dedicated archive or explorer service. ::: ## Methods supported **Account Methods**: An account in the XRP Ledger represents a holder of XRP and a sender of transactions. Use these methods to work with account info. * [`account_channels`](/rpc-service/chains/chains-api/xrp/account/#account_channels) — retrieves a list of payment channels where the account is the source of the channel. * [`account_currencies`](/rpc-service/chains/chains-api/xrp/account/#account_currencies) — retrieves a list of currencies an account can send or receive. * [`account_info`](/rpc-service/chains/chains-api/xrp/account/#account_info) — retrieves basic data on the account. * [`account_lines`](/rpc-service/chains/chains-api/xrp/account-p2/#account_lines) — retrieves info on the account's trust lines. * [`account_nfts`](/rpc-service/chains/chains-api/xrp/account-p2/#account_nfts) — retrieves a list of all NFTs for an account. * [`account_objects`](/rpc-service/chains/chains-api/xrp/account-p2/#account_objects) — retrieves all ledger objects owned by an account. * [`account_offers`](/rpc-service/chains/chains-api/xrp/account-p2/#account_offers) — retrieves info on the account's currency exchange offers. * [`account_tx`](/rpc-service/chains/chains-api/xrp/account-p3/#account_tx) — retrieves a list of transactions affecting an account. * [`gateway_balances`](/rpc-service/chains/chains-api/xrp/gateway/#gateway_balances) — calculates total amounts issued by an account. * [`noripple_check`](/rpc-service/chains/chains-api/xrp/gateway/#noripple_check) — gets recommended changes to an account's Default Ripple and No Ripple settings. **Ledger Methods**: A ledger version contains a header, a transaction tree, and a state tree, which contain account settings, trustlines, balances, transactions, and other data. Use these methods to retrieve ledger info. * [`ledger`](/rpc-service/chains/chains-api/xrp/gateway/#ledger) — retrieves info on the ledger. * [`ledger_closed`](/rpc-service/chains/chains-api/xrp/gateway-p2/#ledger_closed) — retrieves the latest closed ledger version. * [`ledger_current`](/rpc-service/chains/chains-api/xrp/gateway-p2/#ledger_current) — retrieves the current working ledger version. * [`ledger_data`](/rpc-service/chains/chains-api/xrp/gateway-p2/#ledger_data) — retrieves the raw contents of a ledger version. * [`ledger_entry`](/rpc-service/chains/chains-api/xrp/ledger/#ledger_entry) — retrieves a single item from a ledger version. **Transaction Methods**: Transactions are the only thing that can modify the shared state of the XRP Ledger. All business on the XRP Ledger takes the form of transactions. Use these methods to work with transactions. * [`simulate`](/rpc-service/chains/chains-api/xrp/ledger-p2/#simulate) — executes a dry run of any transaction type to preview results and metadata. * [`submit`](/rpc-service/chains/chains-api/xrp/methods/#submit) — sends a transaction to the network. * [`submit_multisigned`](/rpc-service/chains/chains-api/xrp/methods/#submit_multisigned) — sends a multi-signed transaction to the network. * [`transaction_entry`](/rpc-service/chains/chains-api/xrp/methods-p2/#transaction_entry) — retrieves info on the transaction from a particular ledger version. * [`tx`](/rpc-service/chains/chains-api/xrp/methods-p2/#tx) — retrieves info on the transaction from all the ledgers at hand. * [`tx_history`](/rpc-service/chains/chains-api/xrp/methods-p2/#tx_history) — retrieves info on all recent transactions. **Path and Order Book Methods**: Paths define a way for payments to flow through intermediary steps on their way from sender to receiver. Paths enable cross-currency payments by connecting sender and receiver through order books. Use these methods to work with paths and other books. * [`amm_info`](/rpc-service/chains/chains-api/xrp/methods-p2/#amm_info) — retrieves info on the Automated Market Maker (AMM) instance. * [`book_changes`](/rpc-service/chains/chains-api/xrp/methods-p3/#book_changes) — retrieves information on order book changes. * [`book_offers`](/rpc-service/chains/chains-api/xrp/book/#book_offers) — retrieves info on the currency exchange offers. * [`deposit_authorized`](/rpc-service/chains/chains-api/xrp/book/#deposit_authorized) — checks whether an account is authorized to send money directly to another account. * [`get_aggregate_price`](/rpc-service/chains/chains-api/xrp/book/#get_aggregate_price) — calculates the aggregate price of specified Oracle instances. * [`nft_buy_offers`](/rpc-service/chains/chains-api/xrp/book/#nft_buy_offers) — retrieves a list of all buy offers for the NFT specified. * [`nft_sell_offers`](/rpc-service/chains/chains-api/xrp/book/#nft_sell_offers) — retrieves a list of all sell offers for the NFT specified. * [`ripple_path_find`](/rpc-service/chains/chains-api/xrp/book-p2/#ripple_path_find) — finds a path for payment between two accounts, once. **Payment Channel Methods**: Payment channels are a tool for facilitating repeated, unidirectional payments, or temporary credit between two parties. Use these methods to work with payment channels. * [`channel_verify`](/rpc-service/chains/chains-api/xrp/book-p2/#channel_verify) — checks a payment channel claim's signature. **Server Info Methods**: Use these methods to retrieve information about the current state of the rippled server. * [`fee`](/rpc-service/chains/chains-api/xrp/book-p2/#fee) — retrieves information on the transaction cost. * [`feature`](/rpc-service/chains/chains-api/xrp/book-p2/#feature) — retrieves information on the protocol amendments. * [`manifest`](/rpc-service/chains/chains-api/xrp/book-p2/#manifest) — retrieves public information on a known validator. * [`server_definitions`](/rpc-service/chains/chains-api/xrp/book-p2/#server_definitions) — retrieves an SDK-compatible `definitions.json`, generated from the `rippled` instance currently running. * [`server_info (rippled)`](/rpc-service/chains/chains-api/xrp/server/#server_info-rippled) — retrieves status of the server in human-readable format. * [`server_state`](/rpc-service/chains/chains-api/xrp/server/#server_state) — retrieves status of the server in machine-readable format. * [`version`](/rpc-service/chains/chains-api/xrp/server-p2/#version) — retrieves API version information. **Clio Methods**: These API methods are provided only by the Clio server, not `rippled`. * [`server_info`](/rpc-service/chains/chains-api/xrp/server-p2/#server_info) — retrieves status of the Clio server in human-readable format. * [`ledger`](/rpc-service/chains/chains-api/xrp/gateway/#ledger) — retrieves info on the ledger version. * [`mpt_holders`](/rpc-service/chains/chains-api/xrp/server-p2/#mpt_holders) — retrieves the holders of a given MPT issuance for a given ledger. * [`version`](/rpc-service/chains/chains-api/xrp/server-p2/#version) — retrieves API version information. **Utility Methods**: Use these methods to perform convenient tasks, such as ping and random number generation. * [`ping`](/rpc-service/chains/chains-api/xrp/server-p3/#ping) — confirms connectivity with the server. * [`random`](/rpc-service/chains/chains-api/xrp/server-p3/#random) — generates a random number. --- **Account Methods**: An account in the XRP Ledger represents a holder of XRP and a sender of transactions. Use these methods to work with account info. ## Methods ### account - [`account_channels`](/rpc-service/chains/chains-api/xrp/account/#account_channels) - [`account_currencies`](/rpc-service/chains/chains-api/xrp/account/#account_currencies) - [`account_info`](/rpc-service/chains/chains-api/xrp/account/#account_info) - [`account_lines`](/rpc-service/chains/chains-api/xrp/account-p2/#account_lines) - [`account_nfts`](/rpc-service/chains/chains-api/xrp/account-p2/#account_nfts) - [`account_objects`](/rpc-service/chains/chains-api/xrp/account-p2/#account_objects) - [`account_offers`](/rpc-service/chains/chains-api/xrp/account-p2/#account_offers) - [`account_tx`](/rpc-service/chains/chains-api/xrp/account-p3/#account_tx) ### gateway, noripple, Methods, ledger - [`gateway_balances`](/rpc-service/chains/chains-api/xrp/gateway/#gateway_balances) - [`noripple_check`](/rpc-service/chains/chains-api/xrp/gateway/#noripple_check) - [`ledger`](/rpc-service/chains/chains-api/xrp/gateway/#ledger) - [`ledger_closed`](/rpc-service/chains/chains-api/xrp/gateway-p2/#ledger_closed) - [`ledger_current`](/rpc-service/chains/chains-api/xrp/gateway-p2/#ledger_current) - [`ledger_data`](/rpc-service/chains/chains-api/xrp/gateway-p2/#ledger_data) ### ledger, Methods - [`ledger_entry`](/rpc-service/chains/chains-api/xrp/ledger/#ledger_entry) - [`simulate`](/rpc-service/chains/chains-api/xrp/ledger-p2/#simulate) ### Methods, submit, transaction, tx, amm, book - [`submit`](/rpc-service/chains/chains-api/xrp/methods/#submit) - [`submit_multisigned`](/rpc-service/chains/chains-api/xrp/methods/#submit_multisigned) - [`transaction_entry`](/rpc-service/chains/chains-api/xrp/methods-p2/#transaction_entry) - [`tx`](/rpc-service/chains/chains-api/xrp/methods-p2/#tx) - [`tx_history`](/rpc-service/chains/chains-api/xrp/methods-p2/#tx_history) - [`amm_info`](/rpc-service/chains/chains-api/xrp/methods-p2/#amm_info) - [`book_changes`](/rpc-service/chains/chains-api/xrp/methods-p3/#book_changes) ### book, deposit, get, nft, ripple, channel, Methods, server - [`book_offers`](/rpc-service/chains/chains-api/xrp/book/#book_offers) - [`deposit_authorized`](/rpc-service/chains/chains-api/xrp/book/#deposit_authorized) - [`get_aggregate_price`](/rpc-service/chains/chains-api/xrp/book/#get_aggregate_price) - [`nft_buy_offers`](/rpc-service/chains/chains-api/xrp/book/#nft_buy_offers) - [`nft_sell_offers`](/rpc-service/chains/chains-api/xrp/book/#nft_sell_offers) - [`ripple_path_find`](/rpc-service/chains/chains-api/xrp/book-p2/#ripple_path_find) - [`channel_verify`](/rpc-service/chains/chains-api/xrp/book-p2/#channel_verify) - [`fee`](/rpc-service/chains/chains-api/xrp/book-p2/#fee) - [`feature`](/rpc-service/chains/chains-api/xrp/book-p2/#feature) - [`manifest`](/rpc-service/chains/chains-api/xrp/book-p2/#manifest) - [`server_definitions`](/rpc-service/chains/chains-api/xrp/book-p2/#server_definitions) ### server, Methods, mpt - [`server_info (rippled)`](/rpc-service/chains/chains-api/xrp/server/#server_info-rippled) - [`server_state`](/rpc-service/chains/chains-api/xrp/server/#server_state) - [`version`](/rpc-service/chains/chains-api/xrp/server-p2/#version) - [`server_info`](/rpc-service/chains/chains-api/xrp/server-p2/#server_info) - [`ledger`](/rpc-service/chains/chains-api/xrp/gateway/#ledger) - [`mpt_holders`](/rpc-service/chains/chains-api/xrp/server-p2/#mpt_holders) - [`version`](/rpc-service/chains/chains-api/xrp/server-p2/#version) - [`ping`](/rpc-service/chains/chains-api/xrp/server-p3/#ping) - [`random`](/rpc-service/chains/chains-api/xrp/server-p3/#random) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/ledger-p2/ title: XRP — ledger, Methods (2/2) source: docs/rpc-service/chains/chains-api/xrp/ledger-p2.mdx --- # XRP — ledger, Methods (2/2) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/xrp/ledger/) · 2 ## `ledger_entry` ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `index` (string): The unique ID of this [ledger entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types). * `ledger_index` (unsigned integer): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger that was used when retrieving this data. * `node` (object; omitted if `"binary": true`): Object containing the data of this ledger entry, according to the [ledger format](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types). * `node_binary` (string; omitted unless `"binary": true`): The [binary representation](https://xrpl.org/docs/references/protocol/binary-format) of the ledger object, as hexadecimal. * `deleted_ledger_index` (string; Clio server only): Returned if include_deleted parameter is set. The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) where the ledger entry object was deleted. --- **Transaction Methods**: Transactions are the only thing that can modify the shared state of the XRP Ledger. All business on the XRP Ledger takes the form of transactions. Use these methods to work with transactions. ## `simulate` > Executes a dry run of any transaction type to preview results and metadata. The `simulate` method executes a dry run of any transaction type, enabling you to preview the results and metadata of a transaction without committing them to the XRP Ledger. Since this command never submits a transaction to the network, it doesn't incur any fees. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `tx_blob` (string; required): The transaction to simulate, in binary format. If you include this field, do not also include `tx_json`. * `tx_json` (object; required): The transaction to simulate, in JSON format. If you include this field, do not also include `tx_blob`. * `binary` (boolean; optional): The default value is `false`, which returns data and metadata in JSON format. If `true`, returns data and metadata in binary format, serialized to a hexadecimal string. Note: * The simulated transaction must be unsigned. * If the `Fee`, `Sequence`, `SigningPubKey`, or `NetworkID` fields are provided, they will be used in the transaction. Otherwise, the server will autofill them. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `tx_json` (object): The transaction that was simulated, including auto-filled values. Included if `binary` was `false`. * `tx_blob` (string): The serialized transaction that was simulated, including auto-filled values. Included if `binary` was `true`. * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The ledger index of the ledger that would have included this transaction. * `meta` (object): Transaction metadata, which describes the results of the transaction. Not included if the transaction fails with a code that means it wouldn’t be included in the ledger (such as a non-TEC code). Included if `binary` was `false`. * `meta_blob` (string): Transaction metadata, which describes the results of the transaction. Not included if the transaction fails with a code that means it wouldn’t be included in the ledger (such as a non-TEC code). Included if `binary` was `true`. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "simulate", "params": [ { "tx_json": { "TransactionType": "Payment", "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "Amount": { "currency": "USD", "value": "1", "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn" } } } ] }' ``` ### Response example ```json { "result": { "applied": false, "engine_result": "tesSUCCESS", "engine_result_code": 0, "engine_result_message": "The simulated transaction would have been applied.", "ledger_index": 100512217, "meta": { "AffectedNodes": [ { "ModifiedNode": { "FinalFields": { "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "AccountTxnID": "42BDE75B7309C46BBA7FFC867DDA29DFCB2C066AA3866CF9076280A2DE63FE3C", "Balance": "1138222640", "Domain": "6D64756F31332E636F6D", "EmailHash": "98B4375E1D753E5B91627516F6D70977", "Flags": 9568256, "MessageKey": "0000000000000000000000070000000300", "OwnerCount": 17, "RegularKey": "rD9iJmieYHn8jTtPjwwkW2Wm9sVDvPXLoJ", "Sequence": 394, "TicketCount": 5, "TransferRate": 4294967295 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8", "PreviousFields": { "AccountTxnID": "932CC7E9BAC1F7B9FA5381679F293EEC0A646E5E7F2F6D14C85FEE2102F0E66C", "Balance": "1138222650", "Sequence": 393 }, "PreviousTxnID": "E5C3578BDBEBDCDE7E1697E3BA6A1CF04B17CCEBDE4939200680FEF530C7978E", "PreviousTxnLgrSeq": 94448149 } } ], "TransactionIndex": 126, "TransactionResult": "tesSUCCESS" }, "status": "success", "tx_json": { "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Amount": { "currency": "USD", "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "value": "1" }, "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "Fee": "10", "Sequence": 393, "SigningPubKey": "", "TransactionType": "Payment", "TxnSignature": "", "hash": "42BDE75B7309C46BBA7FFC867DDA29DFCB2C066AA3866CF9076280A2DE63FE3C" } } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/ledger/ title: XRP — ledger, Methods (1/2) source: docs/rpc-service/chains/chains-api/xrp/ledger.mdx --- # XRP — ledger, Methods (1/2) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/xrp/ledger-p2/) ## `ledger_entry` > Retrieves a single item from a ledger version. The `ledger_entry` method returns a single ledger entry from the XRP Ledger in its raw format. See [ledger format](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types) for information on the different types of entries you can retrieve. ### Request format This method can retrieve several distinct types of data. You can select which type of item to retrieve by passing the appropriate parameters, comprised of the general and type-specific fields listed below, and following the standard [request formatting](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting). (For example, a WebSocket request always has the `command` field and optionally an id field, and a JSON-RPC request uses the `method` and `params` fields.) #### General fields * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `binary` (boolean; optional): If `true`, return the requested ledger entry's contents as a hex string in the XRP Ledger's [binary format](https://xrpl.org/docs/references/protocol/binary-format). Otherwise, return data in JSON format. The default is `false`. * `ledger_hash` (string; optional): The unique hash of the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers).) * `ledger_index` (string or unsigned integer; optional): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string (e.g. "validated", "closed", or "current") to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers).) * `include_deleted` (boolean; optional, Clio servers only): If set to `true` and the queried object has been deleted, returns its complete data as it was prior to its deletion. If set to `false` or not provided, and the queried object has been deleted, returns `objectNotFound` (current behavior). #### Specific fields In addition to the general fields above, you must specify exactly 1 of the specific fields to indicate what type of entry to retrieve, along with its sub-fields as appropriate. The valid fields are: * [Get Ledger Entry by ID](/rpc-service/chains/chains-api/xrp/ledger/#get-ledger-entry-by-id) * [Get AccountRoot Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-accountroot-entry) * [Get AMM Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-amm-entry) * [Get Bridge Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-bridge-entry) * [Get Credential Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-credential-entry) * [Get DirectoryNode Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-directorynode-entry) * [Get Offer Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-offer-entry) * [Get Oracle Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-oracle-entry) * [Get RippleState Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-ripplestate-entry) * [Get Check Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-check-entry) * [Get Escrow Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-escrow-entry) * [Get PayChannel Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-paychannel-entry) * [Get DepositPreauth Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-depositpreauth-entry) * [Get Ticket Entry](/rpc-service/chains/chains-api/xrp/ledger/#get-ticket-entry) * [Get NFT Page](/rpc-service/chains/chains-api/xrp/ledger/#get-nft-page) * [Get MPT Issuance Object](/rpc-service/chains/chains-api/xrp/ledger/#get-mpt-issuance-object) * [Get MPToken Object](/rpc-service/chains/chains-api/xrp/ledger/#get-mptoken-object) #### Get Ledger Entry by ID Retrieve any type of ledger entry by its unique ID. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `index` (string): The [ledger entry ID](https://xrpl.org/docs/references/protocol/ledger-data/common-fields) of a single entry to retrieve from the ledger, as a 64-character (256-bit) hexadecimal string. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4", "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "result": { "index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4", "ledger_hash": "0F7D2D0313C7A3D69433AEAB715D8034A7B5F9E07534FDEB211EBD25A99753DE", "ledger_index": 100449979, "node": { "Amendments": [ "42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE", "4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373", "6781F8368C4771B83E8B821D88F580202BCB4228075297B19E4FDC5233F1EFDC", "740352F2412A9909880C23A559FCECEDA3BE2126FED62FC7660D628A06927F11" ], "Flags": 0, "LedgerEntryType": "Amendments", "PreviousTxnID": "14853FF2D09D198B576A531C50883C59D71474BA9072C1F5C0ED1DD57882B922", "PreviousTxnLgrSeq": 99226369, "index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4" }, "status": "success", "validated": true } } ``` --- #### Get AccountRoot Entry Retrieve an AccountRoot entry by its address. This is roughly equivalent to the `account_info` method. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account_root` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses)): The classic address of the [AccountRoot](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/accountroot) entry to retrieve. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "account_root": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8", "ledger_hash": "F12172CAE7E0B4E9283323ACFEC6FA41212A7B10F2D530FD0D891D4044533E01", "ledger_index": 100469352, "node": { "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "AccountTxnID": "932CC7E9BAC1F7B9FA5381679F293EEC0A646E5E7F2F6D14C85FEE2102F0E66C", "Balance": "1138222650", "Domain": "6D64756F31332E636F6D", "EmailHash": "98B4375E1D753E5B91627516F6D70977", "Flags": 9568256, "LedgerEntryType": "AccountRoot", "MessageKey": "0000000000000000000000070000000300", "OwnerCount": 17, "PreviousTxnID": "E5C3578BDBEBDCDE7E1697E3BA6A1CF04B17CCEBDE4939200680FEF530C7978E", "PreviousTxnLgrSeq": 94448149, "RegularKey": "rD9iJmieYHn8jTtPjwwkW2Wm9sVDvPXLoJ", "Sequence": 393, "TicketCount": 5, "TransferRate": 4294967295, "index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8" }, "status": "success", "validated": true } } ``` --- #### Get AMM Entry Retrieve an Automated Market-Maker (AMM) object from the ledger. This is similar to `amm_info` method but the `ledger_entry` version returns only the ledger entry as stored. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `amm` (object or string): The AMM to retrieve. If you specify a string, it must be the object ID of the AMM, as hexadecimal. If you specify an object, it must contain `asset` and `asset2` sub-fields. * `amm.asset` (object): One of the two assets in this AMM's pool, as a [currency object without an amount](https://xrpl.org/docs/references/protocol/data-types/currency-formats#specifying-without-amounts). * `amm.asset2` (object): The other of the two assets in this AMM's pool, as a [currency object without an amount]https://xrpl.org/docs/references/protocol/data-types/currency-formats#specifying-without-amounts. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "amm": { "asset": { "currency": "string" }, "asset2": { "currency" : "string", "issuer" : "string" } }, "ledger_index": "string" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "ledger_hash": "string", "ledger_index": integer, "node": { "LedgerEntryType": "string", "index": "string", "AMM": { "Asset": { "currency": "string", "issuer": "string" }, "Asset2": { "currency": "string", "issuer": "string" }, "LPTokenBalance": "string", "TradingFee": integer, "VoteSlots": [ { "Account": "string", "TradingFee": integer, "VoteWeight": "string" } ], "AuctionSlot": { "Account": "string", "Price": { "value": "string", "currency": "string", "issuer": "string" }, "Expiration": integer } }, "Flags": integer }, "validated": boolean } } ``` --- #### Get Bridge Entry (Requires the [XChainBridge amendment](https://xrpl.org/resources/known-amendments#xchainbridge).) Retrieve a [Bridge entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/bridge) which represents a single cross-chain bridge that connects the XRP Ledger with another blockchain. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `bridge_account` (string): The account that submitted the `XChainCreateBridge` transaction on the blockchain. * `bridge` (object): The [Bridge](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/bridge) to retrieve. Includes the door accounts and assets on the issuing and locking chain. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "bridge_account": "string", "bridge": { "locking_chain_door": "string", "locking_chain_issue": { "currency": "string", "issuer": "string" }, "issuing_chain_door": "string", "issuing_chain_issue": { "currency": "string", "issuer": "string" } } } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "ledger_hash": "string", "ledger_index": integer, "node": { "LedgerEntryType": "string", "index": "string", "Bridge": { "LockingChainDoor": "string", "LockingChainIssue": { "currency": "string", "issuer": "string" }, "IssuingChainDoor": "string", "IssuingChainIssue": { "currency": "string", "issuer": "string" } }, "Flags": integer, "OwnerNode": "string" }, "validated": boolean } } ``` --- #### Get Credential Entry Retrieve a [Credential entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/credential), which represents an attestation by one account about another account. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `credential` (object or string; required): Specify the Credential to retrieve. If a string, must be the ledger entry ID of the entry, as hexadecimal. If an object, requires `subject`, `issuer`, and `credential_type` sub-fields. * `credential.subject` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The account that is the subject of the credential. * `credential.issuer` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The account that issued the credential. * `credential.credential_type` (string — hexadecimal; required): The type of the credential, as issued. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "credential": { "subject": "string", "issuer": "string", "credential_type": "string" }, "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "ledger_hash": "string", "ledger_index": integer, "node": { "LedgerEntryType": "string", "index": "string", "Credential": { "Subject": "string", "Issuer": "string", "CredentialType": "string" }, "Flags": integer }, "validated": boolean } } ``` --- #### Get DirectoryNode Entry Retrieve a [DirectoryNode](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/directorynode) which contains a list of other ledger objects. Can be provided as string (object ID of the Directory) or as an object. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `directory` (object or string): The [DirectoryNode](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/directorynode) to retrieve. If a string, must be the [object ID](https://xrpl.org/docs/references/protocol/ledger-data/common-fields) of the directory, as hexadecimal. If an object, requires either `dir_root` or `owner` as a sub-field, plus optionally a `sub_index` sub-field. * `directory.sub_index` (unsigned integer; optional): If provided, jumps to a later "page" of the [DirectoryNode](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/directorynode). * `directory.dir_root` (string; optional): Unique index identifying the directory to retrieve, as a hex string. * `directory.owner` (string; optional): Unique address of the account associated with this directory. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "directory": { "owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "sub_index": 0 }, "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "result": { "index": "3B9C0CE77FCE7BCEE1A68F1E26AC467AF326239D0D816CE705E4A0E2DAD03F6D", "ledger_hash": "C36B922A1D7453928D8477DCE0F512DC914F3DBC8C099780895588A412CFB31D", "ledger_index": 100471753, "node": { "Flags": 0, "Indexes": [ "0D9D9CDDB28263938B423CE74FF3B4F6D960BA0F16EB7CEB36AB7937439ED73A", "28ADCBD6F9A4B18949EC5CDBB3411F1D5826ED0ECB149AE14AED6D8784EA39EE", "556B13E58990CC22D3379BCC6D55F46237F11713AD809DF3E7860DAB55B7F3EF", "6451BF1D41FCDA846C4B60E6F4E4914F1C4EC3015FF978642B7358A14DAE1C26", "6C3556BE2D440A3BEE999CC77657BA8F5DC473DFE44D4E11A8EE45B49F15FD4A", "731A16474E86C07C62B3042BD2C223ED85EBD54E3B540E7E2739187EF9B483BA" ], "LedgerEntryType": "DirectoryNode", "Owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "PreviousTxnID": "DDA5BDDF8DA08065B36548BE127730CB160B106DCCF9476ABB2FABE61BA3135C", "PreviousTxnLgrSeq": 94384123, "RootIndex": "3B9C0CE77FCE7BCEE1A68F1E26AC467AF326239D0D816CE705E4A0E2DAD03F6D", "index": "3B9C0CE77FCE7BCEE1A68F1E26AC467AF326239D0D816CE705E4A0E2DAD03F6D" }, "status": "success", "validated": true } } ``` --- #### Get Offer Entry Retrieve an [Offer entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/offer) which defines an offer to exchange currency. Can be provided as string (unique index of the Offer) or as an object. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `offer` (object or string): If a string, interpret as [ledger entry ID](https://xrpl.org/docs/references/protocol/ledger-data/common-fields) of the Offer to retrieve. If an object, requires the sub-fields `account` and `seq` to uniquely identify the offer. * `offer.account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required if `offer` is an object): The account that placed the offer. * `offer.seq` (unsigned integer; required if `offer` is an object): The [Sequence Number](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#account-sequence) of the transaction that created the Offer entry. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "offer": { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "seq": 359 }, "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "index": "D0A063DEE0B0EC9522CF35CD55771B5DCAFA19A133EE46A0295E4D089AF86438", "ledger_hash": "9D360371ABE2F2FA4AFE1FB489988E752792185975CE1CEEFACE1B86CB327AAD", "ledger_index": 100471866, "node": { "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "BookDirectory": "5A70682882F317175860A1188FAFF2757537D1A66B8500894E038D7EA4C68000", "BookNode": "0", "Flags": 0, "LedgerEntryType": "Offer", "OwnerNode": "0", "PreviousTxnID": "2B44EBE00728D04658E597A85EC4F71D20503B31ABBF556764AD8F7A80BA72F6", "PreviousTxnLgrSeq": 18555460, "Sequence": 359, "TakerGets": "1000000000", "TakerPays": { "currency": "FOO", "issuer": "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v", "value": "100" }, "index": "D0A063DEE0B0EC9522CF35CD55771B5DCAFA19A133EE46A0295E4D089AF86438" }, "status": "success", "validated": true } } ``` --- #### Get Oracle Entry Retrieve an [Oracle entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/oracle) which represents a single price oracle that can store token prices. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `oracle` (object; required): The oracle identifier. * `oracle.account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The account that controls the `Oracle` object. * `oracle.oracle_document_id` (number; required): A unique identifier of the price oracle for the `Account`. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "oracle" : { "account": "string", "oracle_document_id": number }, "ledger_index": "string" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "ledger_hash": "string", "ledger_index": integer, "node": { "LedgerEntryType": "string", "index": "string", "Oracle": { "Account": "string", "OracleDocumentID": number, "URI": "string", "LastUpdateTime": integer, "PriceDataSeries": [ { "Price": "string", "Scale": integer, "Timestamp": integer } ] }, "Flags": integer }, "validated": boolean } } ``` --- #### Get RippleState Entry Retrieve a [RippleState entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/ripplestate) which tracks a (non-XRP) currency balance between two accounts. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `state` (object; optional): Alias to `ripple_state`. * `ripple_state` (object; optional): Object specifying the RippleState (trust line) object to retrieve. The `accounts` and `currency` sub-fields are required to uniquely specify the RippleState entry to retrieve. * `ripple_state.accounts` (array; required if `ripple_state` is specified): 2-length array of account [Addresses](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses), defining the two accounts linked by this RippleState entry. * `ripple_state.currency` (string; required if `ripple_state` is specified): [Currency Code](https://xrpl.org/docs/references/protocol/data-types/currency-formats#currency-codes) of the RippleState entry to retrieve. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "ripple_state": { "accounts": [ "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW" ], "currency": "USD" }, "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "index": "9CA88CDEDFF9252B3DE183CE35B038F57282BC9503CDFA1923EF9A95DF0D6F7B", "ledger_hash": "03983977B9497B624E8A735205FFF3729A9F06B5C7384E59638B8147F648EDF8", "ledger_index": 100472021, "node": { "Balance": { "currency": "USD", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "0" }, "Flags": 8847360, "HighLimit": { "currency": "USD", "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "value": "110" }, "HighNode": "0", "LedgerEntryType": "RippleState", "LowLimit": { "currency": "USD", "issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW", "value": "0" }, "LowNode": "0", "PreviousTxnID": "5E089C0CD4C52D3ECD85E5E1F38FC255F43FAFAF4FD5C42DD48A8A1B6C36DF5E", "PreviousTxnLgrSeq": 61168278, "index": "9CA88CDEDFF9252B3DE183CE35B038F57282BC9503CDFA1923EF9A95DF0D6F7B" }, "status": "success", "validated": true } } ``` --- #### Get Check Entry Retrieve a [Check entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/check) which is a potential payment that can be cashed by its recipient. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `check` (string): The object ID of a Check entry to retrieve. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB", "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "index": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB", "ledger_hash": "FD563CE753BAC24A385EDC5875AD57BE9074F0B9C9C1397441BCFA2569960C9A", "ledger_index": 100472064, "node": { "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "DestinationNode": "0", "DestinationTag": 13, "Flags": 0, "LedgerEntryType": "Check", "OwnerNode": "0", "PreviousTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB", "PreviousTxnLgrSeq": 61965653, "SendMax": { "currency": "USD", "issuer": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "value": "10" }, "Sequence": 384, "index": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB" }, "status": "success", "validated": true } } ``` --- #### Get Escrow Entry Retrieve an [Escrow entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/escrow) which holds XRP until a specific time or condition is met. Can be provided as string (object ID of the Escrow) or as an object. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `escrow` (object or string): The Escrow to retrieve. If a string, must be the [object ID](https://xrpl.org/docs/references/protocol/ledger-data/common-fields) of the Escrow, as hexadecimal. If an object, requires `owner` and `seq` sub-fields. * `escrow.owner` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required if `escrow` is an object): The owner (sender) of the Escrow object. * `escrow.seq` (unsigned integer; required if `escrow` is an object): The [Sequence Number](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#account-sequence) of the transaction that created the Escrow object. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "escrow": { "owner": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK", "seq": 126 }, "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "index": "917ACF1324F06D19239A03E4A6A3FE24F9313BB23337ECB801BDAD013BE27F83", "ledger_hash": "110D64E05F92F26624DAC3BC11294BD512306DEAE2F94717B7D6BA8ABB308361", "ledger_index": 100472121, "node": { "Account": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK", "Amount": "99750000", "Condition": "A0258020085D1EDF8045DC7F6E42B8DB09E05248502852FB3FF27815FC94433D1CB62198810120", "Destination": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK", "FinishAfter": 3802143660, "Flags": 0, "LedgerEntryType": "Escrow", "OwnerNode": "1", "PreviousTxnID": "470DC630B0251FCCA740EA9CA7781A502608890FB123F14D0C4BE20C4D5D44DB", "PreviousTxnLgrSeq": 37088514, "index": "917ACF1324F06D19239A03E4A6A3FE24F9313BB23337ECB801BDAD013BE27F83" }, "status": "success", "validated": true } } ``` --- #### Get PayChannel Entry Retrieve a [PayChannel entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/paychannel) which holds XRP for asynchronous payments. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `payment_channel` (string): The [object ID](https://xrpl.org/docs/references/protocol/ledger-data/common-fields) of the PayChannel to retrieve. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "payment_channel": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7", "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "index": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7", "ledger_hash": "BEC950D37F3B609CDC1F76047871DB1C5AC6DBEFA19AEA84D14AF1BF83BECE4E", "ledger_index": 100472165, "node": { "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Amount": "1000", "Balance": "0", "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "DestinationNode": "0", "Flags": 0, "LedgerEntryType": "PayChannel", "OwnerNode": "0", "PreviousTxnID": "711C4F606C63076137FAE90ADC36379D7066CF551E96DA6FE2BDAB5ECBFACF2B", "PreviousTxnLgrSeq": 61965340, "PublicKey": "03CFD18E689434F032A4E84C63E2A3A6472D684EAF4FD52CA67742F3E24BAE81B2", "SettleDelay": 60, "index": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7" }, "status": "success", "validated": true, "warning": "load" } } ``` --- #### Get DepositPreauth Entry Retrieve a [DepositPreauth entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/depositpreauth) which tracks preauthorization for payments to accounts requiring [Deposit Authorization](https://xrpl.org/docs/concepts/accounts/depositauth). ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `deposit_preauth` (object or string; required): Specify the DepositPreauth to retrieve. If a string, must be the ledger entry ID of the DepositPreauth entry, as hexadecimal. If an object, requires `owner` sub-field and either `authorized` or `authorize_credentials` sub-field. * `deposit_preauth.owner` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The account that provided the preauthorization. * `deposit_preauth.authorized` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); optional): The account that received the preauthorization. * `deposit_preauth.authorized_credentials` (array; optional): A set of credentials that received the preauthorization. Each member of the `deposit_preauth.authorized_credentials` array, if provided, must include the following nested fields: * `issuer` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required): The address of the account that issued the credential. * `credential_type` (string — hexadecimal; required): The type of the credential, as issued. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "deposit_preauth": { "owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "authorized": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX" }, "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "index": "A43898B685C450DE8E194B24D9D54E62530536A770CCB311BFEE15A27381ABB2", "ledger_hash": "C605C3E34DDBD8025844583B2EAEB75EE5CA933DB6B97646BDA736FED8D6A0A6", "ledger_index": 100472247, "node": { "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Authorize": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "Flags": 0, "LedgerEntryType": "DepositPreauth", "OwnerNode": "0", "PreviousTxnID": "CB1BF910C93D050254C049E9003DA1A265C107E0C8DE4A7CFF55FADFD39D5656", "PreviousTxnLgrSeq": 61965405, "index": "A43898B685C450DE8E194B24D9D54E62530536A770CCB311BFEE15A27381ABB2" }, "status": "success", "validated": true } } ``` --- #### Get Ticket Entry Retrieve a [Ticket entry](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/ticket) which represents a sequence number set aside for future use. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `ticket` (object or string): The Ticket to retrieve. If a string, must be the [ledger entry ID](https://xrpl.org/docs/references/protocol/ledger-data/common-fields) of the Ticket, as hexadecimal. If an object, the `account` and `ticket_seq` sub-fields are required to uniquely specify the Ticket entry. * `ticket.account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); required if `ticket` is an object): The owner of the Ticket. * `ticket.ticket_seq` (number; required if `ticket` is an object): The Ticket Sequence number of the Ticket to retrieve. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "ticket": { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "ticket_seq": 389 }, "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "index": "B603682BC36F474F708E1A150B7C034C6C13D838C3F2F135CDB7BEA6E5B5ACEF", "ledger_hash": "2594A8BF2A0C52022EE4BD187FBB9345297DDB20C82FFBDDE87CFEA443440B98", "ledger_index": 100472816, "node": { "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Flags": 0, "LedgerEntryType": "Ticket", "OwnerNode": "0", "PreviousTxnID": "7458B6FD22827B3C141CDC88F1F0C72658C9B5D2E40961E45AF6CD31DECC0C29", "PreviousTxnLgrSeq": 76567735, "TicketSequence": 389, "index": "B603682BC36F474F708E1A150B7C034C6C13D838C3F2F135CDB7BEA6E5B5ACEF" }, "status": "success", "validated": true } } ``` --- #### Get NFT Page Return an NFT Page in its raw ledger format. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `nft_page` (string): The [ledger entry ID](https://xrpl.org/docs/references/protocol/ledger-data/common-fields) of an [NFT Page](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/nftokenpage) to retrieve. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "nft_page": "255DD86DDF59D778081A06D02701E9B2C9F4F01DFFFFFFFFFFFFFFFFFFFFFFFF", "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "result": { "index": "255DD86DDF59D778081A06D02701E9B2C9F4F01DFFFFFFFFFFFFFFFFFFFFFFFF", "ledger_hash": "1C560CABB9E9556BEA3DE17DDCC4CB0F5FF82A533698744F0C339D3AE41391B1", "ledger_index": 100472871, "node": { "Flags": 0, "LedgerEntryType": "NFTokenPage", "NFTokens": [ { "NFToken": { "NFTokenID": "000827100179C79A9CAACE945A5B77FCC291948F17A72A3F369B7C9400000A19", "URI": "68747470733A2F2F78726F79616C74792E6D7970696E6174612E636C6F75642F697066732F516D534236344D5856614C7A46427757394847467969696243436D53554A4E7267753731735A38653742334D51452F323732392E6A736F6E" } }, { "NFToken": { "NFTokenID": "000827100179C79A9CAACE945A5B77FCC291948F17A72A3FBCE1D3AC000008F1", "URI": "68747470733A2F2F78726F79616C74792E6D7970696E6174612E636C6F75642F697066732F516D534236344D5856614C7A46427757394847467969696243436D53554A4E7267753731735A38653742334D51452F323433332E6A736F6E" } } ], "PreviousTxnID": "BB84C7F9FD90E7AC8A3178580F2F9BD2F00738F53060203025AF80CAF1C5D794", "PreviousTxnLgrSeq": 77102208, "index": "255DD86DDF59D778081A06D02701E9B2C9F4F01DFFFFFFFFFFFFFFFFFFFFFFFF" }, "status": "success", "validated": true } } ``` --- #### Get MPT Issuance Object Return an `MPTokenIssuance` object. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `mpt_issuance` (string): The 192-bit `MPTokenIssuanceID` that's associated with the MPTokenIssuance, as hexadecimal. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "mpt_issuance": "string", "ledger_index": "validated" } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "ledger_hash": "string", "ledger_index": integer, "node": { "LedgerEntryType": "string", "index": "string", "MPTIssuance": { "MPTIssuanceID": "string", "Owner": "string", "TransferFee": integer, "Flags": integer, "Taxon": integer, "URI": "string", "MPTSupply": "string" } }, "validated": boolean } } ``` --- #### Get MPToken Object Return an `MPToken` object. ##### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `mptoken` (object or string): If a string, interpret as ledger entry ID of the MPToken to retrieve. If an object, requires the sub-fields `account` and `mpt_issuance_id` to uniquely identify the MPToken. * `mptoken.mpt_issuance_id` (string; required if `mptoken` is an object): The 192-bit MPTokenIssuanceID that's associated with the MPTokenIssuance. * `mptoken.account` (string; required if `mptoken` is an object): The account that owns the MPToken. ##### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger_entry", "params": [ { "mptoken":{ "mpt_issuance_id": "string", "account":"string" } } ] }' ``` ##### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "ledger_hash": "string", "ledger_index": integer, "node": { "LedgerEntryType": "string", "index": "string", "MPToken": { "MPTIssuanceID": "string", "Owner": "string", "Flags": integer, "TransferFee": integer, "Taxon": integer, "QualityIn": integer, "QualityOut": integer, "Balance": "string", "PreviousTxnID": "string", "PreviousTxnLgrSeq": integer } }, "validated": boolean } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/methods-p2/ title: XRP — Methods, submit, transaction, tx, amm, book (2/3) source: docs/rpc-service/chains/chains-api/xrp/methods-p2.mdx --- # XRP — Methods, submit, transaction, tx, amm, book (2/3) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/xrp/methods/) · 2 · [3](/rpc-service/chains/chains-api/xrp/methods-p3/) ## `transaction_entry` > Retrieves info on the transaction from a particular ledger version. The `transaction_entry` method retrieves information on a single transaction from a specific ledger version. (The `tx` method by contrast, searches all ledgers for the specified transaction. We recommend using that method instead.) ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `ledger_hash` (string; optional): The unique hash of the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers).) * `ledger_index` (string or unsigned integer; optional): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers).) * `tx_hash` (string; required): Unique hash of the transaction you are looking up. ### Returns (API v2) * `close_time_iso` (string): The ledger close time represented in ISO 8601 time format. * `hash` (string): The unique hash identifier of the transaction. * `ledger_index` (number — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The ledger index of the ledger version the transaction was found in; this is the same as the one from the request. * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The identifying hash of the ledger version the transaction was found in; this is the same as the one from the request. * `meta` (object): The transaction metadata, which shows the exact results of the transaction in detail. * `tx_json` (object): JSON representation of the Transaction object. ### Returns (API v1) * `ledger_index` (number — [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The ledger index of the ledger version the transaction was found in; this is the same as the one from the request. * `ledger_hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The identifying hash of the ledger version the transaction was found in; this is the same as the one from the request. * `metadata` (object): The [transaction metadata](https://xrpl.org/docs/references/protocol/transactions/metadata) which shows the exact results of the transaction in detail. * `tx_json` (object): JSON representation of the [Transaction object](https://xrpl.org/docs/references/protocol/transactions). ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "transaction_entry", "params": [ { "tx_hash": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9", "ledger_index": 56865245 } ] }' ``` --- ## `tx` > Retrieves info on the transaction from all the ledgers at hand. The `tx` method retrieves information on a single [transaction](https://xrpl.org/docs/references/protocol/transactions), by its [identifying hash](https://xrpl.org/docs/concepts/transactions#identifying-transactions) or its [CTID](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/ctid). ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `ctid` (string; optional): The [compact transaction identifier](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/ctid) of the transaction to look up. Must use uppercase hexadecimal only. (Not supported in Clio v2.0 and earlier). * `transaction` (string; optional): The 256-bit hash of the transaction to look up, as hexadecimal. * `binary` (boolean; optional): If `true`, return transaction data and metadata as binary [serialized](https://xrpl.org/docs/references/protocol/binary-format) to hexadecimal strings. If `false`, return transaction data and metadata as JSON. The default is `false`. * `min_ledger` (number; optional): Use this with `max_ledger` to specify a range of up to 1000 [ledger indexes](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index), starting with this ledger (inclusive). If the server cannot find the transaction, it confirms whether it was able to search all the ledgers in this range. * `max_ledger` (number; optional): Use this with `min_ledger` to specify a range of up to 1000 [ledger indexes](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index), ending with this ledger (inclusive). If the server cannot find the transaction, it confirms whether it was able to search all the ledgers in the requested range. ### Returns (API v2) The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the fields of the [Transaction object](https://xrpl.org/docs/references/protocol/transactions) as well as the following additional fields: * `ctid` (string): The transaction's [compact transaction identifier](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/ctid). (Not supported in Clio v2.0 and earlier.) * `date` (number): The [close time](https://xrpl.org/docs/concepts/ledgers/ledger-close-times) of the ledger in which the transaction was applied, in [seconds since the Ripple Epoch](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time). * `hash` (string): The unique [identifying hash](https://xrpl.org/docs/concepts/transactions#identifying-transactions) of the transaction. * `inLedger` (number; deprecated): Alias for `ledger_index`. * `ledger_index` (number): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger that includes this transaction. * `meta` (object — JSON mode): [Transaction metadata](https://xrpl.org/docs/references/protocol/transactions/metadata), which describes the results of the transaction. * `meta_blob` (string — binary mode): [Transaction metadata](https://xrpl.org/docs/references/protocol/transactions/metadata), which describes the results of the transaction, represented as a hex string. * `tx_blob` (string — binary mode): The transaction data represented as a hex string. * `tx_json` (object — JSON mode): The transaction data represented in JSON. * `validated` (boolean): If `true`, this data comes from a validated ledger version; if omitted or set to `false`, this data is not final. ### Returns (API v1) The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the fields of the [Transaction object](https://xrpl.org/docs/references/protocol/transactions) as well as the following additional fields: * `ctid` (string): The transaction's [compact transaction identifier](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/ctid). (Not supported in Clio v2.0 and earlier.) * `date` (number): The [close time](https://xrpl.org/docs/concepts/ledgers/ledger-close-times) of the ledger in which the transaction was applied, in [seconds since the Ripple Epoch](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time). * `hash` (string): The unique [identifying hash](https://xrpl.org/docs/concepts/transactions#identifying-transactions) of the transaction. * `inLedger` (number; deprecated): Alias for `ledger_index`. * `ledger_index` (number): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger that includes this transaction. * `meta` (object (JSON) or string (binary)): [Transaction metadata](https://xrpl.org/docs/references/protocol/transactions/metadata), which describes the results of the transaction. * `tx` (string — binary mode): The transaction data represented as a hex string. * `validated` (boolean): If true, this data comes from a validated ledger version; if omitted or set to false, this data is not final. * (various) (various): Other fields from the [Transaction object](https://xrpl.org/docs/references/protocol/transactions). ### Request example (CTID) ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tx", "params": [ { "ctid": "C005523E00000000", "binary": false, "api_version": 2 } ] }' ``` ### Request example (Hash) ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tx", "params": [ { "transaction": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9", "binary": false, "api_version": 2 } ] }' ``` --- ## `tx_history` > Retrieves info on all recent transactions. The `tx_history` method retrieves some of the most recent transactions made. Caution: This method is removed in [API v2](https://xrpl.org/docs/references/http-websocket-apis#api-versioning). ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `start` (unsigned integer; required): Number of transactions to skip over. ### Returns * `txs` (array): Array of transaction objects. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tx_history", "params": [ { "start": 0 } ] }' ``` ### Response example ```json { "result": { "index": 0, "status": "success", "txs": [ { "Account": "rUPWQfH9SoNnbYDMjq6cMoawQ4x2or6nGA", "Amount": "100000000000000", "DeliverMax": "100000000000000", "Destination": "rUPWQfH9SoNnbYDMjq6cMoawQ4x2or6nGA", "Fee": "10", "Flags": 131072, "LastLedgerSequence": 100581760, "SendMax": { "currency": "USD", "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", "value": "1000000000000000" }, "Sequence": 0, "SigningPubKey": "EDE91272F3124216316CC04C798E7AE3A7395924FAF50533B01BCC0CE5CE71B122", "TicketSequence": 100371575, "TransactionType": "Payment", "TxnSignature": "A338BAEE8DCFA84DC5F6F8ABD81BC1F9D406F24C248A19465A83E7C9564894538A9F83C654DEFD748F7507FF8E134AC0F108A430BD2E21C1CF45F030C9678705", "hash": "45A8E1470A18F55FF9559700ABA643FE25E7E957CDB2D35F84B6B746A22C96FF", "inLedger": 100581753, "ledger_index": 100581753 } ] } } ``` --- **Path and Order Book Methods**: Paths define a way for payments to flow through intermediary steps on their way from sender to receiver. Paths enable cross-currency payments by connecting sender and receiver through order books. Use these methods to work with paths and other books. ## `amm_info` > Retrieves info on the Automated Market Maker (AMM) instance. The `amm_info` method gets information about an [Automated Market Maker (AMM)](https://xrpl.org/docs/concepts/tokens/decentralized-exchange/automated-market-makers) instance. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); optional): Show only LP Tokens held by this liquidity provider. * `amm_account` (string — [address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses); optional): The address of the AMM's special AccountRoot. (This is the `issuer` of the AMM's LP Tokens.) * `asset` (object; optional): One of the assets of the AMM to look up, as an object with `currency` and `issuer` fields (omit issuer for XRP), like [currency amounts](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts). * `asset2` (object; optional): The other of the assets of the AMM, as an object with `currency` and `issuer` fields (omit `issuer` for XRP), like [currency amounts](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts). Note: You must specify either `amm_account` or both `asset` and `asset2`. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `amm` (object): An AMM Description Object for the requested asset pair. * `ledger_current_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): Omitted if `ledger_index` is provided instead. The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the current in-progress ledger, which was used when retrieving this information. * `ledger_hash` ([hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): Omitted if `ledger_current_index` is provided instead. The identifying hash of the ledger version that was used when retrieving this data. * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): Omitted if `ledger_current_index` is provided instead. The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger version used when retrieving this information. * `validated` (boolean): If `true`, the ledger used for this request is validated and these results are final; if omitted or set to `false`, the data is pending and may change. #### AMM Description Object The `amm` field is an object describing the current status of an Automated Market Maker (AMM) in the ledger, and contains the following fields: * `account` (string): The [Address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses) of the AMM Account. * `amount` ([currency amount](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts)): The total amount of one asset in the AMM's pool. (Note: This could be `asset` or `asset2` from the request.) * `amount2` ([currency amount](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts)): The total amount of the other asset in the AMM's pool. (Note: This could be `asset` or `asset2` from the request.) * `asset_frozen` (boolean; omitted for XRP): If `true`, the `amount` currency is currently [frozen](https://xrpl.org/docs/concepts/tokens/fungible-tokens/freezes). * `asset2_frozen` (boolean; omitted for XRP): If `true`, the `amount2` currency is currently [frozen](https://xrpl.org/docs/concepts/tokens/fungible-tokens/freezes). * `auction_slot` (object; optional): An Auction Slot Object describing the current auction slot holder, if there is one. * `lp_token` ([currency amount](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts)): The total amount of this AMM's LP Tokens outstanding. If the request specified a liquidity provider in the `account` field, instead, this is the amount of this AMM's LP Tokens held by that liquidity provider. * `trading_fee` (number): The AMM's current trading fee, in units of `1/100,000`; a value of `1` is equivalent to a `0.001%` fee. * `vote_slots` (array; optional): The current votes for the AMM's trading fee, as Vote Slot Objects. #### Auction Slot Object The `auction_slot` field of the `amm` object describes the current auction slot holder of the AMM, and contains the following fields: * `account` (string): The [Address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses) of the account that owns the auction slot. * `auth_accounts` (array): A list of additional accounts that the auction slot holder has designated as being eligible of the discounted trading fee. Each member of this array is an object with one field, `account`, containing the address of the designated account. * `discounted_fee` (number): The discounted trading fee that applies to the auction slot holder, and any eligible accounts, when trading against this AMM. This is `1/10` of the AMM's normal trading fee. * `expiration` (string): The ISO 8601 UTC timestamp after which this auction slot expires. After expired, the auction slot does not apply (but the data can remain in the ledger until another transaction replaces it or cleans it up). * `price` ([currency amount](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts)): The amount, in LP Tokens, that the auction slot holder paid to win the auction slot. This affects the price to outbid the current slot holder. * `time_interval` (number): The current 72-minute time interval this auction slot is in, from 0 to 19. The auction slot expires after 24 hours (20 intervals of 72 minutes) and affects the cost to outbid the current holder and how much the current holder is refunded if someone outbids them. #### Vote Slot Objects Each entry in the `vote_slots` array represents one liquidity provider's vote to set the trading fee, and contains the following fields: * `account` (string): The [Address](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#addresses) of this liquidity provider. * `trading_fee` (number): The trading fee this liquidity provider voted for, in units of `1/100,000`. * `vote_weight` (number): How much this liquidity provider's vote counts towards the final trading fee. This is proportional to how much of the AMM's LP Tokens this liquidity provider holds. The value is equal to `100,000` times the number of this LP Tokens this liquidity provider holds, divided by the total number of LP Tokens outstanding. For example, a value of `1000` means that the liquidity provider holds `1%` of this AMM's LP Tokens. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "amm_info", "params": [ { "asset": { "currency": "XRP" }, "asset2": { "currency": "TST", "issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd" } } ] }' ``` ### Response example ```json { "result": { "amm": { "account": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM", "amount": "296890496", "amount2": { "currency": "TST", "issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd", "value": "25.81656470648473" }, "asset2_frozen": false, "auction_slot": { "account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm", "auth_accounts": [ { "account": "r3f2WpQMsAd8k4Zoijv2PZ78EYFJ2EdvgV" }, { "account": "rnW8FAPgpQgA6VoESnVrUVJHBdq9QAtRZs" } ], "discounted_fee": 0, "expiration": "2023-Jan-26 00:28:40.000000000 UTC", "price": { "currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2", "issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM", "value": "0" }, "time_interval": 0 }, "lp_token": { "currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2", "issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM", "value": "87533.41976112682" }, "trading_fee": 600, "vote_slots": [ { "account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm", "trading_fee": 600, "vote_weight": 9684 } ] }, "ledger_current_index": 316745, "status": "success", "validated": false } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/methods-p3/ title: XRP — Methods, submit, transaction, tx, amm, book (3/3) source: docs/rpc-service/chains/chains-api/xrp/methods-p3.mdx --- # XRP — Methods, submit, transaction, tx, amm, book (3/3) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/xrp/methods/) · [2](/rpc-service/chains/chains-api/xrp/methods-p2/) · 3 ## `book_changes` > Retrieves information on order book changes. The `book_changes` method reports information about changes to the order books in the [decentralized exchange (DEX)](https://xrpl.org/docs/concepts/tokens/decentralized-exchange) compared with the previous ledger version. This may be useful for building "candlestick" charts. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `ledger_hash` ([hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): A 32-byte hex string for the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `changes` (array): List of [Book Update Objects](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/book_changes#book-update-objects), containing one entry for each order book that was updated in this ledger version. The array is empty if no order books were updated. * `ledger_hash` ([hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes)): The identifying hash of the ledger version that was used when retrieving this data. * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The ledger index of the ledger version that was used when retrieving this data. * `ledger_time` (number): The official close time of the ledger that was used when retrieving this data, in [seconds since the Ripple Epoch](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time). * `type` (string): The string `bookChanges`, which indicates that this is an order book update message. * `validated` (boolean; optional): If `true`, the information comes from a validated ledger version. #### Book Update Objects A Book Update Object represents the changes to a single order book in a single ledger version, and contains the following fields: * `currency_a` (string): An identifier for the first of the two currencies in the order book. For XRP, this is the string `XRP_drops`. For [tokens](https://xrpl.org/docs/concepts/tokens), this is formatted as the address of the issuer in base58, followed by a forward-slash (`/`), followed by the [Currency Code](https://xrpl.org/docs/references/protocol/data-types/currency-formats#currency-codes) for the token, which can be a 3-character standard code or a 20-character hexadecimal code. * `currency_b` (string): An identifier for the second of two currencies in the order book. This is in the same format as `currency_a`, except `currency_b` can never be XRP. * `volume_a` (string — number): The total amount, or volume, of the first currency (that is, `currency_a`) that moved as a result of trades through this order book in this ledger. * `volume_b` (string — number): The volume of the second currency (that is, `currency_b`) that moved as a result of trades through this order book in this ledger. * `high` (string — number): The highest exchange rate among all offers matched in this ledger, as a ratio of the first currency to the second currency. (In other words, `currency_a : currency_b`.) * `low` (string — number): The lowest exchange rate among all offers matched in this ledger, as a ratio of the first currency to the second currency. * `open` (string — number): The exchange rate at the top of this order book before processing the transactions in this ledger, as a ratio of the first currency to the second currency. * `close` (string — number): The exchange rate at the top of this order book after processing the transactions in this ledger, as a ratio of the first currency to the second currency. For XRP-token order books, XRP is always `currency_a`. For token-token order books, the currencies are sorted alphabetically by the issuer and then currency code. Exchange rates involving XRP are always calculated using [drops of XRP](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-currency-amounts). For example, if the rate from XRP to FOO is 1.0 XRP to 1 FOO, the rate reported by the API is `1000000` (1 million drops of XRP per 1 FOO). ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "book_changes", "params": [ { "ledger_index": 88530953 } ] }' ``` ### Response example ```json { "result" : { "changes" : [ { "close" : "277777.7777777778", "currency_a" : "XRP_drops", "currency_b" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/CNY", "high" : "277777.7777777778", "low" : "277777.7777777778", "open" : "277777.7777777778", "volume_a" : "44082741", "volume_b" : "158.6978676" }, { "close" : "202999.9948135647", "currency_a" : "XRP_drops", "currency_b" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/XLM", "high" : "202999.9948135647", "low" : "202999.9948135647", "open" : "202999.9948135647", "volume_a" : "44191586", "volume_b" : "217.6925474337355" }, { "close" : "80475.34586323083", "currency_a" : "XRP_drops", "currency_b" : "rf5YPb9y9P3fTjhxNaZqmrwaj5ar8PG1gM/47414C4100000000000000000000000000000000", "high" : "80475.34586323083", "low" : "80475.34586323083", "open" : "80475.34586323083", "volume_a" : "100000000", "volume_b" : "1242.61659179386" }, { "close" : "231974.7481608686", "currency_a" : "XRP_drops", "currency_b" : "rsoLo2S1kiGeCcn6hCUXVrCpGMWLrRrLZz/534F4C4F00000000000000000000000000000000", "high" : "231974.7481608686", "low" : "231974.7481608686", "open" : "231974.7481608686", "volume_a" : "33734", "volume_b" : "0.1454210006367" }, { "close" : "7.290000000001503", "currency_a" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/CNY", "currency_b" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/USD", "high" : "7.290000000001503", "low" : "7.290000000001503", "open" : "7.290000000001503", "volume_a" : "158.6978670792", "volume_b" : "21.76925474337" }, { "close" : "0.1", "currency_a" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/USD", "currency_b" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/XLM", "high" : "0.1", "low" : "0.1", "open" : "0.1", "volume_a" : "21.76925474337355", "volume_b" : "217.6925474337355" } ], "ledger_hash" : "7AB08A2415C10E07201521F3260F77ADFF4902A528EA66378E259A07767A24B9", "ledger_index" : 88530953, "ledger_time" : 771100891, "status" : "success", "type" : "bookChanges" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/methods/ title: XRP — Methods, submit, transaction, tx, amm, book (1/3) source: docs/rpc-service/chains/chains-api/xrp/methods.mdx --- # XRP — Methods, submit, transaction, tx, amm, book (1/3) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/xrp/methods-p2/) · [3](/rpc-service/chains/chains-api/xrp/methods-p3/) ## `submit` > Sends a transaction to the network. The `submit` method applies a [transaction](https://xrpl.org/docs/references/protocol/transactions) and sends it to the network to be confirmed and included in future ledgers. This command has two modes: * **Submit-only** mode takes a signed, serialized transaction as a binary blob, and submits it to the network as-is. Since signed transaction objects are immutable, no part of the transaction can be modified or automatically filled in after submission. * **Sign-and-submit** mode takes a JSON-formatted Transaction object, completes and signs the transaction in the same manner as the [sign method](https://xrpl.org/docs/references/http-websocket-apis/admin-api-methods/signing-methods/sign), and then submits the signed transaction. We recommend only using this mode for testing and development. To send a transaction as robustly as possible, you should construct and sign it in advance, persist it somewhere that you can access even after a power outage, then `submit` it as a `tx_blob`. After submission, monitor the network with the tx method command to see if the transaction was successfully applied; if a restart or other problem occurs, you can safely re-submit the `tx_blob` transaction: it won't be applied twice since it has the same sequence number as the old transaction. ### Submit-only mode #### Parameters A submit-only request includes the following parameters: * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `tx_blob` (string; required): Hex representation of the signed transaction to submit. This can be a [multi-signed transaction](https://xrpl.org/docs/concepts/accounts/multi-signing). * `fail_hard` (boolean; optional): If `true`, and the transaction fails locally, do not retry or relay the transaction to other servers. The default is `false`. #### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `engine_result` (string): Text [result code](https://xrpl.org/docs/references/protocol/transactions/transaction-results) indicating the preliminary result of the transaction, for example `tesSUCCESS`. * `engine_result_code` (integer): Numeric version of the [result code](https://xrpl.org/docs/references/protocol/transactions/transaction-results). Not recommended. * `engine_result_message` (string): Human-readable explanation of the transaction's preliminary result. * `tx_blob` (string): The complete transaction in hex string format. * `tx_json` (object): The complete transaction in JSON format. * `accepted` (boolean; omitted in sign-and-submit mode): The value `true` indicates that the transaction was applied, queued, broadcast, or kept for later. The value `false` indicates that none of those happened, so the transaction cannot possibly succeed as long as you do not submit it again and have not already submitted it another time. * `account_sequence_available` (number; omitted in sign-and-submit mode): The next [Sequence Number](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#account-sequence) available for the sending account after all pending and [queued transactions](https://xrpl.org/docs/concepts/transactions/transaction-queue). * `account_sequence_next` (number; omitted in sign-and-submit mode): The next [Sequence Number](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#account-sequence) for the sending account after all transactions that have been provisionally applied, but not transactions in the [queue](https://xrpl.org/docs/concepts/transactions/transaction-queue). * `applied` (boolean; omitted in sign-and-submit mode): The value `true` indicates that this transaction was applied to the open ledger. In this case, the transaction is likely, but not guaranteed, to be validated in the next ledger version. * `broadcast` (boolean; omitted in sign-and-submit mode): The value `true` indicates this transaction was broadcast to peer servers in the peer-to-peer XRP Ledger network. The value `false` indicates the transaction was not broadcast to any other servers. * `kept` (boolean; omitted in sign-and-submit mode): The value `true` indicates that the transaction was kept to be retried later. * `queued` (boolean; omitted in sign-and-submit mode): The value `true` indicates the transaction was put in the [Transaction Queue](https://xrpl.org/docs/concepts/transactions/transaction-queue), which means it is likely to be included in a future ledger version. * `open_ledger_cost` (string; omitted in sign-and-submit mode): The current [open ledger cost](https://xrpl.org/docs/concepts/transactions/transaction-cost#open-ledger-cost) before processing this transaction. Transactions with a lower cost are likely to be [queued](https://xrpl.org/docs/concepts/transactions/transaction-queue). * `validated_ledger_index` (integer; omitted in sign-and-submit mode): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the newest validated ledger at the time of submission. This provides a lower bound on the ledger versions that the transaction can appear in as a result of this request. #### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "submit", "params": [ { "tx_blob": "1200002280000000240000000361D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754" } ] }' ``` #### Response example ```json { "result": { "accepted": true, "account_sequence_available": 393, "account_sequence_next": 393, "applied": false, "broadcast": false, "engine_result": "tefPAST_SEQ", "engine_result_code": -190, "engine_result_message": "This sequence number has already passed.", "kept": true, "open_ledger_cost": "10", "queued": false, "status": "success", "tx_blob": "1200002280000000240000000361D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754", "tx_json": { "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "Amount": { "currency": "USD", "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "value": "1" }, "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "Fee": "10", "Flags": 2147483648, "Sequence": 3, "SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB", "TransactionType": "Payment", "TxnSignature": "3045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE", "hash": "82230B9D489370504B39BC2CE46216176CAC9E752E5C1774A8CBEC9FBB819208" }, "validated_ledger_index": 100512474 } } ``` ### Sign-and-Submit mode This mode signs a transaction and immediately submits it. This mode is intended to be used for testing. You cannot use this mode for [multi-signed transactions](https://xrpl.org/docs/concepts/accounts/multi-signing). By default, sign-and-submit mode is [admin-only](https://xrpl.org/docs/references/http-websocket-apis/admin-api-methods). It can be used as a public method if the server has [enabled public signing](https://xrpl.org/docs/infrastructure/configuration/enable-public-signing). You can provide the secret key used to sign the transaction in the following ways: * Provide a `secret` value and omit the `key_type` field. This value can be formatted as an XRP Ledger [base58](https://xrpl.org/docs/references/protocol/data-types/base58-encodings) seed, RFC-1751, hexadecimal, or as a string passphrase. (secp256k1 keys only) * Provide a `key_type` value and exactly one of `seed`, `seed_hex`, or `passphrase`. Omit the `secret` field. (Not supported by the commandline syntax.) #### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `tx_json` (object): [Transaction definition](https://xrpl.org/docs/references/protocol/transactions) in JSON format, optionally omitting any auto-fillable fields. * `secret` (string; optional): Secret key of the account supplying the transaction, used to sign it. Do not send your secret to untrusted servers or through unsecured network connections. Cannot be used with `key_type`, `seed`, `seed_hex`, or `passphrase`. * `seed` (string; optional): Secret key of the account supplying the transaction, used to sign it. Must be in the XRP Ledger's base58 format. If provided, you must also specify the `key_type`. Cannot be used with `secret`, `seed_hex`, or `passphrase`. * `seed_hex` (string; optional): Secret key of the account supplying the transaction, used to sign it. Must be in hexadecimal format. If provided, you must also specify the `key_type`. Cannot be used with `secret`, `seed`, or `passphrase`. * `passphrase` (string; optional): Secret key of the account supplying the transaction, used to sign it, as a string passphrase. If provided, you must also specify the `key_type`. Cannot be used with `secret`, `seed`, or `seed_hex`. * `key_type` (string; optional): Type of cryptographic key provided in this request. Valid types are `secp256k1` or `ed25519`. Defaults to `secp256k1`. Cannot be used with `secret`. Caution: `Ed25519` support is experimental. * `fail_hard` (boolean; optional): If `true`, and the transaction fails locally, do not retry or relay the transaction to other servers. The default is `false`. * `offline` (boolean; optional): If `true`, when constructing the transaction, do not try to automatically fill in or validate values. The default is `false`. * `build_path` (boolean; optional): If this field is provided, the server [auto-fills](https://xrpl.org/docs/references/protocol/transactions/common-fields#auto-fillable-fields) the Paths field of a [Payment transaction](https://xrpl.org/docs/references/protocol/transactions/types/payment) before signing. You must omit this field if the transaction is a [direct XRP payment](https://xrpl.org/docs/concepts/payment-types/direct-xrp-payments) or if it is not a Payment-type transaction. Caution: The server looks for the presence or absence of this field, not its value. This behavior may change. * `fee_mult_max` (integer; optional): Sign-and-submit fails with the error `rpcHIGH_FEE` if the [auto-filled `Fee` value](https://xrpl.org/docs/references/protocol/transactions/common-fields#auto-fillable-fields) would be greater than the [reference transaction cost](https://xrpl.org/docs/concepts/transactions/transaction-cost#special-transaction-costs) × `fee_mult_max` ÷ `fee_div_max`. This field has no effect if you explicitly specify the Fee field of the transaction. The default is `10`. * `fee_div_max` (integer; optional): Sign-and-submit fails with the error `rpcHIGH_FEE` if the [auto-filled `Fee` value](https://xrpl.org/docs/references/protocol/transactions/common-fields#auto-fillable-fields) would be greater than the [reference transaction cost](https://xrpl.org/docs/concepts/transactions/transaction-cost#special-transaction-costs) × `fee_mult_max` ÷ `fee_div_max`. This field has no effect if you explicitly specify the Fee field of the transaction. The default is `1`. #### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `engine_result` (string): Text [result code](https://xrpl.org/docs/references/protocol/transactions/transaction-results) indicating the preliminary result of the transaction, for example `tesSUCCESS`. * `engine_result_code` (integer): Numeric version of the [result code](https://xrpl.org/docs/references/protocol/transactions/transaction-results). Not recommended. * `engine_result_message` (string): Human-readable explanation of the transaction's preliminary result. * `tx_blob` (string): The complete transaction in hex string format. * `tx_json` (object): The complete transaction in JSON format. * `accepted` (boolean; omitted in sign-and-submit mode): The value `true` indicates that the transaction was applied, queued, broadcast, or kept for later. The value `false` indicates that none of those happened, so the transaction cannot possibly succeed as long as you do not submit it again and have not already submitted it another time. * `account_sequence_available` (number; omitted in sign-and-submit mode): The next [Sequence Number](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#account-sequence) available for the sending account after all pending and [queued transactions](https://xrpl.org/docs/concepts/transactions/transaction-queue). * `account_sequence_next` (number; omitted in sign-and-submit mode): The next [Sequence Number](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#account-sequence) for the sending account after all transactions that have been provisionally applied, but not transactions in the [queue](https://xrpl.org/docs/concepts/transactions/transaction-queue). * `applied` (boolean; omitted in sign-and-submit mode): The value `true` indicates that this transaction was applied to the open ledger. In this case, the transaction is likely, but not guaranteed, to be validated in the next ledger version. * `broadcast` (boolean; omitted in sign-and-submit mode): The value `true` indicates this transaction was broadcast to peer servers in the peer-to-peer XRP Ledger network. The value `false` indicates the transaction was not broadcast to any other servers. * `kept` (boolean; omitted in sign-and-submit mode): The value `true` indicates that the transaction was kept to be retried later. * `queued` (boolean; omitted in sign-and-submit mode): The value `true` indicates the transaction was put in the [Transaction Queue](https://xrpl.org/docs/concepts/transactions/transaction-queue), which means it is likely to be included in a future ledger version. * `open_ledger_cost` (string; omitted in sign-and-submit mode): The current [open ledger cost](https://xrpl.org/docs/concepts/transactions/transaction-cost#open-ledger-cost) before processing this transaction. Transactions with a lower cost are likely to be [queued](https://xrpl.org/docs/concepts/transactions/transaction-queue). * `validated_ledger_index` (integer; omitted in sign-and-submit mode): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the newest validated ledger at the time of submission. This provides a lower bound on the ledger versions that the transaction can appear in as a result of this request. #### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "submit", "params": [ { "offline": false, "api_version": 2, "secret": "s████████████████████████████", "tx_json": { "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "DeliverMax": { "currency": "USD", "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "value": "1" }, "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "TransactionType": "Payment" }, "fee_mult_max": 1000 } ] }' ``` --- ## `submit_multisigned` > Sends a multi-signed transaction to the network. The `submit_multisigned` command applies a [multi-signed](https://xrpl.org/docs/concepts/accounts/multi-signing) transaction and sends it to the network to be included in future ledgers. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `tx_json` (object; required): [Transaction in JSON format](https://xrpl.org/docs/references/protocol/transactions) with an array of `Signers`. To be successful, the weights of the signatures must be equal or higher than the quorum of the [SignerList](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/signerlist). * `fail_hard` (boolean; optional): If `true`, and the transaction fails locally, do not retry or relay the transaction to other servers. The default is `false`. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields: * `engine_result` (string): Code indicating the preliminary result of the transaction, for example `tesSUCCESS`. * `engine_result_code` (integer): Numeric code indicating the preliminary result of the transaction, directly correlated to `engine_result`. * `engine_result_message` (string): Human-readable explanation of the preliminary transaction result. * `tx_blob` (string): The complete [transaction](https://xrpl.org/docs/references/protocol/transactions) in hex string format. * `tx_json` (object): The complete [transaction](https://xrpl.org/docs/references/protocol/transactions) in JSON format. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "submit_multisigned", "params": [ { "tx_json": { "Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC", "Fee": "30000", "Flags": 262144, "LimitAmount": { "currency": "USD", "issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "value": "0" }, "Sequence": 4, "Signers": [ { "Signer": { "Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW", "SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF", "TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7" } }, { "Signer": { "Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n", "SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1", "TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08" } } ], "SigningPubKey": "", "TransactionType": "TrustSet", "hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8" } } ] }' ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/server-p2/ title: XRP — server, Methods, mpt (2/3) source: docs/rpc-service/chains/chains-api/xrp/server-p2.mdx --- # XRP — server, Methods, mpt (2/3) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 2 of 3: [1](/rpc-service/chains/chains-api/xrp/server/) · 2 · [3](/rpc-service/chains/chains-api/xrp/server-p3/) ## `version` > Retrieves API version information. The `version` command retrieves the API version information for the rippled server. For `Clio` servers, see `version` (`clio`) instead. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing a version object as its only field. The `version` object returns some arrangement of the following fields: * `first` (string): Lowest supported API release. * `last` (string): Highest supported API release. * `good` (string): Default API if none specified. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "version", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "status": "success", "version": { "first": "1.0.0", "good": "1.0.0", "last": "1.0.0" } } } ``` --- **Clio Methods**: These API methods are provided only by the Clio server, not `rippled`. ## `server_info` > Retrieves status of the Clio server in human-readable format. The `server_info` command asks the [Clio server](https://xrpl.org/docs/concepts/networks-and-servers/the-clio-server) for a human-readable version of various information about the Clio server being queried. For `rippled` servers, see `server_info` (`rippled`) instead. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing an `info` object as its only field. The `info` object may have some arrangement of the following fields: * `complete_ledgers` (string): Range expression indicating the sequence numbers of the ledger versions the local `rippled` has in its database. This may be a disjoint sequence such as `24900901-24900984,24901116-24901158`. If the server does not have any complete ledgers (for example, it recently started syncing with the network), this is the string `empty`. * `counters` (object; optional): Stats on API calls handled since server startup. This is present only if the client connects to the Clio server over `localhost`. * `rpc` (object; optional): Stats on each API call handled by the Clio server since startup. Since this is nested within the `counters` object, this is also present only if the client connects to the Clio server over `localhost`. The rpc object is a map of API method names to API Stats Objects. * `subscriptions` (object; optional): Number of current subscribers for each stream type. Since this is nested within the `counters` object, this is also present only if the client connects to the Clio server over `localhost`. * `subscriptions.ledger` * `subscriptions.transactions` * `subscriptions.transactions_proposed` * `subscriptions.manifests` * `subscriptions.validations` * `subscriptions.account` * `subscriptions.accounts_proposed` * `subscriptions.books` * `time` (string): The current time in UTC, according to the server's clock. * `uptime` (number): Number of consecutive seconds that the server has been operational. * `amendment_blocked` (boolean; optional): Whether the Clio server is Amendment Blocked. * `load_factor` (number): The load-scaled open ledger transaction cost the server is currently enforcing, as a multiplier on the base transaction cost. For example, at `1000` load factor and a reference transaction cost of 10 drops of XRP, the load-scaled transaction cost is 10,000 drops (0.01 XRP). The load factor is determined by the highest of the [individual server's load factor](https://xrpl.org/docs/concepts/transactions/transaction-cost#local-load-cost), the cluster's load factor, the [open ledger cost](https://xrpl.org/docs/concepts/transactions/transaction-cost#open-ledger-cost), and the overall network's load factor. * `clio_version` (string): The version number of the running Clio server. * `libxrpl_version` (string): The version number of the `libxrpl` library this Clio server was built against. * `validation_quorum` (number; optional): Minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations. This value is obtained from `rippled`. This field may be omitted from the response if the Clio server is unable to connect to `rippled` for some reason. * `rippled_version` (string; optional): The version number of the running `rippled` server that the Clio server is connected to. This field may be omitted from the response if the Clio server is unable to connect to `rippled` for some reason. * `network_id` (string; optional): The network ID of the network that the `rippled` this Clio server is connected to is operating on. This field may be omitted from the response if the Clio server is unable to connect to `rippled` for some reason. * `validated_ledger` (object; optional): Information about the most recent fully-validated ledger. If the most recent validated ledger is not available, the response omits this field and includes `closed_ledger` instead. * `validated_ledger.age` (number): The time since the ledger was closed, in seconds. * `validated_ledger.base_fee_xrp` (number): Base fee, in XRP. This may be represented in scientific notation such as `1e-05` for `0.00001`. * `validated_ledger.hash` (string): Unique hash for the ledger, as hexadecimal. * `validated_ledger.reserve_base_xrp` (number): Minimum amount of XRP (not drops) necessary for every account to keep in reserve. This may be represented in scientific notation such as `1e-05` for `0.00001`. * `validated_ledger.reserve_inc_xrp` (number): Amount of XRP (not drops) added to the account reserve for each object an account owns in the ledger. This may be represented in scientific notation such as `1e-05` for `0.00001`. * `validated_ledger.seq` (number): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the latest validated ledger. * `validator_list_expires` (string): (Admin only) Either the human-readable time, in UTC, when the current validator list expires, the string `unknown` if the server has yet to load a published validator list or the string `never` if the server uses a static validator list. * `cache` (object): Information on Clio's state data cache. * `cache.size` (number): Number of state data objects currently in the cache. * `cache.is_full` (boolean): True if cache contains all state data for a specific ledger, false otherwise. Some API calls, such as the book_offers method, process much faster when the cache is full. * `cache.latest_ledger_seq` (number): The ledger index of the latest validated ledger stored in the cache. * `etl` (object): The `rippled` sources (ETL sources) that the Clio server is connected to. This is present only if the client connects to the Clio server over `localhost`. * `etl.etl_sources` (array): List the `rippled` sources (ETL sources) that the Clio server is connected to and extracts data from. * `etl.etl_sources.validated_range` (string): The validated ledger range retrieved by the P2P `rippled` server. * `etl.etl_sources.is_connected` (boolean): True if Clio is connected to this source via websocket, false otherwise. A value of false here could indicate a networking issue, or that `rippled` is not running, amongst other things. * `etl.etl_sources.ip` (number): IP of the `rippled` server. * `etl.etl_sources.ws_port` (number): Websocket port of the `rippled` server. * `etl.etl_sources.grpc_port` (number): The gRPC connection port of the P2P `rippled` server that the Clio server is connected to. * `etl.etl_sources.last_msg_age_seconds` (number): Total seconds that have elapsed since Clio last heard anything from `rippled`. This should not be higher than 8. * `etl.is_writer` (boolean): `true` if this Clio server is currently writing data to the database, `false` otherwise. * `etl.read_only` (boolean): `true` if this Clio server is configured in read-only mode, `false` otherwise. * `etl.last_publish_age_seconds` (number): Time in seconds that have elapsed since this Clio server last published a ledger. This should not be more than 8. * `validated` (boolean): When `true`, this indicates that the response uses a ledger version that has been validated by consensus. In Clio, this is always true as Clio stores and returns validated ledger data. If a request was forwarded to `rippled` and the server returns current data, a missing or `false` value indicates that this ledger's data is not final. * `status` (string): Returns the status of the API request: `success` when the request completes successfully. #### API Stats Objects An API Stats object provides key metrics for every API call handled by the Clio server since startup. It includes the following fields: * `started` (number): Number of API calls of this type that the Clio server has started processing since startup. * `finished` (number): Number of API calls of this type that the Clio server has finished processing since startup. * `errored` (number): Number of API calls of this type that have resulted in some sort of error since startup. * `forwarded` (number): Number of API calls of this type that the Clio server has forwarded to a `rippled` P2P server since startup. * `duration_us` (number): The total number of microseconds spent processing API calls of this type since startup. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "server_info", "params": [] }' ``` ### Response example ```json { "result": { "info": { "build_version": "2.6.2", "complete_ledgers": "100146025-100669999", "hostid": "SAD", "initial_sync_duration_us": "292599227", "io_latency_ms": 1, "jq_trans_overflow": "0", "last_close": { "converge_time_s": 3, "proposers": 35 }, "load_factor": 1, "peer_disconnects": "25682", "peer_disconnects_resources": "10", "peers": 50, "ports": [ { "port": "51235", "protocol": [ "peer" ] }, { "port": "51234", "protocol": [ "http" ] }, { "port": "51233", "protocol": [ "ws" ] }, { "port": "50051", "protocol": [ "grpc" ] } ], "pubkey_node": "n94B86FddoyYsndK6N8gZwcD5xoMonptkHxmWnNqc22naS5V1pF8", "server_state": "full", "server_state_duration_us": "174432150738", "state_accounting": { "connected": { "duration_us": "283465932", "transitions": "2" }, "disconnected": { "duration_us": "1040136", "transitions": "2" }, "full": { "duration_us": "174432150738", "transitions": "1" }, "syncing": { "duration_us": "8093158", "transitions": "1" }, "tracking": { "duration_us": "0", "transitions": "1" } }, "time": "2025-Dec-05 11:47:07.485428 UTC", "uptime": 174724, "validated_ledger": { "age": 4, "base_fee_xrp": 1e-05, "hash": "88DD7DD8994E83A178D341FB9621610CD56B4576384FCA3A962A675E9C1A4003", "reserve_base_xrp": 1, "reserve_inc_xrp": 0.2, "seq": 100669999 }, "validation_quorum": 28 }, "status": "success" } } ``` --- ## `ledger` > Retrieves info on the ledger version. The `ledger` command retrieves information about the public [ledger](https://xrpl.org/docs/concepts/ledgers). Note that the Clio server returns validated ledger data by default. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `ledger_hash` ([hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes); optional): The unique hash of the ledger version to use. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)). * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers)) * `transactions` (boolean; optional): If `true`, return information on transactions in the specified ledger version. Defaults to `false`. Ignored if you did not specify a ledger version. * `expand` (boolean; optional): Provide full JSON-formatted information for transaction/account information instead of only hashes. Defaults to `false`. Ignored unless you request transactions. * `owner_funds` (boolean; optional): If `true`, include `owner_funds` field in the metadata of OfferCreate transactions in the response. Defaults to `false`. Ignored unless transactions are included and expand is `true`. * `binary` (boolean; optional): If `true`, and `transactions` and `expand` are both also `true`, return transaction information in binary format (hexadecimal string) instead of JSON format. * `diff` (boolean; optional): If `true`, returns all objects that were added, modified, or deleted as part of applying transactions in the specified ledger. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing information about the ledger, including the following fields: * `ledger` (object): The complete header data of this ledger. * `ledger.account_hash` (string): Hash of all account state information in this ledger, as hex. * `ledger.accountState` (array; optional): All the [account-state information](https://xrpl.org/docs/references/protocol/ledger-data) in this ledger. * `ledger.close_flags` (integer): A bit-map of [flags relating to the closing of this ledger](https://xrpl.org/docs/references/protocol/ledger-data/ledger-header#close-flags). * `ledger.close_time` (integer): The time this ledger was closed, in [seconds since the Ripple Epoch](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time). * `ledger.close_time_human` (string): The time this ledger was closed, in human-readable format. Always uses the UTC time zone. * `ledger.close_time_resolution` (integer): Ledger close times are rounded to within this many seconds. * `ledger.closed` (boolean): Whether this ledger has been closed or not. * `ledger.ledger_hash` (string): Unique identifying hash of the entire ledger. * `ledger.ledger_index` (string): The [Ledger Index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of this ledger, as a quoted integer. * `ledger.parent_close_time` (integer): The time at which the previous ledger was closed. * `ledger.parent_hash` (string): Unique identifying hash of the ledger that came immediately before this one. * `ledger.total_coins` (string): Total number of XRP drops in the network, as a quoted integer. (This decreases as transaction costs destroy XRP.) * `ledger.transaction_hash` (string): Hash of the transaction information included in this ledger, as hex. * `ledger.transactions` (array; optional): Transactions applied in this ledger version. By default, members are the transactions' identifying [Hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes) strings. If the request specified `expand` as `true`, members are full representations of the transactions instead, in either JSON or binary depending on whether the request specified `binary` as `true`. * `ledger_hash` (string): Unique identifying hash of the entire ledger. * `ledger_index` (number): The [Ledger Index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of this ledger. * `validated` (boolean; optional): If `true`, this is a validated ledger version. If omitted or set to `false`, this ledger's data is not final. * `diff` (object; optional): Object containing an array of hashes that were added, modified, or deleted as part of applying transactions for the ledger. If the request specified `"owner_funds": true` and expanded transactions, the response has a field `owner_funds` in the `metaData` object of each [OfferCreate transaction](https://xrpl.org/docs/references/protocol/transactions/types/offercreate). The purpose of this field is to make it easier to track the [funding status of offers](https://xrpl.org/docs/concepts/tokens/decentralized-exchange/offers#lifecycle-of-an-offer) with each new validated ledger. * `owner_funds` (string): Numeric amount of the `TakerGets` currency that the `Account` sending this OfferCreate transaction has after the execution of all transactions in this ledger. This does not check whether the currency amount is [frozen](https://xrpl.org/docs/concepts/tokens/fungible-tokens/freezes). If the request specified `"diff": true`, the response has an object `diff`. The fields of this object are as follows: * `object_id` (string): The object identifier. * `Hashes` (object or string): Depending on whether the request set `binary` to `true` or `false`, this field returns the contents of the object that was created, the new value of an object that was modified, or an empty string if the object was deleted. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ledger", "params": [ { "ledger_index": "validated", "transactions": false, "expand": false, "owner_funds": false, "diff": false } ] }' ``` ### Response example ```json { "result": { "ledger": { "account_hash": "F16BD4873733F45AA69A22E16669701FA6382BE5465EDA7B9B77AFCFBE9BB335", "close_flags": 0, "close_time": 818251651, "close_time_human": "2025-Dec-05 12:07:31.000000000 UTC", "close_time_iso": "2025-12-05T12:07:31Z", "close_time_resolution": 10, "closed": true, "ledger_hash": "57FAE517644B0E528D331D105D5E06071742CD7E35BE77C4F775E6FA98B38A83", "ledger_index": "100670317", "parent_close_time": 818251650, "parent_hash": "ECEB12B2CC088D735BA64F05DF424833B9CD1821FDFE72C8608FA0895BF8DA87", "total_coins": "99985745812732275", "transaction_hash": "B3440C9462D83D4CD22208538DA257974A99AC132EBE976CE7B581C36F8B8825" }, "ledger_hash": "57FAE517644B0E528D331D105D5E06071742CD7E35BE77C4F775E6FA98B38A83", "ledger_index": 100670317, "status": "success", "validated": true } } ``` --- ## `mpt_holders` > Retrieves the holders of a given MPT issuance for a given ledger. For a given `MPTokenIssuanceID` and ledger sequence, `mpt_holders` returns all holders of that [MPT](https://xrpl.org/docs/concepts/tokens/fungible-tokens/multi-purpose-tokens) and their balance. This method likely returns very large data sets, so you should expect to implement paging via the `marker` field. This API is only available using Clio, not `rippled`. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `mpt_issuance_id` (string; required): The `MPTokenIssuance` to query. * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index); optional): The [Ledger Index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the max ledger to use, or a shortcut string to choose a ledger automatically. You must specify either `ledger_index` or `ledger_hash`. See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers). * `ledger_hash` (string; optional): A 32-byte hex string for the ledger version to use. You must specify either `ledger_index` or `ledger_hash`. See [Specifying Ledgers](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-ledgers). * `marker` ([marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): Used to continue your query where it left off in paginating. * `limit` (number — positive integer; optional): Specify a limit to the number of MPTs returned. ### Returns * `mpt_issuance_id` (string): The `MPTokenIssuance` queried. * `mptokens` (array): An array of [MPTokens](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/clio-methods/mpt_holders#mptoken). Includes all relevant fields in the underlying `MPToken` object. * `marker` ([marker](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/markers-and-pagination); optional): Used to continue querying where we left off when paginating. Omitted if there are no more entries after this result. * `limit` (number): The limit, as specified in the request. * `ledger_index` ([ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index)): The index of the ledger used. * `validated` (boolean): If `true`, the ledger has been validated by the consensus process and is immutable. Otherwise, the contents of the ledger are not final and may change. In Clio, this is always true as Clio stores and returns validated ledger data. #### MPToken An `MPToken` object has the following parameters: * `account` (string): The account address of the holder who owns the `MPToken`. * `flags` (number): The flags assigned to the `MPToken` object. * `mpt_amount` ([string — number](https://xrpl.org/docs/references/protocol/data-types/currency-formats#string-numbers)): Specifies a positive amount of tokens currently held by the owner. * `mptoken_index` (string): Key of the `MPToken` object. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "mpt_holders", "params": [ { "mpt_issuance_id": "0024D204E07DDDFBCD83B1649C07FE27FD536A3A32E6FDD8", "ledger_index": "validated" } ] }' ``` ### Response example ```json { "result": { "mpt_issuance_id": "0024D204E07DDDFBCD83B1649C07FE27FD536A3A32E6FDD8", "limit": 50, "ledger_index": 2415033, "mptokens": [ { "account": "rfyWeQpYM3vCXRHA9cMLs2ZEdZv1F1jzm9", "flags": 0, "mpt_amount": "200", "mptoken_index": "22F99DCD55BCCF3D68DC3E4D6CF12602006A7563A6BE93FC57FD63298BCCEB13" } ], "validated": true, "status": "success" }, "warnings": [ { "id": 2001, "message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request" } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/server-p3/ title: XRP — server, Methods, mpt (3/3) source: docs/rpc-service/chains/chains-api/xrp/server-p3.mdx --- # XRP — server, Methods, mpt (3/3) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 3 of 3: [1](/rpc-service/chains/chains-api/xrp/server/) · [2](/rpc-service/chains/chains-api/xrp/server-p2/) · 3 ## `version` > Retrieves API version information. The `version` command retrieves the API version information of the [Clio server](https://xrpl.org/docs/concepts/networks-and-servers/the-clio-server). For `rippled` servers, see `version` (`rippled`) instead. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing an info object as its only field. The `version` object returns some arrangement of the following fields: * `first` (integer): Lowest supported API release. * `last` (integer): Highest supported API release. * `good` (integer): Default API if none specified. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "version", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "status": "success", "version": { "first": "1.0.0", "good": "1.0.0", "last": "1.0.0" } } } ``` --- **Utility Methods**: Use these methods to perform convenient tasks, such as ping and random number generation. ## `ping` > Confirms connectivity with the server. The `ping` command returns an acknowledgement, so that clients can test the connection status and latency. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing no fields. The client can measure the round-trip time from request to response as latency. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "ping", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "status": "success" } } ``` --- ## `random` > Generates a random number. The `random` command provides a random number to be used as a source of entropy for random number generation by clients. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following field: * `random` (string): Random 256-bit hex value. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "random", "params": [] }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "random": "3060417EAEBDB220E2CBED2B4BCBAEDD805D8A1A8D7C405A868F11ABB7249B2A", "status": "success" } } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/xrp/server/ title: XRP — server, Methods, mpt (1/3) source: docs/rpc-service/chains/chains-api/xrp/server.mdx --- # XRP — server, Methods, mpt (1/3) > API reference for [XRP](/rpc-service/chains/chains-api/xrp/). [All methods ->](/rpc-service/chains/chains-api/xrp/#methods) > > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-api/xrp/server-p2/) · [3](/rpc-service/chains/chains-api/xrp/server-p3/) ## `server_info (rippled)` > Retrieves status of the server in human-readable format. The `server_info` command asks the server for a human-readable version of various information about the [`rippled` server](https://xrpl.org/docs/concepts/networks-and-servers) being queried. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `counters` (boolean; optional): If `true`, return metrics about the job queue, ledger store, and API method activity. The default is `false`. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing an `info` object as its only field. The `info` object may have some arrangement of the following fields: * `amendment_blocked` (boolean; may be omitted): If `true`, this server is amendment blocked. If the server is not [amendment blocked](https://xrpl.org/docs/concepts/networks-and-servers/amendments#amendment-blocked-servers), the response omits this field. * `build_version` (string): The version number of the running `rippled` server. * `closed_ledger` (object; may be omitted): Information on the most recently closed ledger that has not been validated by consensus, as a [Server Ledger Object](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_info#server-ledger-object). If the most recently validated ledger is available, the response omits this field and includes `validated_ledger` instead. * `complete_ledgers` (string): Range expression indicating the sequence numbers of the ledger versions the local `rippled` has in its database. This may be a disjoint sequence such as `24900901-24900984,24901116-24901158`. If the server does not have any complete ledgers (for example, it recently started syncing with the network), this is the string `empty`. * `git` (object; admin only): The Git details of your `rippled` build. * `git.branch` (string; admin only): The Git branch used to build your version of `rippled`. * `git.hash` (string; admin only): The Git hash of the commit used to build your version of `rippled`. * `hostid` (string): On an admin request, returns the hostname of the server running the `rippled` instance; otherwise, returns a single [RFC-1751](https://tools.ietf.org/html/rfc1751) word based on the [node public key](https://xrpl.org/docs/concepts/networks-and-servers/peer-protocol#node-key-pair). * `io_latency_ms` (number): Amount of time spent waiting for I/O operations, in milliseconds. If this number is not very, very low, then the `rippled` server is probably having serious load issues. * `jq_trans_overflow` (string — number): The number of times (since starting up) that this server has had over 250 transactions waiting to be processed at once. A large number here may mean that your server is unable to handle the transaction load of the XRP Ledger network. For detailed recommendations of future-proof server specifications, see [Capacity Planning](https://xrpl.org/docs/infrastructure/installation/capacity-planning). * `last_close` (object): Information about the last time the server closed a ledger, including the amount of time it took to reach a consensus and the number of trusted validators participating. * `last_close.converge_time_s` (number): The amount of time it took to reach a consensus on the most recently validated ledger version, in seconds. * `last_close.proposers` (number): How many trusted validators the server considered (including itself, if configured as a validator) in the consensus process for the most recently validated ledger version. * `load` (object; admin only): Detailed information about the current load state of the server. * `load.job_types` (array; admin only): Information about the rate of different types of jobs the server is doing and how much time it spends on each. * `load.threads` (number; admin only): The number of threads in the server's main job pool. * `load_factor` (number): The multiplier to the [transaction cost](https://xrpl.org/docs/concepts/transactions/transaction-cost) the server is currently enforcing. For example, at `1000` load factor and a reference transaction cost of 10 drops of XRP, the load-scaled transaction cost is 10,000 drops (0.01 XRP). The load factor is determined by the highest of the individual server's load factor, the cluster's load factor, the open ledger cost, and the overall network's load factor. * `load_factor_local` (number; may be omitted): The current multiplier to the transaction cost based on load to this server. * `load_factor_net` (number; may be omitted): The current multiplier to the transaction cost being used by the rest of the network. * `load_factor_cluster` (number; may be omitted): The current multiplier to the transaction cost based on load to servers in this [cluster](https://xrpl.org/docs/concepts/networks-and-servers/clustering). * `load_factor_fee_escalation` (number; may be omitted): The current multiplier to the transaction cost that a transaction must pay to get into the open ledger. * `load_factor_fee_queue` (number; may be omitted): The current multiplier to the transaction cost required to get into the queue, if the queue is full. * `load_factor_server` (number; may be omitted): The current multiplier based on server, cluster, and network load (not including open ledger cost). * `network_ledger` (string; may be omitted): When [starting the server with the `--net` parameter](https://xrpl.org/docs/infrastructure/commandline-usage), this field contains the string `waiting` while the server is syncing to the network. * `peers` (number): How many other `rippled` servers this one is currently connected to. * `ports` (array): A list of ports where the server is listening for API commands. Each entry is a [Port Descriptor object](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_info#port-descriptor-object). * `pubkey_node` (string): Public key used to verify this server for peer-to-peer communications. This [node key pair](https://xrpl.org/docs/concepts/networks-and-servers/peer-protocol#node-key-pair) is automatically generated by the server the first time it starts up. (If deleted, the server can create a new pair of keys.) You can set a persistent value in the config file using the `[node_seed]` config option, which is useful for [clustering](https://xrpl.org/docs/concepts/networks-and-servers/clustering). * `pubkey_validator` (string; admin only): Public key used by this node to sign ledger validations. This validation key pair is derived from the `[validator_token]` or `[validation_seed]` config field. * `server_state` (string): A string indicating to what extent the server is participating in the network. See [Possible Server States](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/rippled-server-states) for more details. * `server_state_duration_us` (number): The number of consecutive microseconds the server has been in the current state. * `state_accounting` (object): A map of [various server states](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/rippled-server-states) with information about the time the server spends in each. This can be useful for tracking the long-term health of your server's connectivity to the network. The contents of this field are formatted as [State Accounting Objects](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_info#state-accounting-object). * `uptime` (number): Number of consecutive seconds that the server has been operational. * `validated_ledger` (object; may be omitted): Information about the most recent fully-validated ledger, as a [Server Ledger Object](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_info#server-ledger-object). If not available, omitted and `closed_ledger` is included instead. * `validation_quorum` (number): Minimum number of trusted validations required to validate a ledger version. * `validator_list_expires` (string; admin only): Either the human-readable time, in UTC, when the current validator list expires, or the string `unknown` if the server has yet to load a published validator list, or the string `never` if the server uses a static validator list. * `counters` (object): Performance metrics regarding RPC calls, JobQueue, and nodestore details (`node_writes`, `node_reads_total`, `node_reads_hit`, etc.). * `current_activity` (object): Lists items currently being run in the job queue and contains two arrays for `jobs` and `methods`. #### Port Descriptor Object Each member of the `ports` array is an object with the following fields: * `port` (string — number): A port number where the server is listening. * `protocol` (array of string): A list of protocols being served on this port. Valid protocols include `http` or `https` for JSON-RPC, `ws`, `ws2`, `wss`, `wss2` for WebSocket, `grpc` for gRPC, and `peer` for the [XRP Ledger Peer Protocol](https://xrpl.org/docs/concepts/networks-and-servers/peer-protocol). #### State Accounting Object Each field in the `state_accounting` object has a key that refers to a specific [server state](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/rippled-server-states), and a value that is an object with the following fields: * `duration_us` (string — number): The number of microseconds the server has spent in this state. (This is updated whenever the server transitions into another state.) * `transitions` (string — number): The number of times the server has changed into this state. #### Server Ledger Object The response provides either a `validated_ledger` field or a `closed_ledger` field. Either field contains an object with the following fields: * `age` (number): The time since the ledger was closed, in seconds. * `base_fee_xrp` (number): Base fee, in XRP (not drops). This may be represented in scientific notation such as `1e-05` for `0.00001`. * `hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes)): Unique hash for the ledger, as hexadecimal. * `reserve_base_xrp` (number): Minimum amount of XRP (not drops) necessary for every account to keep in reserve. * `reserve_inc_xrp` (number): Amount of XRP (not drops) added to the account reserve for each object an account owns in the ledger. * `seq` (number): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of the latest validated ledger. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "server_info", "params": [{"counters" : false}] }' ``` ### Response example ```json { "result": { "info": { "build_version": "2.6.2", "complete_ledgers": "100146025-100650763", "hostid": "SAD", "initial_sync_duration_us": "292599227", "io_latency_ms": 1, "jq_trans_overflow": "0", "last_close": { "converge_time_s": 3, "proposers": 35 }, "load_factor": 1, "peer_disconnects": "18440", "peer_disconnects_resources": "3", "peers": 49, "ports": [ { "port": "51235", "protocol": [ "peer" ] }, { "port": "51234", "protocol": [ "http" ] }, { "port": "51233", "protocol": [ "ws" ] }, { "port": "50051", "protocol": [ "grpc" ] } ], "pubkey_node": "n94B86FddoyYsndK6N8gZwcD5xoMonptkHxmWnNqc22naS5V1pF8", "server_state": "full", "server_state_duration_us": "99692864611", "state_accounting": { "connected": { "duration_us": "283465932", "transitions": "2" }, "disconnected": { "duration_us": "1040136", "transitions": "2" }, "full": { "duration_us": "99692864611", "transitions": "1" }, "syncing": { "duration_us": "8093158", "transitions": "1" }, "tracking": { "duration_us": "0", "transitions": "1" } }, "time": "2025-Dec-04 15:01:28.199321 UTC", "uptime": 99985, "validated_ledger": { "age": 4, "base_fee_xrp": 1e-05, "hash": "DC9E71BB38F18D5202594FA800230B0B080199704D7CA02BD2524ED49170DA2F", "reserve_base_xrp": 1, "reserve_inc_xrp": 0.2, "seq": 100650763 }, "validation_quorum": 28 }, "status": "success" } } ``` --- ## `server_state` > Retrieves status of the server in machine-readable format. The `server_state` command asks the server for various machine-readable information about the `rippled` server's current state. The response is almost the same as the `server_info` `rippled` method, but uses units that are easier to process instead of easier to read. (For example, XRP values are given in integer drops instead of scientific notation or decimal values, and time is given in milliseconds instead of seconds.) The Clio server does not support `server_state` directly, but you can ask for the `server_state` of the `rippled` server that Clio is connected to. Specify `"ledger_index": "current"` (WebSocket) or `"params": [{"ledger_index": "current"}]` (JSON-RPC). ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON-RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns The response follows the [standard format](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing a `state` object as its only field. The `state` object may have some arrangement of the following fields: * `amendment_blocked` (boolean): (May be omitted) If `true`, this server is [amendment blocked](https://xrpl.org/docs/concepts/networks-and-servers/amendments#amendment-blocked-servers). If the server is not amendment blocked, the response omits this field. * `build_version` (string): The version number of the running `rippled` version. * `complete_ledgers` (string): Range expression indicating the sequence numbers of the ledger versions the local `rippled` has in its database. It is possible to be a disjoint sequence, e.g. "2500-5000,32570-7695432". If the server does not have any complete ledgers (for example, it recently started syncing with the network), this is the string `empty`. * `closed_ledger` (object): (May be omitted) Information on the most recently closed ledger that has not been validated by consensus, as a [Server Ledger Object](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_state#server-ledger-object). If the most recently validated ledger is available, the response omits this field and includes `validated_ledger` instead. * `io_latency_ms` (number): Amount of time spent waiting for I/O operations, in milliseconds. If this number is not very, very low, then the `rippled` server is probably having serious load issues. * `jq_trans_overflow` (string — number): The number of times this server has had over 250 transactions waiting to be processed at once. A large number here may mean that your server is unable to handle the transaction load of the XRP Ledger network. For detailed recommendations of future-proof server specifications, see [Capacity Planning](https://xrpl.org/docs/infrastructure/installation/capacity-planning). * `last_close` (object): Information about the last time the server closed a ledger, including the amount of time it took to reach a consensus and the number of trusted validators participating. * `last_close.converge_time` (number): The amount of time it took to reach a consensus on the most recently validated ledger version, in milliseconds. * `last_close.proposers` (number): How many trusted validators the server considered (including itself, if configured as a validator) in the consensus process for the most recently validated ledger version. * `load` (object): (Admin only) Detailed information about the current load state of the server. * `load.job_types` (array): (Admin only) Information about the rate of different types of jobs the server is doing and how much time it spends on each. * `load.threads` (number): (Admin only) The number of threads in the server's main job pool. * `load_base` (number): The baseline amount of server load used in [transaction cost](https://xrpl.org/docs/concepts/transactions/transaction-cost) calculations. If the `load_factor` is equal to the `load_base`, then only the base transaction cost is enforced. If the `load_factor` is higher than the `load_base`, then transaction costs are multiplied by the ratio between them. For example, if the `load_factor` is double the `load_base`, then transaction costs are doubled. * `load_factor` (number): The load factor the server is currently enforcing. The ratio between this value and the `load_base` determines the multiplier for transaction costs. The load factor is determined by the highest of the individual server's load factor, the cluster's load factor, the open ledger cost, and the overall network's load factor. * `load_factor_fee_escalation` (number): (May be omitted) The current multiplier to the transaction cost to get into the open ledger, in [fee levels](https://xrpl.org/docs/concepts/transactions/transaction-cost#fee-levels). * `load_factor_fee_queue` (number): (May be omitted) The current multiplier to the transaction cost to get into the queue, if the queue is full, in fee levels. * `load_factor_fee_reference` (number): (May be omitted) The transaction cost with no load scaling, in fee levels. * `load_factor_server` (number): (May be omitted) The load factor the server is enforcing, based on load to the server, cluster, and network, but not factoring in the open ledger cost. * `network_ledger` (string): (May be omitted) When [starting the server with the `--net` parameter](https://xrpl.org/docs/infrastructure/commandline-usage), this field contains the string `waiting` while the server is syncing to the network. The field is omitted otherwise. * `peers` (number): How many other `rippled` servers this one is currently connected to. * `ports` (array): A list of ports where the server is listening for API commands. Each entry in the array is a [Port Descriptor object](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_state#port-descriptor-object). * `pubkey_node` (string): Public key used to verify this server for peer-to-peer communications. This node key pair is automatically generated by the server the first time it starts up. (If deleted, the server can create a new pair of keys.) You can set a persistent value in the config file using the `[node_seed]` config option, which is useful for [clustering](https://xrpl.org/docs/concepts/networks-and-servers/clustering). * `pubkey_validator` (string): (Admin only) Public key used by this node to sign ledger validations. This validation key pair is derived from the `[validator_token]` or `[validation_seed]` config field. * `server_state` (string): A string indicating to what extent the server is participating in the network. See [Possible Server States](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/rippled-server-states) for more details. * `server_state_duration_us` (number): The number of consecutive microseconds the server has been in the current state. * `state_accounting` (object): A map of various [server states](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/rippled-server-states) with information about the time the server spends in each. This can be useful for tracking the long-term health of your server's connectivity to the network. The contents of this field are formatted as [State Accounting Objects](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_state#state-accounting-object). * `time` (string): The current time in UTC, according to the server's clock. * `uptime` (number): Number of consecutive seconds that the server has been operational. * `validated_ledger` (object): (May be omitted) Information about the most recent fully-validated ledger, as a [Server Ledger Object](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/server-info-methods/server_state#server-ledger-object). If the most recent validated ledger is not available, the response omits this field and includes `closed_ledger` instead. * `validation_quorum` (number): Minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations. * `validator_list_expires` (number): (Admin only) When the current validator list expires, in [seconds since the Ripple Epoch](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time), or 0 if the server has yet to load a published validator list. #### Port Descriptor Object Each member of the `ports` array is an object with the following fields: * `port` (string — number): A port number where the server is listening. * `protocol` (array of string): A list of protocols being served on this port. Valid protocols include `http` or `https` for JSON-RPC, `ws`, `ws2`, `wss`, `wss2` for WebSocket, `grpc` for gRPC, and `peer` for the [XRP Ledger Peer Protocol](https://xrpl.org/docs/concepts/networks-and-servers/peer-protocol). #### State Accounting Object Each field in the `state_accounting` object has a key that refers to a specific [server state](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/rippled-server-states), and a value that is an object with the following fields: * `duration_us` (string — number): The number of microseconds the server has spent in this state. (This is updated whenever the server transitions into another state.) * `transitions` (string — number): The number of times the server has changed into this state. #### Server Ledger Object The response provides either a `validated_ledger` field or a `closed_ledger` field. Either field contains an object with the following fields: * `base_fee` (number): The base fee, in drops of XRP, for propagating a transaction to the network, as of this ledger version. * `close_time` (number): The official close time of this ledger version, in [seconds since the Ripple Epoch](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time). This value is rounded; see [Ledger Close Times](https://xrpl.org/docs/concepts/ledgers/ledger-close-times) for details. * `hash` (string — [hash](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#hashes)): The unique hash of this ledger version, as hexadecimal. * `reserve_base` (number): The minimum [account reserve](https://xrpl.org/docs/concepts/accounts/reserves), as of the most recent validated ledger version. * `reserve_inc` (number): The [owner reserve](https://xrpl.org/docs/concepts/accounts/reserves) for each item an account owns, as of the most recent validated ledger version. * `seq` (number): The [ledger index](https://xrpl.org/docs/references/protocol/data-types/basic-data-types#ledger-index) of this ledger version. ### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/YOUR_ANKR_API_KEY' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "server_state", "params": [] }' ``` ### Response example ```json { "result": { "state": { "build_version": "2.6.2", "complete_ledgers": "100145467-100651296", "initial_sync_duration_us": "397921122", "io_latency_ms": 1, "jq_trans_overflow": "0", "last_close": { "converge_time": 3001, "proposers": 35 }, "load_base": 256, "load_factor": 256, "load_factor_fee_escalation": 256, "load_factor_fee_queue": 256, "load_factor_fee_reference": 256, "load_factor_server": 256, "peer_disconnects": "15089", "peer_disconnects_resources": "7", "peers": 24, "ports": [ { "port": "51235", "protocol": [ "peer" ] }, { "port": "51234", "protocol": [ "http" ] }, { "port": "51233", "protocol": [ "ws" ] }, { "port": "50051", "protocol": [ "grpc" ] } ], "pubkey_node": "n94B86FddoyYsndK6N8gZwcD5xoMonptkHxmWnNqc22naS5V1pF8", "server_state": "full", "server_state_duration_us": "101916702241", "state_accounting": { "connected": { "duration_us": "391641811", "transitions": "2" }, "disconnected": { "duration_us": "2071962", "transitions": "2" }, "full": { "duration_us": "101916702241", "transitions": "1" }, "syncing": { "duration_us": "4207345", "transitions": "1" }, "tracking": { "duration_us": "1", "transitions": "1" } }, "time": "2025-Dec-04 15:35:55.844094 UTC", "uptime": 102314, "validated_ledger": { "base_fee": 10, "close_time": 818177751, "hash": "883E90590C94615CA601D2B9C577FE9AD382ADD5065550EA8021B8088AFD4581", "reserve_base": 1000000, "reserve_inc": 200000, "seq": 100651296 }, "validation_quorum": 28 }, "status": "success" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/zksync-era/eth/ title: zkSync Era — eth, debug source: docs/rpc-service/chains/chains-api/zksync-era/eth.mdx --- # zkSync Era — eth, debug > API reference for [zkSync Era](/rpc-service/chains/chains-api/zksync-era/). [All methods ->](/rpc-service/chains/chains-api/zksync-era/#methods) ## `eth_getTransactionReceipt` > Returns the receipt of a transaction by transaction hash. The receipt is not available for pending transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a hash of the transaction. ### Returns * `object`: a transaction receipt object, or null when no receipt was found: * `transactionHash` (string; data, 32 bytes): a hash of the transaction. * `transactionIndex` (string; quantity): the transactions index position in the block. * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. * `blockNumber` (string; quantity): a number of the block containing the transaction. * `from` (string; data, 20 bytes): an address of the sender. * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. * `logs` (array): an array of log objects, which this transaction generated. * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). * `status` (string; quantity): either 1 (success) or 0 (failure). ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0xa9af72199b085387a4103b267b0329155fc9bfe052a897400be45193df01bf36"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "blockHash": "0xeb83cac74ab6c6ba55548bb4789d15c6c795f63e7aa1d8c185712e3531fa004a", "blockNumber": "0x5aca5d", "contractAddress": null, "cumulativeGasUsed": "0x0", "effectiveGasPrice": "0xee6b280", "from": "0x8f28567e1ac98b67f0eecc00c3448543681b5d89", "gasUsed": "0xa1b12", "l1BatchNumber": "0xfe7a", "l1BatchTxIndex": "0x1b8", "l2ToL1Logs": [], "logs": [ { "address": "0x000000000000000000000000000000000000800a", "blockHash": "0xeb83cac74ab6c6ba55548bb4789d15c6c795f63e7aa1d8c185712e3531fa004a", "blockNumber": "0x5aca5d", "data": "0x00000000000000000000000000000000000000000000000000038d7ea4c68000", "l1BatchNumber": "0xfe7a", "logIndex": "0x37", "logType": null, "removed": false, "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000008f28567e1ac98b67f0eecc00c3448543681b5d89", "0x0000000000000000000000000000000000000000000000000000000000008001" ], "transactionHash": "0xa9af72199b085387a4103b267b0329155fc9bfe052a897400be45193df01bf36", "transactionIndex": "0x9", "transactionLogIndex": "0x37" } ], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "root": "0xeb83cac74ab6c6ba55548bb4789d15c6c795f63e7aa1d8c185712e3531fa004a", "status": "0x1", "to": "0x2da10a1e27bf85cedd8ffb1abbe97e53391c0295", "transactionHash": "0xa9af72199b085387a4103b267b0329155fc9bfe052a897400be45193df01bf36", "transactionIndex": "0x9", "type": "0x0" }, "id": 1 } ``` --- ## `eth_getLogs` > Returns an array of all logs matching a given filter object. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `object`: the filter options: * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: * `latest`: for the last mined block. * `earliest`: for the lowest numbered block available on the client. * `pending`: for not yet mined transactions. * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. ### Returns * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. * `address` (string; data, 20 bytes): an address from which this log originated. * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. * `topics` (array of strings; 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 (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"address": "0x8F28567e1aC98B67F0eEcC00c3448543681b5D89"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000009acbb72cf67103a30333a32cd203459c6a9c3311", "0x000000000000000000000000994871e1103c5da4be270365fa62771ea4525520" ], "data": "0x000000000000000000000000000000000000000000000000000000001ec39aa0", "blockNumber": "0xf6289d", "transactionHash": "0xc7ed73c9b219d4243872e5993ad2950c8ea87d15af28562d33b0c05d46a90cee", "transactionIndex": "0x1e", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x13", "removed": false }, { "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005879975799597392c031f10b6eff282cb7974ac8", "0x0000000000000000000000006d52ab66340f3f78d0c1007bec484268876b5948" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "blockNumber": "0xf6289d", "transactionHash": "0x0118499f7be4c3510bd60fe3a3aee5f5f316743b6cc13a8cb0528d784f962aec", "transactionIndex": "0x20", "blockHash": "0x1e12377f0357320c0e5cfcadc2dfbc9c75fc339be668e118c34e4333f835ef31", "logIndex": "0x14", "removed": false } ] } ``` --- ## `debug_traceBlockByHash` > Traces the execution of all transactions within a block specified by hash. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; required): the hash of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the zkSync Era blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByHash", "params": [ "0x8c2f6fd9c2db9f21c801ed1aa7a2ebe24ed51a90aac8035e3ba176e195cb3c1d", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ { "result": { "type": "CALL", "from": "0x44988098726e23c1f81d5ff3847d37709f69263a", "to": "0xda879470d70845da9efbd4884c8149a6df4e50a1", "value": "0x0", "gas": "0xc881", "gasUsed": "0x8535", "input": "0x68573107000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000300000000000000000000000043ad4c4aed53558261d1aeb2bbc6acde89dbe6b30000000000000000000000005fd5de01554c302d0fb66a35684e023de8e87be2000000000000000000000000c186130e7b46c65a14695f8bfde8a31734b3aab4000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000014d1120d7b16000000000000000000000000000000000000000000000000000014d1120d7b16000000000000000000000000000000000000000000000000000014d1120d7b160000", "output": "0x" } }, { "result": { "type": "CALL", "from": "0xd9cd9ec80463c5928575d7c397374a5dcff01fb7", "to": "0xda879470d70845da9efbd4884c8149a6df4e50a1", "value": "0x0", "gas": "0x76e3", "gasUsed": "0x4773", "input": "0x68573107000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000b562cd54681d9c400d46a1b52f9435fdf8dc6b83000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000014d1120d7b160000", "output": "0x" } } ] } ``` --- ## `debug_traceBlockByNumber` > Traces the execution of all transactions within a block specified by number. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the hex number of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the zkSync Era blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": [ "0x37117D", { "tracer": "callTracer", "timeout": "5s", "tracingOptions": { "disableMemory": true, "disableStack": true, "disableStorage": false } } ], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ { "result": { "type": "CALL", "from": "0x86fda994a63d7917d2a447ceeaa917f2a7dffb8e", "to": "0xda879470d70845da9efbd4884c8149a6df4e50a1", "value": "0x0", "gas": "0x76e3", "gasUsed": "0x4773", "input": "0x68573107000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a90b4e7c457b810f52602ee72d2e3508d1a93935000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000014d1120d7b160000", "output": "0x" } }, { "result": { "type": "CALL", "from": "0xab181fdbe661c32b83a942a6c9d076f1bc217e1e", "to": "0xda879470d70845da9efbd4884c8149a6df4e50a1", "value": "0x0", "gas": "0x76e3", "gasUsed": "0x4773", "input": "0x68573107000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000589d348d26c107a0fac86dc0096a7af308af189200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000008ac7230489e80000", "output": "0x" } } ] } ``` --- ## `debug_traceBlock` > Traces the execution of all transactions within a block. ### Parameters
* `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): * `` (string; hex; required): the RLP-encoded data of the block you want to trace. * `tracer` (string; optional): the tracer to use for the operation. Tracers can customize the output, for example, by including only certain types of operations. Common tracers are the following: * `callTracer`: generates a detailed trace of all calls, including internal contract calls. `callTracer` has the following parameters: * `onlyTopCall` (boolean): if `true`, only the top-level call is traced. * `tracerConfig` (object): additional options to customize the output, such as including or excluding specific call types. * `prestateTracer`: traces the state of accounts before the execution of transactions. * `noopTracer`: a no-operation tracer that returns minimal information. * `fourByteTracer`: identifies the function signature of calls by analyzing the first four bytes of the calldata. * `memoryTracer`: traces memory changes during the execution of transactions. `memoryTracer` has the following parameters: * `disableMemory` (boolean): if true, memory output is omitted. * `opTracer`: traces all the EVM opcodes executed during a transaction. `opTracer` has the following parameters: * `includeMemory` (boolean): if true, includes memory output. * `includeStack` (boolean): if true, includes stack output. * `includeStorage` (boolean): if true, includes storage output. * `gasTracer`: traces the gas usage of the transaction and breaks it down by operation. * `timeout` (optional, string): sets a timeout for the tracing operation, expressed in milliseconds (e.g., "5s" for 5 seconds). If the operation exceeds this time, it will be terminated. * `tracingOptions` (optional, object): an object to specify additional options for the trace, such as: * `disableMemory` (boolean): if true, memory output is omitted. * `disableStack` (boolean): if true, stack output is omitted. * `disableStorage` (boolean): if true, storage output is omitted. You can create custom tracers by combining existing tracer parameters or defining new ones. The flexibility of tracers allows you to tailor the debugging output to your specific needs, focusing on different aspects of transaction execution. If you're working on specific use cases, it may be helpful to look into the zkSync Era blockchain documentation to get detailed information on additional or custom tracers that may be supported. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era_sepolia/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "debug_traceBlock", "params": [ "blockRlp", { "tracer": "tracerType", "timeout": "timeoutDuration", "tracingOptions": { "disableMemory": boolean, "disableStack": boolean, "disableStorage": boolean } } ], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": [ { "type": "call", "from": "0x1234...abcd", // Address initiating the transaction "to": "0xabcd...1234", // Address receiving the transaction "gas": "0x5208", // Gas provided for the transaction "gasUsed": "0x2100", // Gas actually used during execution "input": "0x...", // Input data to the transaction (usually calldata) "output": "0x...", // Output data from the transaction (e.g., return data) "value": "0x0", // Value transferred in the transaction (in wei) "calls": [ // Nested calls (if any) { "type": "call", "from": "0xabcd...1234", "to": "0x1234...abcd", "gas": "0x5208", "gasUsed": "0x2100", "input": "0x...", "output": "0x...", "value": "0x0" } ] } ] } ``` --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/zksync-era/ title: zkSync Era description: zkSync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on… 28 methods on Ankr RPC with a free demo key. source: docs/rpc-service/chains/chains-api/zksync-era/index.mdx --- # zkSync Era
> zkSync Era API is available on [Web3 API platform](https://www.ankr.com/rpc/zksync_era). *zkSync Era* is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on security or decentralization. Since it's EVM compatible (Solidity/Vyper), 99% of Ethereum projects can redeploy without refactoring or re-auditing a single line of code. zkSync Era also uses an LLVM-based compiler that will eventually let developers write smart contracts in C++, Rust, and other popular languages. In order for your Web3 application to interact with zkSync Era — either by reading blockchain data or sending transactions to the network — it must connect to a zkSync Era node. Developers interact with the blockchain using the methods provided by the API. The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. --- ## Methods supported * [`web3_clientVersion`](/rpc-service/chains/chains-api/zksync-era/web3/#web3_clientversion) — returns the current client version. * [`net_version`](/rpc-service/chains/chains-api/zksync-era/web3/#net_version) — returns the current network ID. * [`net_listening`](/rpc-service/chains/chains-api/zksync-era/web3/#net_listening) — returns true if client is actively listening for network connections. * [`eth_syncing`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_gasprice) — returns the current price per gas in wei. * [`eth_accounts`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getstorageat) — returns the value from a storage position at an address specified. * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_gettransactioncount) — returns the number of transactions sent from an address. * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. * [`eth_getCode`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getcode) — returns code at an address specified. * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. * [`eth_call`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. * [`eth_estimateGas`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_getblockbyhash) — returns information for the block specified by block hash. * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_getblockbynumber) — returns information for the block specified by block number. * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/zksync-era/eth/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. * [`eth_getLogs`](/rpc-service/chains/chains-api/zksync-era/eth/#eth_getlogs) — returns logs matching the parameters specified. **Premium-only methods (zkSync Era Sepolia Testnet)**: * [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/zksync-era/eth/#debug_traceblockbyhash) — traces the execution of all transactions within a block specified by hash. * [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/zksync-era/eth/#debug_traceblockbynumber) — traces the execution of all transactions within a block specified by number. * [`debug_traceBlock`](/rpc-service/chains/chains-api/zksync-era/eth/#debug_traceblock) — traces the execution of all transactions within a block. --- ## Methods ### web3, net, eth - [`web3_clientVersion`](/rpc-service/chains/chains-api/zksync-era/web3/#web3_clientversion) - [`net_version`](/rpc-service/chains/chains-api/zksync-era/web3/#net_version) - [`net_listening`](/rpc-service/chains/chains-api/zksync-era/web3/#net_listening) - [`eth_syncing`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_syncing) - [`eth_gasPrice`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_gasprice) - [`eth_accounts`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_accounts) - [`eth_blockNumber`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_blocknumber) - [`eth_getBalance`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getbalance) - [`eth_getStorageAt`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getstorageat) - [`eth_getTransactionCount`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_gettransactioncount) - [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getblocktransactioncountbyhash) - [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getblocktransactioncountbynumber) - [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getunclecountbyblockhash) - [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getunclecountbyblocknumber) - [`eth_getCode`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_getcode) - [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_sendrawtransaction) - [`eth_call`](/rpc-service/chains/chains-api/zksync-era/web3/#eth_call) - [`eth_estimateGas`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_estimategas) - [`eth_getBlockByHash`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_getblockbyhash) - [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_getblockbynumber) - [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_gettransactionbyhash) - [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_gettransactionbyblockhashandindex) - [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/zksync-era/web3-p2/#eth_gettransactionbyblocknumberandindex) ### eth, debug - [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/zksync-era/eth/#eth_gettransactionreceipt) - [`eth_getLogs`](/rpc-service/chains/chains-api/zksync-era/eth/#eth_getlogs) - [`debug_traceBlockByHash`](/rpc-service/chains/chains-api/zksync-era/eth/#debug_traceblockbyhash) - [`debug_traceBlockByNumber`](/rpc-service/chains/chains-api/zksync-era/eth/#debug_traceblockbynumber) - [`debug_traceBlock`](/rpc-service/chains/chains-api/zksync-era/eth/#debug_traceblock) --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/zksync-era/web3-p2/ title: zkSync Era — web3, net, eth (2/2) source: docs/rpc-service/chains/chains-api/zksync-era/web3-p2.mdx --- # zkSync Era — web3, net, eth (2/2) > API reference for [zkSync Era](/rpc-service/chains/chains-api/zksync-era/). [All methods ->](/rpc-service/chains/chains-api/zksync-era/#methods) > > Part 2 of 2: [1](/rpc-service/chains/chains-api/zksync-era/web3/) · 2 ## `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 * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei; note that if the value exceeds the `from` address balance (which is 0.000000000000000001 ETH by default), then you'll receive an `insufficient funds` error in response. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the amount of gas used. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"to":"0xDFAaB828f5F515E104BaaBa4d8D554DA9096f0e4"}], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5208" } ``` --- ## `eth_getBlockByHash` > Returns information for the block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): the block hash. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0xeb83cac74ab6c6ba55548bb4789d15c6c795f63e7aa1d8c185712e3531fa004a", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "baseFeePerGas": "0xee6b280", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0xffffffff", "gasUsed": "0x5781cc", "hash": "0xeb83cac74ab6c6ba55548bb4789d15c6c795f63e7aa1d8c185712e3531fa004a", "l1BatchNumber": "0xfe7a", "l1BatchTimestamp": "0x64887a5e", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x5aca5d", "parentHash": "0xe1fd48c3104f7e2460e4b274c6475d808525bfd6eadc0fec3d24f94053840deb", "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "sealFields": [], "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x0", "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": "0x64887a7f", "totalDifficulty": "0x0", "transactions": [ "0x6a29f1619aa8a6f638e205c6ab7b2d5db1c2e5156893442382f17cbed7163ab4", "0x5aa0ac2f4b172ce2e08c889f3205ecf657cef4fdd5cc241ed71f0ca4dcb6a4c8", "0xf7a89939f95f43953af56f6a35dd87a6609221a3ea71bdb52e77270f10c1da52", "0x41e3023ca56453d3820803d536515120809535a039e8d7df6c201af5f54a0dad", "0xc486a7ceffaa82db5f4ca436d659dc548117cd7bc1611709cda90ac0a182bf2f", "0x4f4802a642fbf6d177447b94246e0bc83bb950d3a67b919f1a4dbffc76f56aec", "0x93527c96b6dabe24f6e8cf208c2b9a894ffcfeaa5f396e7feb6a84d9b59029fe", "0x6ded97b63a76f2f7cc6fce69c1980a75d0f6837e5d96d3d02986bc08ea382e67", "0x0384ec33649c81f9933ebbb6ad6ff8fca94bc96b123c54ba575d582ef50a3f81", "0xa9af72199b085387a4103b267b0329155fc9bfe052a897400be45193df01bf36" ], "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "uncles": [] }, "id": 1 } ``` --- ## `eth_getBlockByNumber` > Returns information for the block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. ### Returns * ``: a block object, or null when no block was found: * `number` (string; quantity): the block number; null when it's a pending block. * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. * `parentHash` (string; data, 32 bytes): the hash of the parent block. * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. * `difficulty` (string; quantity): the difficulty for this block. * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. * `extraData` (string; data): the **extra data** field of this block. * `size` (string; quantity): the size of this block in bytes. * `gasLimit` (string; quantity): the maximum gas allowed in this block. * `gasUsed` (string; quantity): the total used gas by all transactions in this block. * `timestamp` (string; quantity): the unix timestamp for when the block was collated. * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. * `uncles` (array of strings): an array of uncle hashes. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "baseFeePerGas": "0xee6b280", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0xffffffff", "gasUsed": "0x3e741a", "hash": "0xcd03b96e15adb0fb1a272c81d9016ea3fde173964786d54e4ba93ab071f3c837", "l1BatchNumber": null, "l1BatchTimestamp": null, "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x5acadb", "parentHash": "0x84cc41d56942cefd6bff337f629a6ab0a7ac122d5333f2f0114f811da88f3119", "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "sealFields": [], "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x0", "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": "0x64887afe", "totalDifficulty": "0x0", "transactions": [ "0x8821473798c8b31d3e85c7c69d89ca56b0bfbc2ec8a7837cb9b6d6be531f31ca", "0x0c7d50a74553516fd825b67386cf9ae0f0676e600bdde44dc824416a261189ad", "0x9fe5139037b0221d41a230ea6d9751afe3f171f849dbfea48f412c26d11e87d2", "0x6b2a70a1c1b0bbea74b1c45e52eae2e65f62397a98180be9fcd0a138d61977d4", "0xd779466d82932122aee0b25baeb81b3c2bbc875342ded228803e292979ff12bd", "0xc4740e19332909e196f2f342566254b05739387266beebdf3179d38998b65679" ], "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "uncles": [] }, "id": 1 } ``` --- ## `eth_getTransactionByHash` > Returns information on a transaction specified by transaction hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a transaction hash. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0xa9af72199b085387a4103b267b0329155fc9bfe052a897400be45193df01bf36"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "blockHash": "0xeb83cac74ab6c6ba55548bb4789d15c6c795f63e7aa1d8c185712e3531fa004a", "blockNumber": "0x5aca5d", "chainId": "0x144", "from": "0x8f28567e1ac98b67f0eecc00c3448543681b5d89", "gas": "0x3d0900", "gasPrice": "0xee6b280", "hash": "0xa9af72199b085387a4103b267b0329155fc9bfe052a897400be45193df01bf36", "input": "0x2cc4081e0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000552d25219e36d00000000000000000000000000000000000000000000000000000000648881840000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000600000000000000000000000003355df6d4c9c3035724fd0e3914de96a5a83aaf4000000000000000000000000000000000000000000000000000000000027e9700000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000080115c708e12edd42e504c1cd52aea96c547c05c00000000000000000000000000000000000000000000000000000000000000800000000000000000000000004a2072a41ff717c1adc786f795041163cf63d5a4000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000600000000000000000000000003355df6d4c9c3035724fd0e3914de96a5a83aaf40000000000000000000000008f28567e1ac98b67f0eecc00c3448543681b5d8900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000", "l1BatchNumber": "0xfe7a", "l1BatchTxIndex": "0x1b8", "maxFeePerGas": "0xee6b280", "maxPriorityFeePerGas": "0xee6b280", "nonce": "0x1b", "r": "0xa51d549c1d6c72b78162179be80d3349ccae0243f069f737345679d341a01636", "s": "0x112bb0b741c5d8fb44e481b017ebbf4f3ebe4a3ee962a1f9cd8c4d09f29158f", "to": "0x2da10a1e27bf85cedd8ffb1abbe97e53391c0295", "transactionIndex": "0x9", "type": "0x0", "v": "0x0", "value": "0x0" }, "id": 1 } ``` --- ## `eth_getTransactionByBlockHashAndIndex` > Returns information on a transaction specified by block hash and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. 2. `` (quantity): a transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0xeb83cac74ab6c6ba55548bb4789d15c6c795f63e7aa1d8c185712e3531fa004a", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "blockHash": "0xeb83cac74ab6c6ba55548bb4789d15c6c795f63e7aa1d8c185712e3531fa004a", "blockNumber": "0x5aca5d", "chainId": "0x144", "from": "0x9590e8d463b8c11a77596d70c3507ee808bc8295", "gas": "0x9f148", "gasPrice": "0xee6b280", "hash": "0x6a29f1619aa8a6f638e205c6ab7b2d5db1c2e5156893442382f17cbed7163ab4", "input": "0x095ea7b30000000000000000000000002da10a1e27bf85cedd8ffb1abbe97e53391c0295000000000000000000000000000000000000000000000000000000000003974d", "l1BatchNumber": "0xfe7a", "l1BatchTxIndex": "0x1af", "maxFeePerGas": "0xee6b280", "maxPriorityFeePerGas": "0xee6b280", "nonce": "0x30", "r": "0x6c9ed638eccf05a74633693b3f77d5c30283ae951cc9b0d4c8105350df837b86", "s": "0x20fc2eeaad245d5607a13ba533cd4bb86667a29cbdebb4531fa433242084c261", "to": "0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4", "transactionIndex": "0x0", "type": "0x2", "v": "0x0", "value": "0x0" }, "id": 1 } ``` --- ## `eth_getTransactionByBlockNumberAndIndex` > Returns information on a transaction by block number and transaction index position. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. 2. `` (quantity): the transaction index position. ### Returns * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. * `from` (string; data, 20 bytes): an address of the sender. * `gas` (string; quantity): the gas provided by the sender. * `gasPrice` (string; quantity): the gas price provided by the sender in wei. * `hash` (string; data, 32 bytes): the hash of the transaction. * `input` (string; data): the data send along with the transaction. * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. * `value` (string; quantity): the value transferred in wei. * `v` (string; quantity): ECDSA recovery ID. * `r` (string; quantity): ECDSA signature r. * `s` (string; quantity): ECDSA signature s. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", "0x0"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": { "blockHash": "0xc82abfd8fedfd336ddb03b8a5e31f8cee1d0e6d13707a74ae71d0acbf6e6ef9e", "blockNumber": "0x5ad037", "chainId": "0x144", "from": "0x207ba3e91122150f7c7ecf6a71bb760e7245145f", "gas": "0x376530", "gasPrice": "0xee6b280", "hash": "0x86d6f4d5ae0fc4c8ca76b9ff8098cd67eaa6dd40c5e0ed715e906e0bddee46d9", "input": "0x94ec6d7800000000000000000000000080115c708e12edd42e504c1cd52aea96c547c05c00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000002648fbcdd8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000020000000000000000000000003355df6d4c9c3035724fd0e3914de96a5a83aaf400000000000000000000000000000000000000000000000000000000007a12000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e35fa931a00000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000207ba3e91122150f7c7ecf6a71bb760e7245145f0000000000000000000000000000000000000000000000000000000000000000", "maxFeePerGas": "0xee6b280", "maxPriorityFeePerGas": "0xee6b280", "nonce": "0x1e", "r": "0xb346ceb12f3653cd95a46f1030ca90d80a417dbc2a842daa3beb540765c30806", "s": "0x39241dd14c097058b77f1b48dd8569c4da0b1400714abe25971351a9764fc566", "to": "0x2da10a1e27bf85cedd8ffb1abbe97e53391c0295", "transactionIndex": "0x0", "type": "0x0", "v": "0x0", "value": "0xe35fa931a0000" }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-api/zksync-era/web3/ title: zkSync Era — web3, net, eth (1/2) source: docs/rpc-service/chains/chains-api/zksync-era/web3.mdx --- # zkSync Era — web3, net, eth (1/2) > API reference for [zkSync Era](/rpc-service/chains/chains-api/zksync-era/). [All methods ->](/rpc-service/chains/chains-api/zksync-era/#methods) > > Part 1 of 2: 1 · [2](/rpc-service/chains/chains-api/zksync-era/web3-p2/) ## `web3_clientVersion` > Returns the current client version. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current client version. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "zkSync/v2.0", "id": 1 } ``` --- ## `net_version` > Returns the current network ID. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: the current network ID. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "324", "id": 1 } ``` --- ## `net_listening` > Returns `true` if client is actively listening for network connections. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``: `true` when listening, otherwise `false`. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "net_listening", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": false, "id": 1 } ``` --- ## `eth_syncing` > Returns an object with data about the sync status or false. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * ``|``: an object with sync status data or `false`, when not syncing: * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. * `highestBlock` (quantity): the estimated highest block. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ### Response example (syncing) ```json { "id": 1, "jsonrpc": "2.0", "result": { "startingBlock": "0x384", "currentBlock": "0x386", "highestBlock": "0x454" } } ``` ### Response example (not syncing) ```json { "jsonrpc": "2.0", "id": 1, "result": false } ``` --- ## `eth_gasPrice` > Returns the current price per gas in wei. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current gas price in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xee6b280" } ``` --- ## `eth_accounts` > Returns a list of addresses owned by client. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (string; data, 20 bytes): addresses owned by the client. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": [ "0x407d73d8a49eeb85d32cf465507dd71d507100c1" ] } ``` --- ## `eth_blockNumber` > Returns the number of most recent block. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): none. ### Returns * `` (quantity): the current block number the client is on. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5ac7c8" } ``` --- ## `eth_getBalance` > Returns the balance of the account specified by address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to check for balance. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the current balance in wei. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x94E7358492C968FCA9D984aB507067Ea734233Ce", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getStorageAt` > Returns the value from a storage position at an address specified. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address of the storage (hex encoded). 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the value at this storage position. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x46bb5369701C44E3F1a78825A5E55743B0D81401", "0x0", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000000000000000000" } ``` --- ## `eth_getTransactionCount` > Returns the number of transactions sent from an address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions send from this address. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x46bb5369701C44E3F1a78825A5E55743B0D81401", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getBlockTransactionCountByHash` > Returns the number of transactions in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of transactions in this block. ### Request example: ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0xfa13ccdd4ca844efdf9f1a13ef1794f8c953683f995f4e00d18d91177b9e0df8"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x8" } ``` --- ## `eth_getBlockTransactionCountByNumber` > Returns the number of transactions in the block specified by number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of transactions in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "result": "0xa", "id": 1 } ``` --- ## `eth_getUncleCountByBlockHash` > Returns the number of uncles in a block specified by block hash. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 32 bytes): a block hash. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": ["0x2b64fbd89591504539f013f3a00fbeb01d6927fc72e08e9ef0bc0d0c041492fa"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getUncleCountByBlockNumber` > Returns the number of uncles in a block specified by block number. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (quantity): the number of uncles in this block. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": ["latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0" } ``` --- ## `eth_getCode` > Returns code at a given address. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data, 20 bytes): an address to get the code from. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (data): the code from the given address. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x1F7038C8ed2BF70bB6dEf7b0ca18A26CE1c7FFb7", "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x" } ``` --- ## `eth_sendRawTransaction` > Creates new message call transaction or a contract creation for signed transactions. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (data): the signed transaction data. ### Returns * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/zksync-era/eth/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xbb2cd72800000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000020b28b1e4665fff290650586ad76e977eab90c5d000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000028898b37ea"], "id": 1 }' ``` ### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` --- ## `eth_call` > Executes a new message call immediately without creating a transaction on the blockchain. ### Parameters * `id` (integer; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (array; required): 1. `` (hex encoded): the transaction object: * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. * `to` (string; data, 20 bytes): the address the transaction is directed to. * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. * `value` (string; quantity; optional): the value sent with this transaction, in wei. * `data` (string; data; optional): the hash of the method signature and encoded parameters. 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: * `earliest`: the lowest numbered block available on the client. * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. ### Returns * `` (hex encoded bytes): the return value of executed contract. ### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era/YOUR_ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x4D5a7038ca6573eA6682e788843f53d33B453BeE","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": 1 }' ``` ### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x0000000000000000000000000000000000000000000000000858898f93629000" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/0g-b-p2/ title: Supported Chains: 0G-B (2/3) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains 0G-B — 0G, Allora, Aptos, Arbitrum, and more. source: docs/rpc-service/chains/chains-list/0g-b-p2.mdx --- Supported chains **0G-B** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 2 of 3: [1](/rpc-service/chains/chains-list/0g-b/) · 2 · [3](/rpc-service/chains/chains-list/0g-b-p3/) ## Arbitrum Nova
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Arbitrum Nova API is available on [Web3 API platform](https://www.ankr.com/rpc/arbitrumnova). Arbitrum Nova offers an ultra-low transaction costs with high security. Nova powers dapps with high transaction volumes that seek to drive costs even lower. Official quick links: [Website](https://nova.arbitrum.io/), [Docs](https://developer.offchainlabs.com/getting-started-devs), [GitHub](https://github.com/OffchainLabs/arbitrum) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Arbitrum Nova, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/arbitrum-nova) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrumnova/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/arbitrumnova/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/arbitrumnova/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/arbitrumnova/{your_token}F' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x257932" } ``` --- ## Atleta
> Atleta API is available on [Web3 API platform](https://www.ankr.com/rpc/atleta). Atleta is a modular, multi-layer, EVM-compatible, smart contract platform with native cross-chain interoperability, dedicated to servicing the sports industry. Key Features of Atleta Network: * **Modular Multi-Layer Architecture**: Atleta's design separates core blockchain functions into distinct layers — Execution, Interoperability, and Storage. This modularity allows for scalability and adaptability, enabling seamless upgrades without disrupting ongoing operations. * **Execution Layer**: An Ethereum Virtual Machine (EVM)-compatible smart contract layer that facilitates transactions and supports the development of decentralized applications. * **Interoperability Layer**: Enables cross-chain communication, allowing for the transfer of assets and messages between different blockchain networks, thereby fostering a connected and collaborative ecosystem. * **Storage Layer**: Provides a decentralized data storage solution for various types of information, including videos, text files, and images, ensuring secure and efficient data management. * Nominated Proof-of-Stake (NPoS) Consensus Mechanism: Atleta employs NPoS to enhance decentralization and security. This consensus model allows a wide range of participants to contribute to network validation and governance, promoting inclusivity and resilience. * **High Performance and Scalability**: The network is designed to handle substantial transaction volumes, achieving approximately 60–80 transactions per second with a block time of around 6 seconds. This performance is facilitated by its Substrate-based architecture, which enables modular scalability. * **Instant Finality**: Utilizing the GRANDPA (GHOST-based Recursive Ancestor Deriving Prefix Agreement) finality gadget, Atleta ensures immediate transaction finality per block, enhancing security and efficiency. * **EVM Compatibility**: Atleta supports EVM-compatible smart contracts, allowing developers to deploy existing Ethereum-based applications and leverage liquidity across other EVM networks seamlessly. Official quick links: [Website](https://atleta.network/), [Docs](https://blockchain-sports.gitbook.io/atleta-network), [GitHub](https://github.com/atleta-network) ### Networks * Testnet: * Olympia (`HTTPS` and `WSS`) ### API methods For Atleta, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/atleta/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/atleta_olympia \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/atleta_olympia" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/atleta_olympia' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/atleta_olympia' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7b0d3" } ``` --- ## Avail
> Avail API is available on [Web3 API platform](https://www.ankr.com/rpc/avail). Avail is a Web3 infrastructure layer that allows modular execution layers to scale and interoperate in a trust minimized way. A foundational Data Availability (DA) layer, Nexus interoperability layer, and Fusion Security network layer come together to form the Unification Layer. * The DA layer is a highly optimized, low-level layer, specifically constructed for data availability. This is the deepest blockchain layer, with the minimal functionality required to build cross-ecosystem interoperability on top. * Nexus acts as a light but powerful proof aggregation and sequencer selection ZK rollup on top of Avail, allowing for cross-rollup and cross-ecosystem settlement. * Fusion Security enables a basket of tokens to pool their crypto-economic security to serve and secure the Avail network. Avail's mission is to streamline the rollup experience, offering a unified, efficient platform for both users and developers from any ecosystem. This vertically integrated stack aims to dissolve the growing pains and user fragmentation experienced today, enabling Rollups to seamlessly access users and liquidity across the entire blockchain landscape. The Turing Testnet is live and marks Avail's final and definitive pre-Mainnet testing environment, aimed at vetting Mainnet deployments, executing extensive stress tests, and assessing network topologies for scalability and resilience. Official quick links: [Website](https://www.availproject.org/), [Docs](https://docs.availproject.org/), [GitHub](https://github.com/availproject) ### Networks * Turing Testnet (`HTTPS` and `WSS`) ### API methods For Avail, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/avail/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `state_getMetadata`, `state_getPairs`, `state_traceBlock`, `state_trieMigrationStatus`, `state_subscribeStorage`, `state_unsubscribeStorage`, `state_queryStorage`, `sync_state_genSyncSpec`, `system_accountNextIndex`, `system_addLogFilter`, `system_addReservedPeer`, `system_health`, `system_localListenAddresses`, `system_localPeerId`, `system_name`, `system_nodeRoles`, `system_peers`, `system_properties`, `system_removeReservedPeer`, `system_reservedPeers`, `system_resetLogFilter`, `system_syncState`, `system_unstable_networkState`, `system_version`, `account_*`, `babe_*`, `mmr_*`, `dev_*`, `offchain_*`, `author_*` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/avail_turing_testnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlock", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block": { "header": { "parentHash": "0x32d67a9e5843dd8527bf0e2ec1f4c6d2f8642ef264348ef7d610575619a5b6e8", "number": "0x49993", "stateRoot": "0x7d0860d48e20e42886aeac479dd339d1f75387d3be844a490ca1734efd430213", "extrinsicsRoot": "0x07d2cb3154a4bc3ff485d0101bb1cba8045bf1bd74a34a977cc2672a41e76596", "digest": { "logs": [ "0x0642414245b5010359000000757a1e0500000000841bf8fb61a548ec94caba8ddedcf85e02de0110990ffe3c4216277ee0b9734a9b966b69d9025691e82043d9a647ce917871b1b2d2082afc3ce3b195c96e1c039b2e312d9028cf976284d61c41f1069b1df154b5e6b6bef9ad4455dd24ea160d", "0x05424142450101c2be2a753a256b1261e00d5d31a20befa735767d5debe27edfff52149e4ce53398135479d97a0e594a2160cf78b3743ca42899138b0c5b58334bc7c4d0217080" ] }, "extension": { "V3": { "appLookup": { "size": 114, "index": [ { "appId": 36, "start": 0 } ] }, "commitment": { "rows": 1, "cols": 128, "commitment": [ 128, 27, 216, 161 ], "dataRoot": "0x67e432157400275ba4e6e7c9d61312afa5cbbea68d8b718fa8be3038980a9970" } } } }, "extrinsics": [ "0x280403000ba0f41eed8f01", "0xc90384007ce8ccf46bbdf7561f0d1419857dab91bfbda9866d564c2c5cfe43210a75db310122850737c933478016ee92ddcbd1eda470ead30b6a7938adba396b9e51922949b1bba1bf56ca8bd67f2241b1240fa1f2bd18f07b42111fe70f9f386b78f66f87040162760100000001020c0603004e558a63713b227cb661a5cb639c5bea499bd00039d7dabe16cb891e8fc2025213000064a7b3b6e00d06030006aa84733a1b39c3cc83586e589fd6bb82228321e1f75d4e2bc3af8d4957785213000064a7b3b6e00d0603003a1e5289c81ff9dfd53cf55e64aaaee9aeb31e5ae43c9679de15a841b406521d13000064a7b3b6e00d" ] }, "justifications": null }, "id": 1 } ``` --- ## Avalanche
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Avalanche API is available on [Web3 API platform](https://www.ankr.com/rpc/avalanche). Avalanche is an open-source platform for launching decentralized applications and enterprise blockchain deployments in one interoperable, highly scalable ecosystem. Avalanche is the first decentralized smart contracts platform built for the scale of global finance, with near-instant transaction finality. Ethereum developers can quickly build on Avalanche as Solidity works out-of-the-box. Avalanche is an ecosystem that features three built-in blockchains: [Exchange Chain (X-Chain)](https://docs.avax.network/overview/getting-started/avalanche-platform#exchange-chain-x-chain), [Platform Chain (P-Chain)](https://docs.avax.network/overview/getting-started/avalanche-platform#platform-chain-p-chain), and [Contract Chain (C-Chain)](https://docs.avax.network/overview/getting-started/avalanche-platform#contract-chain-c-chain). Official quick links: [Website](https://www.avax.network/), [Docs](https://docs.avax.network/), [GitHub](https://github.com/ava-labs) ### Networks * Mainnet / Fuji Testnet: * Standard EVM API (`HTTPS` and `WSS`) * X-Chain (`HTTPS`) * P-Chain (`HTTPS`) * C-Chain (`HTTPS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with Avalanche through Ankr's infrastructure, add a required Avalanche network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add Avalanche Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Avalanche Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/avalanche/{your_token}`. * **Chain ID**: `43114`. * **Currency symbol**: `AVAX`. * **Block explorer URL**: `https://snowtrace.io/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Avalanche Mainnet. To add Avalanche Fuji Testnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Avalanche Fuji Testnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/avalanche_fuji/{your_token}`. * **Chain ID**: `43113`. * **Currency symbol**: `AVAX`. * **Block explorer URL**: `https://testnet.snowtrace.io/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Avalanche Fuji Testnet. ### API methods For Avalanche, we support blockchain interaction via the following methods: * [Standard EVM methods](/rpc-service/chains/chains-api/avalanche/#evm-methods) * [P-Chain methods](/rpc-service/chains/chains-api/avalanche/evm-methods-2/#p-chain-methods) * [C-Chain methods](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#c-chain-methods) * [X-Chain methods](/rpc-service/chains/chains-api/avalanche/p-chain-methods/#x-chain-methods) #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`, `eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*`, `avm.createAddress`, `avm.exportKey`, `avm.importKey`, `avm.export`, `avm.import`, `avm.mint`, `avm.createFixedCapAsset`, `avm.createVariableCapAsset`, `avm.createNFTAsset`, `avm.mintNFT`, `avm.listAddresses`, `avm.send`, `avm.sendMultiple`, `avm.sendNFT`, `wallet.send`, `wallet.sendMultiple`, `wallet.issueTx`, `avax.export`, `avax.exportAVAX`, `avax.exportKey`, `avax.import`, `avax.importAVAX`, `avax.importKey`, `platform.addDelegator`, `platform.addValidator`, `platform.addSubnetValidator`, `platform.createAddress`, `platform.createBlockchain`, `platform.createSubnet`, `platform.exportAVAX`, `platform.exportKey`, `platform.importAVAX`, `platform.importKey`, `platform.listAddresses` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example (Standard EVM) ```shell curl -X POST https://rpc.ankr.com/avalanche/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/avalanche/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/avalanche/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/avalanche/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example (Standard EVM) ```json { "jsonrpc":"2.0", "result":"0x155ea63", "id":1 } ``` #### Request example (P-Chain) ```shell curl -X POST 'https://rpc.ankr.com/avalanche-p/{your_token}' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getBalance", "params" :{ "address":"P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p" } }' ``` #### Response example (P-Chain) ```json { "jsonrpc": "2.0", "id": 1, "result": { "txID": "NUPLwbt2hsYxpQg4H2o451hmTWQ4JZx2zMzM4SinwtHgAdX1JLPHXvWSXEnpecStLj" } } ``` #### Request example (C-Chain) ```shell curl -X POST 'https://rpc.ankr.com/avalanche-c/{your_token}' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avax.getAtomicTx", "params" : { "txID":"2GD5SRYJQr2kw5jE73trBFiAgVQyrCaeg223TaTyJFYXf2kPty", "encoding": "hex" } }' ``` #### Response example (C-Chain) ```json { "jsonrpc": "2.0", "result": { "tx": "0x000000000000000030399d0775f450604bd2fbc49ce0c5c1c6dfeb2dc2acb8c92c26eeae6e6df4502b19d891ad56056d9c01f18f43f58b5c784ad07a4a49cf3d1f11623804b5cba2c6bf000000018212d6807a0ec9c1b26321418fe7a548180b5be728ce53fe7e98ab5755ed316100000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000005000003a352a382400000000100000000000000018db97c7cece249c2b98bdc0226cc4c2a57bf52fc000003a3529edd17dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000010000000900000001ead19377f015422fbb8731204fcf6d6879dd05146c2d5b5594e2fea2cb420b2f40bd457b71e279e547790b28fe5482f278c76cf39b2dce5c2e6c53352fe6827d002cc7d20d", "encoding": "hex", "blockHeight": "1" }, "id": 1 } ``` #### Request example (X-Chain) ```shell curl -X POST 'https://rpc.ankr.com/avalanche-x/{your_token}' \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "id" :1, "method" :"avm.getAddressTxs", "params" : { "address":"X-avax1dp6707ka34puejwg7ntnenxry98h37yvsqsm7f", "assetID":"AVAX", "pageSize":20 } }' ``` #### Response example (X-Chain) ```json { "jsonrpc": "2.0", "result": { "txIDs": ["SsJF7KKwxiUJkczygwmgLqo3XVRotmpKP8rMp74cpLuNLfwf6"], "cursor": "1" }, "id": 1 } ``` --- ## B2 Network
> B² Network API is available on [Web3 API platform](https://www.ankr.com/rpc/b2). The B² Network is an advanced Layer-2 solution designed to enhance transaction speed, reduce costs, and broaden application diversity without compromising security. It is notable for being the first zero-knowledge proof verification commitment rollup on Bitcoin. Key Features: * **Zero-Knowledge Proof Verification**: Utilizes zero-knowledge proof technology to ensure transactional privacy and security, allowing for the verification of transactions without revealing the underlying data. * **Rollup Technology**: Processes multiple off-chain transactions and rolls them into a single on-chain transaction, significantly increasing efficiency and reducing costs. * **Turing-Complete Smart Contracts**: Supports Turing-complete smart contracts, enabling complex computations and a wide range of decentralized applications (dApps) to run off-chain with enhanced performance. * **Gate Commitment and Challenge-Response Mechanism**: Integrates gate commitment and challenge-response mechanisms, leveraging Taproot on Bitcoin to ensure secure and private transaction confirmations. * **EVM-Compatibility**: The B² Network is compatible with the Ethereum Virtual Machine (EVM), allowing it to run Ethereum-based smart contracts and dApps. This compatibility enables developers to use existing Ethereum tools, libraries, and standards while benefiting from the B² Network's enhanced features. Official quick links: [Website](https://bsquared.network/), [Docs](https://docs.bsquared.network/), [GitHub](https://github.com/b2network) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For B² Network, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/b2-network/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/b2 \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/b2" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/b2' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/b2' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0x21194c" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/0g-b-p3/ title: Supported Chains: 0G-B (3/3) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains 0G-B — 0G, Allora, Aptos, Arbitrum, and more. source: docs/rpc-service/chains/chains-list/0g-b-p3.mdx --- Supported chains **0G-B** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 3 of 3: [1](/rpc-service/chains/chains-list/0g-b/) · [2](/rpc-service/chains/chains-list/0g-b-p2/) · 3 ## Base
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Base API is available on [Web3 API platform](https://www.ankr.com/rpc/base). Base is a secure, low-cost, developer-friendly Ethereum L2 built to bring the next billion users to web3. Base is built on the [Bedrock](https://stack.optimism.io/docs/releases/bedrock/explainer/) release of the [OP Stack](https://stack.optimism.io/), which is designed from the ground up to be as close to Ethereum as possible. Because of this, there are very little differences when it comes to building on Base and Ethereum. However, there are still some minor discrepancies between the behavior of Base and Ethereum that you should be aware of when building apps on top of Base. These minor differences include: * [Opcodes](https://stack.optimism.io/docs/releases/bedrock/differences/#opcode-differences) * [Blocks](https://stack.optimism.io/docs/releases/bedrock/differences/#blocks) * [Network specifications](https://stack.optimism.io/docs/releases/bedrock/differences/#network-specifications) * [Transaction costs](https://stack.optimism.io/docs/releases/bedrock/differences/#transaction-costs) Official quick links: [Website](https://base.org/), [Docs](https://docs.base.org/), [GitHub](https://github.com/base-org) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet: * Sepolia (`HTTPS` and `WSS`) ### API methods For Base, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/base) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/base/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/base/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/base/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/base/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x459996" } ``` --- ## Bitcoin
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Bitcoin API is available on [Web3 API platform](https://www.ankr.com/rpc/btc). *Bitcoin* API provides the means for communication with the Bitcoin’s public ledger. Official quick links: [Website](https://bitcoin.org/), [Docs](https://developer.bitcoin.org/), [GitHub](https://github.com/bitcoin/bitcoin) ### Networks * Mainnet (`HTTPS`) * Signet Testnet (`HTTPS`) ### API methods For Bitcoin, we support blockchain interaction via the following interfaces: * [Bitcoin API native methods](/rpc-service/chains/chains-api/btc/#bitcoin-native-methods) * [Blockbook API methods](/rpc-service/chains/chains-api/btc/#blockbook-api-methods) #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **Bitcoin's HTTPS**: `savemempool`, `verifychain`, `getmemoryinfo`, `getrpcinfo`, `gettransaction`, `help`, `logging`, `stop`, `uptime`, `getblocktemplate`, `getmininginfo`, `getnetworkhashps`, `pruneblockchain`, `generateblock`, `generatetoaddress`, `generatetodescriptor`, `prioritisetransaction`, `submitblock`, `submitheader`, `addnode`, `clearbanned`, `disconnectnode`, `getaddednodeinfo`, `getconnectioncount`, `getnettotals`, `getnetworkinfo`, `getnodeaddresses`, `getpeerinfo`, `listbanned`, `ping`, `setban`, `setnetworkactive`, `signrawtransactionwithkey`, `createmultisig`, `getdescriptorinfo`, `signmessagewithprivkey`, `abandontransaction`, `abortrescan`, `addmultisigaddress`, `backupwallet`, `bumpfee`, `createwallet`, `dumpprivkey`, `dumpwallet`, `encryptwallet`, `getaddressesbylabel`, `getbalance`, `getbalances`, `getnewaddress`, `getrawchangeaddress`, `getreceivedbyaddress`, `getreceivedbylabel`, `getunconfirmedbalance`, `getwalletinfo`, `importaddress`, `importdescriptors`, `importmulti`, `importprivkey`, `importprunedfunds`, `importpubkey`, `importwallet`, `keypoolrefill`, `listaddressgroupings`, `listlabels`, `listlockunspent`, `listreceivedbyaddress`, `listreceivedbylabel`, `listtransactions`, `listsinceblock`, `listunspent`, `listwalletdir`, `listwallets`, `loadwallet`, `lockunspent`, `psbtbumpfee`, `removeprunedfunds`, `rescanblockchain`, `send`, `sendmany`, `sendtoaddress`, `sethdseed`, `setlabel`, `setwalletflag`, `signmessage`, `settxfee`, `signrawtransactionwithwallet`, `unloadwallet`, `upgradewallet`, `walletcreatefundedpsbt`, `walletlock`, `walletpassphrase`, `walletpassphrasechange`, `walletprocesspsbt`, `deriveaddresses`, `fundrawtransaction`, `scantxoutset`, `preciousblock`, `gettxoutsetinfo` **Blockbook API**: * All WebSocket methods * All `socket.io` methods ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/btc/{your_token} \ -d '{ "id": "hmm", "method": "getindexinfo", "params": [] }' ``` ```shell curl -X GET https://rpc.ankr.com/premium-http/btc_blockbook/{your_token}/api/v2/utxo/bc1qxhmdufsvnuaaaer4ynz88fspdsxq2h9e9cetdj?confirmed=true ``` #### Response example ```json { "result": { "txindex": { "synced": true, "best_block_height": 843277 }, "basic block filter index": { "synced": true, "best_block_height": 843277 } }, "error": null, "id": "hmm" } ``` ```json [ { "txid": "c80f70c48aff883b060aed28544aec0fbdeb3db913a214d37194cee6337b0437", "vout": 1, "value": "319691557", "height": 854658, "confirmations": 3, "coinbase": true }, { "txid": "d6957ef0d3a8a13b369f4996f3a80182acc26445508f22ac50a4cea468663f06", "vout": 1, "value": "317092804", "height": 854649, "confirmations": 12, "coinbase": true }, { "txid": "9b11befa61b7e7bc7440fcb68213c6ecf2c19f50bfac4fc5a4bbe37dad138d0d", "vout": 1, "value": "319367244", "height": 854646, "confirmations": 15, "coinbase": true } ] ``` --- ## Bitlayer
> Bitlayer API is available on [Web3 API platform](https://www.ankr.com/rpc/bitlayer). *Bitlayer* is the first Bitcoin security-equivalent layer 2 based on BitVM. It consists of an EVM compatible chain/sequencer that can map BTC ecological assets and facilitate the entry of BTC users. Official quick links: [Website](https://www.bitlayer.org/), [Docs](https://docs.bitlayer.org/), [GitHub](https://github.com/bitlayer-org) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Bitlayer, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/bitlayer/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/bitlayer \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/bitlayer" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/bitlayer' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/bitlayer' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4718" } ``` --- ## Blast
> Blast API is available on [Web3 API platform](https://www.ankr.com/rpc/blast). Blast is the only Ethereum L2 with native yield for ETH and stablecoins. Official quick links: [Website](https://blast.io/), [Docs](https://docs.blast.io/about-blast) ### Networks * Mainnet (`HTTPS` and `WSS`) * Sepolia Testnet (`HTTPS` and `WSS`) ### API methods For Blast, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/blast/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/blast_testnet_sepolia \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/blast_testnet_sepolia" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/blast_testnet_sepolia' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/blast_testnet_sepolia' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0x1e7a17" } ``` --- ## BNB Smart Chain
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > BNB Smart Chain API is available on [Web3 API platform](https://www.ankr.com/rpc/bsc). BNB Smart Chain (BSC) (previously Binance Smart Chain) is an innovative solution to bring programmability and interoperability to Beacon Chain. BNB Smart Chain relies on a system of 21 active validators with Proof of Staked Authority (PoSA) consensus that can support short block time and lower fees. The most bonded validator candidates of staking will become validators and produce blocks. The double-sign detection and other slashing logic guarantee security, stability, and chain finality. To the EVM compatibility that permits support for Ethereum tools and DApps, BNB Smart Chain adds smart contract functionality to the chain. The dual-chain architecture alongside Binance Chain enables sending and receiving of BNB and BEP2 tokens cross-chain. Official quick links: [Website](https://www.bnbchain.org/en/smartChain), [Docs](https://docs.bnbchain.org/docs/learn/intro), [GitHub](https://github.com/bnb-chain) ### Networks * Mainnet (`HTTPS` and `WSS`) * Chapel Testnet (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with BNB Smart Chain through Ankr's infrastructure, add a required BNB Smart Chain network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add BNB Smart Chain Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `BNB Smart Chain Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/bsc/{your_token}`. * **Chain ID**: `56`. * **Currency symbol**: `BNB`. * **Block explorer URL**: `https://bscscan.com/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with BNB Smart Chain Mainnet. To add BNB Smart Chain Testnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `BNB Smart Chain Chapel Testnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/bsc_testnet_chapel/{your_token}`. * **Chain ID**: `97`. * **Currency symbol**: `BNB`. * **Block explorer URL**: `https://testnet.bscscan.com/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with BNB Smart Chain Chapel Testnet. ### API methods For BNB Smart Chain, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/bnb-smart-chain/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/bsc/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/bsc/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/bsc/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/bsc/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0x1601d3a" } ``` --- ## Botanix
> Botanix API is available on [Web3 API platform](https://www.ankr.com/rpc/botanix). Botanix is a decentralized Turing-complete Layer 2 EVM built on the native currency of bitcoin. It operates using two core components: * **Ethereum Virtual Machine**: Fortified by a Proof-of-Stake consensus protocol that leverages Bitcoin's Proof-of-Work for superior security. Stakes are represented by actual bitcoin stored securely within multi-signature wallets on the Bitcoin network. By supporting EVM, Botanix allows developers to seamlessly port existing Ethereum dApps to the Bitcoin ecosystem. * **Spiderchain Protocol**: At the core of Botanix is the Spiderchain, a series of successive multisignature (multisig) wallets managed by randomized sets of orchestrators. This structure secures user funds and facilitates the movement of Bitcoin within the network, effectively separating Bitcoin "the asset" from Bitcoin "the blockchain." By securing the Bitcoin present on Botanix in a decentralized chain of multisigs, it separates Bitcoin from the EVM. This allows for a transition from Bitcoin’s UTXO model to an account model used in the EVM. Official quick links: [Website](https://www.botanixlabs.xyz/), [Docs](https://docs.botanixlabs.xyz/botanix-labs), [GitHub](https://github.com/botanix-labs) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Botanix, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/botanix/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/botanix_testnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/botanix_testnet" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/botanix_testnet' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/botanix_testnet' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5c061" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/0g-b/ title: Supported Chains: 0G-B (1/3) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains 0G-B — 0G, Allora, Aptos, Arbitrum, and more. source: docs/rpc-service/chains/chains-list/0g-b.mdx --- Supported chains **0G-B** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-list/0g-b-p2/) · [3](/rpc-service/chains/chains-list/0g-b-p3/) ## 0G
> 0G API is available on [Web3 API platform](https://www.ankr.com/rpc/0g). 0G Chain is a highly scalable, AI-optimized L1 blockchain designed to meet the needs of data-heavy applications. Built with a modular architecture, it allows for the independent optimization of key components like consensus, execution, and storage—making it ideal for AI-driven workflows. 0G is fully EVM-compatible, so decentralized applications (dApps) already deployed on other L1 or L2 chains (such as Ethereum or rollups) can easily leverage 0G's products without needing to migrate entirely. 0G Chain supports a [data availability network](https://docs.0g.ai/da/0g-da), [distributed storage network](https://docs.0g.ai/0g-storage), and [AI compute network](https://docs.0g.ai/0g-compute). All of these networks integrate with 0G Chain's highly scalable consensus network, built to handle massive data volumes suitable for AI. Official quick links: [Website](https://0g.ai/), [Docs](https://docs.0g.ai/), [GitHub](https://github.com/0glabs) ### Networks * Testnet: * EVM JSON-RPC API (`HTTPS` and `WSS`) * Tendermint RPC API (`HTTPS` and `WSS`) * Tendermint REST API (`HTTPS`) * Beaconkit REST API (`HTTPS`) ### API methods For 0G, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/0g/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **Tendermint (both for REST and JSON-RPC)**: `/health`, `/genesis`, `/broadcast_evidence`, `/dial_seeds`, `/dial_peers`, ### API querying #### EVM JSON-RPC ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_evm \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```json { "jsonrpc":"2.0", "id":1, "result":"0x27204c" } ``` #### Tendermint JSON-RPC ```shell curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "blockchain", "params": ["1", "2"], "id": 1 }' ``` ```json { "id": 1, "jsonrpc": "2.0", "result": { "last_height": "2564214", "block_metas": [ { "block_id": { "hash": "ED3BF22DDEAABE5B194ECE00FC97B73B31D6B6E381946054ADF248FADA65FD4F", "parts": { "total": 1, "hash": "268422F8D294840DBC5B24FB031F976357E8478F72C16B66E7B7388C2429D18F" } }, "block_size": "830", "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "2", "time": "2024-06-24T07:25:41.380275895Z", "last_block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "last_commit_hash": "5148301A7ABA311392D676C3C967F299F85A1AD48D74E96AF083DA4787FF9C2D", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "21181DF7C886CEE14012C07031E55BF04428BF77979015F2869ED1EACABAD22E", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "CDFF531A3AFA255BC193D52721027366935F9BF8" }, "num_txs": "0" }, { "block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "block_size": "353", "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "1", "time": "2024-06-24T07:24:31.526533772Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD" }, "num_txs": "0" } ] } } ``` #### Tendermint REST ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/blockchain?minHeight=1&maxHeight=2 ``` ```json { "jsonrpc": "2.0", "id": -1, "result": { "last_height": "2564234", "block_metas": [ { "block_id": { "hash": "ED3BF22DDEAABE5B194ECE00FC97B73B31D6B6E381946054ADF248FADA65FD4F", "parts": { "total": 1, "hash": "268422F8D294840DBC5B24FB031F976357E8478F72C16B66E7B7388C2429D18F" } }, "block_size": "830", "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "2", "time": "2024-06-24T07:25:41.380275895Z", "last_block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "last_commit_hash": "5148301A7ABA311392D676C3C967F299F85A1AD48D74E96AF083DA4787FF9C2D", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "21181DF7C886CEE14012C07031E55BF04428BF77979015F2869ED1EACABAD22E", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "CDFF531A3AFA255BC193D52721027366935F9BF8" }, "num_txs": "0" }, { "block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "block_size": "353", "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "1", "time": "2024-06-24T07:24:31.526533772Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD" }, "num_txs": "0" } ] } } ``` #### Beaconkit REST ```shell curl https://rpc.ankr.com/http/0g_galileo_testnet_beaconkit/eth/v1/node/version ``` ```json { "data": { "version": "1.1.0" } } ``` --- ## Allora
> Allora API is available on [Web3 API platform](https://www.ankr.com/rpc/allora). The Allora Network is an advanced protocol that leverages decentralized AI and machine learning (ML) to generate and share predictions among its participants. It provides a structured way for users to access on-chain AI predictions and pay the AI/ML node operators who produce these insights. Allora acts as a bridge between various parties — data owners, processors, AI/ML predictors, market analysts, and end-users — allowing them to utilize and act on these predictions. AI/ML agents on the network use their data and algorithms to broadcast predictions across a peer-to-peer network. They also evaluate predictions from other agents. The network’s consensus mechanism then combines these predictions and assessments, rewarding agents based on the quality of their contributions. This incentive system helps Allora continuously learn and adapt to changing market conditions. Official quick links: [Website](https://www.allora.network/), [Docs](https://docs.allora.network/home/explore), [GitHub](https://github.com/allora-network) ### Networks * Testnet: * Tendermint RPC API (`HTTPS` and `WSS`) * Tendermint REST API (`HTTPS`) * Cosmos REST API (`HTTPS`) ### API methods For Allora, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/allora/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **Tendermint (both for REST and JSON-RPC)**: `/health`, `/genesis`, `/broadcast_evidence`, `/dial_seeds`, `/dial_peers`, **Cosmos**: `/cosmos/auth/v1beta1/address_by_id/{id}`, `/cosmos/auth/v1beta1/module_accounts`, `/cosmos/auth/v1beta1/bech32`, `/cosmos/auth/v1beta1/bech32/{address_bytes}`, `/cosmos/auth/v1beta1/bech32/{address_string}`, `/cosmos/bank/v1beta1/supply/{denom}`, `/cosmos/bank/v1beta1/denom_owners/{denom}`, `/cosmos/bank/v1beta1/send_enabled`, `/cosmos/base/reflection/v1beta1/interfaces`, `/cosmos/base/reflection/v1beta1/interfaces/:interface_name/implementations`, `/cosmos/base/reflection/v1beta1/app_descriptor/authn`, `/cosmos/base/reflection/v1beta1/app_descriptor/chain`, `/cosmos/base/reflection/v1beta1/app_descriptor/codec`, `/cosmos/base/reflection/v1beta1/app_descriptor/configuration`, `/cosmos/base/reflection/v1beta1/app_descriptor/query_services`, `/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor`, `/cosmos/base/tendermint/v1beta1/abci_query`, `/cosmos/feegrant/v1beta1/issued/{granter}`, `/cosmos/gov/v1/proposals/{proposal_id}`, `/cosmos/gov/v1/proposals`, `/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}`, `/cosmos/gov/v1/proposals/{proposal_id}/votes`, `/cosmos/gov/v1/params/{params_type}`, `/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}`, `/cosmos/gov/v1/proposals/{proposal_id}/deposits`, `/cosmos/gov/v1/proposals/{proposal_id}/tally`, `/cosmos/group/v1/group_info/{group_id}`, `/cosmos/group/v1/group_policy_info/{address}`, `/cosmos/group/v1/group_members/{group_id}`, `/cosmos/group/v1/groups_by_admin/{admin}`, `/cosmos/group/v1/group_policies_by_group/{group_id}`, `/cosmos/group/v1/group_policies_by_admin/{admin}`, `/cosmos/group/v1/proposal/{proposal_id}`, `/cosmos/group/v1/proposals_by_group_policy/{address}`, `/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}`, `/cosmos/group/v1/votes_by_proposal/{proposal_id}`, `/cosmos/group/v1/votes_by_voter/{voter}`, `/cosmos/group/v1/groups_by_member/{address}`, `/cosmos/group/v1/proposals/{proposal_id}/tally`, `/cosmos/nft/v1beta1/balance/{owner}/{class_id}`, `/cosmos/nft/v1beta1/owner/{class_id}/{id}`, `/cosmos/nft/v1beta1/supply/{class_id}`, `/cosmos/nft/v1beta1/nfts`, `/cosmos/nft/v1beta1/nfts/{class_id}/{id}`, `/cosmos/nft/v1beta1/classes/{class_id}`, `/cosmos/nft/v1beta1/classes`, `/cosmos/params/v1beta1/subspaces`, `/cosmos/upgrade/v1beta1/module_versions`, `/cosmos/upgrade/v1beta1/authority`, `/cosmos/base/tendermint/v1beta1/node_info`, `/cosmos/base/tendermint/v1beta1/syncing`, `/cosmos/params/v1beta1/params`, `/syncing`, `/blocks/latest`, `/blocks/{height}`, `/validatorsets/latest`, `/validatorsets/{height}`, `/wasm/code`, `/wasm/code/{codeID}`, `/wasm/code/{codeID}/contracts`, `/wasm/contract/{contractAddress}`, `/wasm/contract/{contractAddress}/code-hash`, `/wasm/contract/{contractAddress}/query/{query}`, `/wasm/code/{codeID}/hash`, `/reg/consensus-io-exch-pubkey` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/allora_testnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["761001"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/allora_testnet/block?height=761001 ``` ```shell curl https://rpc.ankr.com/http/allora_cosmos_testnet/cosmos/base/tendermint/v1beta1/blocks/{height} ``` #### Response example ```json { "jsonrpc": "2.0", "id": -1, "result": { "block_id": { "hash": "663789D1BAA0354453A5BB1474C46C9F74E6140B247153482BBE84893C029600", "parts": { "total": 1, "hash": "BFCC2C78C439E367ABEEA996FD9A120EAA70DC44572B8BFDCA032908BA4B439B" } }, "block": { "header": { "version": { "block": "11" }, "chain_id": "allora-testnet-1", "height": "761001", "time": "2024-08-21T21:33:36.088780054Z", "last_block_id": { "hash": "AD51186842A63CB515A4946C558DF1DA71D384DF646EC5522ECD5008E3FAEDA0", "parts": { "total": 1, "hash": "16A9CCD523F2E593E66F46CBD20FCC03B5849ACE5325951E50BC53B6D7D2F893" } }, "last_commit_hash": "77BE45E09B5A5F40FA1F10BF430C2E14371445B9E2DF89952478E84A98DFA081", "data_hash": "78F2AF9D01AC871045FB53CB383AA50EF4C0094E9563428BFF8BA59071801050", "validators_hash": "CB957FF7AB192A9F9321F0E471C7BAE5A9AA82573FF8D509F8ACF7CA3A450A42", "next_validators_hash": "CB957FF7AB192A9F9321F0E471C7BAE5A9AA82573FF8D509F8ACF7CA3A450A42", "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F", "app_hash": "72AEC5979CEA9EE65275B77DA8F31676C7E52DA57B991D86C4870237E3D40127", "last_results_hash": "455FD6D9D1888EBE5B8602E20E84EEACA30020B717A5B5298890E7236CAB84AD", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "01458B61F0D7DE6E90798FE8C370413D718EB34C" }, "data": { "txs": [ "CuECCt4CCiQvZW1pc3Npb25zLnYyLk1zZ0luc2VydFdvcmtlclBheWxvYWQStQIKK2FsbG8xYWhhcGE2ZHpkOG0yNjc0MHp5N2gyd3pnamx1ZnM4NjRmeDR1eHcShQIKK2FsbG8xYWhhcGE2ZHpkOG0yNjc0MHp5N2gyd3pnamx1ZnM4NjRmeDR1eHcSBAiRuS4YBSJICkYIBRCRuS4aK2FsbG8xYWhhcGE2ZHpkOG0yNjc0MHp5N2gyd3pnamx1ZnM4NjRmeDR1eHciETE0NS42NTg1MDk2NjIzMjkzKkBkgCxd7XHQh+Debe/yvS+c8BBoKguydI/J/YNqRaYpBDpnwQo+4/LPouiYF04JXDBa4qxTfJFlpdSJ9EgoX+TAMkIwMmQ4MjYzOTFiYWI4ZjYzNWYzNDhkYmQxNDQ1ZGUxZmQ0YjgzZjNiNGJiZjFkY2EzY2Q4YWFjM2FlMWMyYmY5ODcSWApQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohAtgmORurj2NfNI29FEXeH9S4PztLvx3KPNiqw64cK/mHEgQKAggBGCkSBBDAhD0aQN1AnyLR2Kz/KMZ5yr+Sz4wo+4Tp8OnyDqSlr98oCNQVPtF69bWneamHvTEq7r5WUGuwQfWSD+sybXlUgnDlmIw=", "CuECCt4CCiQvZW1pc3Npb25zLnYyLk1zZ0luc2VydFdvcmtlclBheWxvYWQStQIKK2FsbG8xcmZweng2MGR6MDc5dWhuZXRxdHNkdTJ1ZTM0dmdyMnJ3ZGFrd2cShQIKK2FsbG8xcmZweng2MGR6MDc5dWhuZXRxdHNkdTJ1ZTM0dmdyMnJ3ZGFrd2cSBAiTuS4YAyJICkYIAxCTuS4aK2FsbG8xcmZweng2MGR6MDc5dWhuZXRxdHNkdTJ1ZTM0dmdyMnJ3ZGFrd2ciETYxMzI3LjIzMTM5NzQ3MTg1KkA2b71NaRNK8PFRv+nLbaTfB53wu/AqI4cGoFYED/4U/3c8JOYW+Q2moUdlX35tKF0U2gneVA2jQy0vmem8uIz6MkIwMzA5Zjg2ZWY3YzNlM2IyZjUzMzg3OGZiNjY2Mjk1NjljNjFkYTNhMzg2OTkyNjNmMWM4MDhlMTcxMTQzOWYxMmMSWQpRCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohAwn4bvfD47L1M4ePtmYpVpxh2jo4aZJj8cgI4XEUOfEsEgQKAggBGLJKEgQQwIQ9GkAYepebNx4qruj3/XCxlmVQ3XDbhfsXZlZyM+yeqUs7d263LfRxugRgQH3aiV/ROiC/gVH0bID6GA00y5QMWM+B" ] }, "evidence": { "evidence": [] }, "last_commit": { "height": "761000", "round": 0, "block_id": { "hash": "AD51186842A63CB515A4946C558DF1DA71D384DF646EC5522ECD5008E3FAEDA0", "parts": { "total": 1, "hash": "16A9CCD523F2E593E66F46CBD20FCC03B5849ACE5325951E50BC53B6D7D2F893" } }, "signatures": [ { "block_id_flag": 1, "validator_address": "", "timestamp": "0001-01-01T00:00:00Z", "signature": null }, { "block_id_flag": 2, "validator_address": "2D5A6E69CDFBE8FF7C0C2DAFF752387AC73B9AB1", "timestamp": "2024-08-21T21:33:36.07519025Z", "signature": "LvyV25u8kxAivi7rHuAZlXtawVBMYyOJflcr4al44TWVLmYnztqycSgGyi1S9GkUGoeA4nG+wRM/4pqk4YIKDQ==" } ] } } } } ``` --- ## Aptos
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Aptos API is available on [Web3 API platform](https://www.ankr.com/rpc/aptos). The Aptos blockchain, designed with scalability, safety, reliability, and upgradability as key principles, to address blockchain challenges, such as frequent outages, high costs, low throughput limits, and security concerns. The Aptos blockchain has been developed over the past three years by over 350+ developers across the globe. It offers new and novel innovations in consensus, smart contract design, system security, performance, and decentralization. The combination of these technologies will provide a fundamental building block to bring web3 to the masses. Official quick links: [Website](https://aptoslabs.com/), [Docs](https://aptos.dev/), [GitHub](https://github.com/aptos-labs/) ### Networks * Mainnet (`HTTPS`) * Testnet (`HTTPS`) ### API methods For Aptos, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/aptos/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `/v1/spec`, `/v1/-/healthy` ### API querying #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/aptos/{your_token}/v1/ \ -H 'Content-Type: application/json' ``` #### Response example ```json { "chain_id": 0, "epoch": "32425224034", "ledger_version": "32425224034", "oldest_ledger_version": "32425224034", "ledger_timestamp": "32425224034", "node_role": "validator", "oldest_block_height": "32425224034", "block_height": "32425224034", "git_hash": "string" } ``` --- ## Arbitrum
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Arbitrum API is available on [Web3 API platform](https://www.ankr.com/rpc/arbitrum). Arbitrum is a side chain that runs parallel to Ethereum Mainnet. Also known as a Layer 2 (L2) scaling solution, Arbitrum improves transaction speeds and cost compared to the mainnet, making it an excellent solution for Ethereum developers. By the Arbitrum we mean Arbitrum One which is the flagship Arbitrum mainnet chain; it is an Optimistic Rollup chain running on top of Ethereum Mainnet, and is open to all users. In an upgrade on 8/31, the Arbitrum One chain was upgraded to use the [Nitro](https://medium.com/offchainlabs/its-nitro-time-86944693bf29) tech stack, maintaining the same state. Official quick links: * [Website](https://arbitrum.io/), [Docs](https://developer.offchainlabs.com/), [GitHub](https://github.com/OffchainLabs) * [Community treasury address](https://arbiscan.io/address/0x8C316E77c4D4aBc461a074cf68c04DD666c57b42) (`0x8C316E77c4D4aBc461a074cf68c04DD666c57b42`) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Arbitrum, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/arbitrum) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying :::warning *Public* service plan has a 2MB request body limit. Use *Premium* instead for requests exceeding that limit. ::: #### Request example ```shell curl -X POST https://rpc.ankr.com/arbitrum/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/arbitrum/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/arbitrum/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/arbitrum/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0x2484729" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/c-i-p2/ title: Supported Chains: C-I (2/4) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains C-I — Celo, Chiliz, Core, Corn, and more. source: docs/rpc-service/chains/chains-list/c-i-p2.mdx --- Supported chains **C-I** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 2 of 4: [1](/rpc-service/chains/chains-list/c-i/) · 2 · [3](/rpc-service/chains/chains-list/c-i-p3/) · [4](/rpc-service/chains/chains-list/c-i-p4/) ## Etherlink
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Etherlink API is available on [Web3 API platform](https://www.ankr.com/rpc/etherlink). Etherlink is an EVM-compatible, non-custodial Layer 2 blockchain powered by [Tezos Smart Rollup technology](https://tezos.com/developers/smart-rollups/). It enables seamless integration with existing Ethereum tools, including wallets and indexers, and facilitates asset transfers to and from other EVM-compatible chains. Built upon the secure foundation of Tezos layer 1, Etherlink delivers a fast, fair, and (nearly) free experience. This permissionless and censorship-resistant environment empowers developers to actively create and participate in the next generation of decentralized applications. Official quick links: [Website](https://www.etherlink.com/), [Docs](https://docs.etherlink.com/), [GitHub](https://github.com/etherlinkcom/) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Etherlink, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/etherlink/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/etherlink_mainnet/ \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/etherlink_mainnet/" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/etherlink_mainnet/' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/etherlink_mainnet/' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x143e3e2" } ``` --- ## Fantom
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Fantom API is available on [Web3 API platform](https://www.ankr.com/rpc/fantom). Fantom is a fast, scalable, and secure layer-1 platform built on an aBFT consensus protocol. Fantom is permissionless, decentralized, open-source, and fully compatible with Ethereum. Lachesis, its revolutionary aBFT consensus mechanism, allows Fantom to be much faster and cheaper than previous technologies, yet extremely secure. Official quick links: [Website](https://fantom.foundation/), [Docs](https://docs.fantom.foundation/), [GitHub](https://github.com/Fantom-Foundation) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with Fantom through Ankr's infrastructure, add a required Fantom network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add Fantom Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Fantom Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/fantom/{your_token}`. * **Chain ID**: `250`. * **Currency symbol**: `FTM`. * **Block explorer URL**: `https://ftmscan.com/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Fantom Mainnet. To add Fantom Testnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Fantom Testnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/fantom_testnet/{your_token}`. * **Chain ID**: `4002`. * **Currency symbol**: `FTM`. * **Block explorer URL**: `https://testnet.ftmscan.com/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Fantom Testnet. ### API methods For Fantom, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/fantom/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/fantom/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/fantom/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/fantom/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/fantom/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "result":"0x17d5c3d", "id":1 } ``` --- ## Filecoin
> Filecoin API is available on [Web3 API platform](https://www.ankr.com/rpc/filecoin). Filecoin is a peer-to-peer network that stores files, with built-in economic incentives and cryptography to ensure files are stored reliably over time. Filecoin is built on top of the same software powering [IPFS](https://docs.ipfs.tech/concepts/what-is-ipfs/) protocol, which is a peer-to-peer distributed storage network that leverages [content addressing](https://docs.ipfs.tech/concepts/content-addressing/) to allow permanent references to the data, and avoids relying on specific devices or cloud servers for addressing the content. Filecoin is different from IPFS because it has an incentive layer on top to incentivize contents to be reliably stored and accessed. Filecoin enables several use cases, from Web3 native NFT and metaverse/game assets storage, incentivized permanent storage, to archiving Web2 datasets as a cheaper alternative to cloud storage. Official quick links: [Website](https://filecoin.io/), [Docs](https://docs.filecoin.io/), [GitHub](https://github.com/filecoin-project) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Filecoin, we support blockchain interaction via the following methods: * [Filecoin EVM methods](/rpc-service/chains/chains-api/filecoin/#filecoin-evm-methods) * [Filecoin native methods](/rpc-service/chains/chains-api/filecoin/#filecoin-native-methods) #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS EVM methods**: `eth_newFilter`, `eth_getFilterChanges`, `eth_syncing`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS EVM methods**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` **WSS Filecoin methods**: `Filecoin.ChainNotify` ### API querying #### Request example (Standard EVM) ```shell curl -X POST https://rpc.ankr.com/filecoin \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` #### Response example (Standard EVM) ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2910f9" } ``` #### Request example (Filecoin native) ```shell curl -X POST https://rpc.ankr.com/filecoin \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "Filecoin.ChainGetBlock", "params": [ { "/": "bafy2bzacecbzs3i5qubhgozauss4nvifgty5zvyvf6cy6frnnznojdmfl6phe" } ], "id": 1 }' ``` #### Response example (Filecoin native) ```json { "jsonrpc": "2.0", "result": { "Miner": "f0427989", "Ticket": { "VRFProof": "pbmP9mctFpH6BoFFh22uvzv8Ixx0rJq9YanJLFTRsgIWDibuomloU2UTWiN8007KBYAnB5Xj1jw7o81VJzKrUByqHUpZHWZM34CgVkuzcHPoSJpM8XGxs2GQkfNAncK2" }, "ElectionProof": { "WinCount": 1, "VRFProof": "oLSLThMoFfGX4E8cDIEULGmUteJY/10nCfun3hiRE1PDIpkPOnoBACmto7/SCz1yFixgQaysEcKK6RCx1ImUW2Q9dlrj3MCbjRQtNiumTXviDqAWgoxYU55QSBDpLbel" }, "BeaconEntries": [ { "Round": 2787998, "Data": "h+zHzc0DvUFIWFpFzqREiA2f3Uk4sn5NExnJJUtfju3Hlc0/dkNXq31+su9kh/q1CK69TRUy9562jx/eV4XXw1lA4QhDxBBWKoxQL/xR+zoCcfm4nzoD3HximnPCEEQA" } ], "WinPoStProof": [ { "PoStProof": 3, "ProofBytes": "pK36Z/ehsV5sqyoX/Gc64tsV2yQOW6X+p8Wy1wH03WC9VA6qyc3ZaTt4d9oI6xVniJdyHiu22yMsXfimEfVSc/UzThf8KrnIBMWZr3sSQsOVusdf1zV5zNfvDr1wccHhCjIExyinkvGRW/irioDZ49Jrm5PUvaBERIuJC4hUp0DijM8UgY7FIYTA16HHp7gbpUzU7mpofBz42tL3c/8LgOmLd7FKOh69fk0xHYaeQU1Oz3cbSSHWL8a/wRf4y3nV" } ], "Parents": [ { "/": "bafy2bzaceaxasycsjnixwqqbx4o3fsspal2zspnhmdjdtyke5xwtjkut7asyw" }, { "/": "bafy2bzaceadqtqu4wcecrk2akfb4mw7y3bedihwanwk2l4dxbcu4fonu3x6pe" }, { "/": "bafy2bzacecoqk52mag2xpxn2eq3pfmyr6mafvogju4znyagmkah4oo4fjgh5i" }, { "/": "bafy2bzaced46b2tewkbg6qfa5jnoecvbpdn5k7loz7qsoon3m5mgeb63de46s" } ], "ParentWeight": "63400884650", "Height": 2692153, "ParentStateRoot": { "/": "bafy2bzacec5o4ffqnp4zmkn44i6h7oajurvtsb5zvstudvgwhha7y25alt3ck" }, "ParentMessageReceipts": { "/": "bafy2bzacebvll7rq7wscnsgbvgdc7xeuzsp2quu4hhfx4pjvq3hydhw2auvd6" }, "Messages": { "/": "bafy2bzacechrvqknf26ff4pihyatewfx64ae4bawbp4ibtasy72hr63fds4iq" }, "BLSAggregate": { "Type": 2, "Data": "mQuz4wd292+Qh8oeZmpl+4QX7/90Oz7VDFLgPhRjIGgvYTEj0FYAecHTaxKaH0GGDwt0nqEvoVbFGf6PA6wCNtzwpLTMqQXZrT2cFeSAtC62vOOn7KTSdqtFxJvBwX1a" }, "Timestamp": 1679070990, "BlockSig": { "Type": 2, "Data": "qiMSk+hQ1E9WGMRn2o5dQmCpz1uO8JK4oIoh8NUwybN7GzrLEaSTv1W5IGx5AAnrAIYgE1MA+Y+CQ677iBC6wD3YUpzdSIt0QCv3cbf8SJgeOVusC+x0Vo/29zRGBgU/" }, "ForkSignaling": 0, "ParentBaseFee": "403334159" }, "id": 1 } ``` --- ## Flare
> Flare API is available on [Web3 API platform](https://www.ankr.com/rpc/flare). Flare is the blockchain for data. It is a layer 1, EVM smart contract platform designed to expand the utility of blockchain. Flare has the following native data acquisition protocols at these stages of development: * The [Flare Time-Series Oracle (FTSO)](https://docs.flare.network/tech/ftso/) provides continuous estimations of changing data, such as price pairs. * The [State Connector](https://docs.flare.network/tech/state-connector/) allows querying of verifiable, non-changing data from other chains and the internet. * Flare [LayerCake](https://flare.network/layercake/) is being developed by Flare Labs to provide a decentralized, trustless bridging system between smart contract networks. By giving developers trustless access to the broadest range of data, Flare can advance the development of more blockchain use cases where data is important, such as in DeFi, gaming, NFT, music, and social networks. Official quick links: [Website](https://flare.network/), [Docs](https://docs.flare.network/), [GitHub](https://github.com/flare-foundation) ### Networks * Mainnet: * Standard EVM API (`HTTPS` and `WSS`) * C-Chain (`HTTPS`) * P-Chain (`HTTPS`) * X-Chain (`HTTPS`) ### API methods For Flare, we support blockchain interaction via the following methods: * [Standard EVM methods](/rpc-service/chains/chains-api/flare/#evm-methods) * [P-Chain methods](/rpc-service/chains/chains-api/flare/#p-chain-methods) * [C-Chain methods](/rpc-service/chains/chains-api/flare/#c-chain-methods) * [X-Chain methods](/rpc-service/chains/chains-api/flare/#x-chain-methods) #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`, `eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*`, `avm.createAddress`, `avm.exportKey`, `avm.importKey`, `avm.export`, `avm.import`, `avm.mint`, `avm.createFixedCapAsset`, `avm.createVariableCapAsset`, `avm.createNFTAsset`, `avm.mintNFT`, `avm.listAddresses`, `avm.send`, `avm.sendMultiple`, `avm.sendNFT`, `wallet.send`, `wallet.sendMultiple`, `wallet.issueTx`, `avax.export`, `avax.exportAVAX`, `avax.exportKey`, `avax.import`, `avax.importAVAX`, `avax.importKey`, `platform.addDelegator`, `platform.addValidator`, `platform.addSubnetValidator`, `platform.createAddress`, `platform.createBlockchain`, `platform.createSubnet`, `platform.exportAVAX`, `platform.exportKey`, `platform.importAVAX`, `platform.importKey`, `platform.listAddresses` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example (Standard EVM) ```shell curl -X POST https://rpc.ankr.com/flare \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/flare" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/flare' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/flare' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example (Standard EVM) ```json { "jsonrpc":"2.0", "result":"0xbe7762", "id":1 } ``` --- ## Fuel
> Fuel API is available on [Web3 API platform](https://www.ankr.com/rpc/fuel). Fuel is an operating system specifically designed for Ethereum Rollups, providing the necessary tools and infrastructure to maximize the efficiency of rollups while solving key challenges around scalability and performance. Fuel’s goal is to enhance the Ethereum ecosystem by optimizing for parallelization, state-minimized execution, and interoperability (PSI), without compromising on any of these aspects. * **FuelVM**: Optimized execution engine enabling parallel transaction execution and state minimization using a UTXO model, improving scalability and throughput. * **Sway Language**: A Rust + Solidity inspired language for smart contracts, offering safety, performance, and static auditing. * **Developer Experience**: Streamlined, boilerplate-free development for efficient contract creation and interaction with the FuelVM. * **Unmatched Throughput**: Leverages parallel processing for significantly higher transaction throughput compared to single-threaded blockchains. Official quick links: [Website](https://fuel.network/), [Docs](https://docs.fuel.network/docs/intro/what-is-fuel/), [GitHub](https://github.com/FuelLabs) ### Networks * Mainnet (GraphQL over `HTTPS`) * Testnet (GraphQL over `HTTPS`) ### API methods For Fuel, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/fuel/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: None. ### API querying #### Request example ```shell curl --location 'https://rpc.ankr.com/http/fuel' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "query": "{ chain { latestBlock { id height } } }" }' ``` #### Response example ```json { "data": { "chain": { "latestBlock": { "id": "0x1cd6d6725bb58123623e8a60de42f269252dbf0df8922e27e45b9e894bffeea7", "height": "13781885" } } } } ``` --- ## Gnosis
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Gnosis API is available on [Web3 API platform](https://www.ankr.com/rpc/gnosis). Gnosis Chain (formerly xDai Chain) provides stability, scalability and an extendable beacon chain framework. Development on Gnosis Chain is straightforward for Ethereum developers as it is an EVM compatible chain. Smart contracts can be written and deployed in the same way as for Ethereum just by setting a different RPC endpoint. Any contract that works on the Ethereum mainnet can be redeployed to the Gnosis chain. Transaction costs are minimized, and all fees and transactions are paid with a single token (xDai). Many tools supporting Ethereum development are compatible with Gnosis Chain. Official quick links: [Website](https://gnosis.io/), [Docs](https://developers.gnosischain.com/), [GitHub](https://github.com/gnosis) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with Gnosis Chain through Ankr's infrastructure, add a required Gnosis Chain network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add Gnosis Chain Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Gnosis Chain Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/gnosis/{your_token}`. * **Chain ID**: `100`. * **Currency symbol**: `xDai`. * **Block explorer URL**: `https://blockscout.com/xdai/mainnet/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Gnosis Chain Mainnet. ### API methods For Gnosis, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/gnosis/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/gnosis/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/gnosis/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/gnosis/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/gnosis/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "result":"0x17d5c3d", "id":1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/c-i-p3/ title: Supported Chains: C-I (3/4) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains C-I — Celo, Chiliz, Core, Corn, and more. source: docs/rpc-service/chains/chains-list/c-i-p3.mdx --- Supported chains **C-I** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 3 of 4: [1](/rpc-service/chains/chains-list/c-i/) · [2](/rpc-service/chains/chains-list/c-i-p2/) · 3 · [4](/rpc-service/chains/chains-list/c-i-p4/) ## Gnosis Beacon
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Gonsis Beacon API is available on [Web3 API platform](https://www.ankr.com/rpc/gnosis) upon switching on the **Beacon** toggle. The Gnosis Beacon Chain is a consensus layer that introduced a [proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) to Ethereum. The Gnosis Beacon Chain mechanism is responsible for creating new blocks, making sure those new blocks are valid, and rewarding validators with ETH for keeping the network secure. The Gnosis Beacon Chain has several clients to choose from, serving the same purpose but built with slightly different focus in mind: * [Prysm](https://launchpad.ethereum.org/en/prysm) — focuses on usability, security, and reliability. Prysm is developed by Prysmatic Labs, a company with the sole focus on the development of their client. * [Lighthouse](https://launchpad.ethereum.org/en/lighthouse) — a client with a heavy focus on speed and security. Built by Sigma Prime, an information security and software engineering firm who have funded Lighthouse along with the Ethereum Foundation, ConsenSys, and private individuals. * [Nimbus](https://launchpad.ethereum.org/en/nimbus) — strives to be as lightweight as possible in terms of resources used. This allows it to perform well on embedded systems, resource-restricted devices — including Raspberry Pis — and multi-purpose servers. Official quick links: [Website](https://ethereum.org/en/roadmap/beacon-chain/), [Docs](https://ethereum.org/en/developers/docs/), [GitHub](https://github.com/gnosischain) ### Networks * Mainnet (`HTTPS`) * Testnet (`HTTPS`) ### API methods For the Gnosis Beacon Chain, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/gnosis-beacon/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `/eth/v1/node/identity` ### API querying #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/gnosis_beacon/{your_token}/eth/v1/beacon/genesis" \ -H "Accept: application/json" ``` #### Response example ```json { "data": { "genesis_time": "1606824023", "genesis_validators_root": "0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95", "genesis_fork_version": "0x00000000" } } ``` --- ## GOAT
> GOAT API is available on [Web3 API platform](https://www.ankr.com/rpc/goat). GOAT Network is a Layer 2 blockchain solution designed to enhance Bitcoin's scalability, transaction speed, and functionality. By operating atop Bitcoin's primary blockchain (Layer 1), it aims to transform Bitcoin from a passive asset into an active participant in decentralized finance (DeFi), enabling users to earn sustainable yields on their BTC holdings. Key features of GOAT Network are the following: * **ZKM Infrastructure**: The Zero-Knowledge Modular (ZKM) Infrastructure leverages advanced cryptographic principles to ensure privacy, scalability, and trustlessness in transactions. It's critical for enabling private, fast, and secure cross-chain and intra-chain operations in the GOAT Network. * **Optimistic Challenge Protocol**: OCP is a security mechanism ensuring the correctness of off-chain computations and transactions by providing a way to challenge fraudulent or erroneous data. Provers in the GOAT Network use OCP to securely manage asset peg-out requests and execute off-chain transactions. * **Decentralized Sequencing**: This feature decentralizes the process of transaction batching, which determines the order of transactions within the network. GOAT Network’s decentralized sequencer uses a consensus-driven protocol to batch transactions and confirm them on the blockchain. Official quick links: [Website](https://www.goat.network/), [Docs](https://docs.goat.network/), [GitHub](https://github.com/GOATNetwork) ### Networks * Testnet (`HTTPS` and `WSS`) ### API methods For GOAT network, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/goat/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/goat_testnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/goat_testnet" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/goat_testnet' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/goat_testnet' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x7e340" } ``` --- ## Gravity
> Gravity API is available on [Web3 API platform](https://www.ankr.com/rpc/gravity). Gravity is a Layer 1 blockchain designed for mass adoption and an omnichain future. Gravity features the following key points: * **Cross-Chain Transactions**: Gravity enables developers to define and settle transactions across multiple blockchains, enhancing efficiency and security. * **Efficient Verification**: With cost-efficient ZKP verification, Gravity ensures economical and secure transactions. * **Enhanced User Experience**: Gravity introduces cryptographic primitives like the secp256r1 curve through precompiled contracts, allowing for cost-effective passkey authentication for Account Abstraction wallets. * **High-Performance Execution**: Gravity integrates the Reth execution layer and the Jolteon consensus algorithm, providing high throughput and near-instant finality. * **Secure and Robust PoS Mechanism**: Powered by G token staking and restaking protocols like Babylon and EigenLayer, Gravity's PoS design incentivizes and unites a diverse community to secure the chain. * **EVM-Compatible**: Gravity is fully EVM-compatible, enabling seamless deployment and interaction with smart contracts. Official quick links: [Website](https://gravity.xyz/) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Gravity, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/gravity/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/gravity \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/gravity" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/gravity' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/gravity' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2ba2" } ``` --- ## Harmony
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Harmony API is available on [Web3 API platform](https://www.ankr.com/rpc/harmony). Harmony is a fast and secure blockchain for decentralized applications. Production mainnet is expected to support 4 shards of 1000 nodes, producing blocks in 2 seconds with finality. An Effective Proof-of-Stake (EPoS) reduces centralization while supporting stake delegation, reward compounding and double-sign slashing. Official quick links: [Website](https://www.harmony.one/), [Docs](https://docs.harmony.one/home/), [GitHub](https://github.com/harmony-one) ### Networks * Mainnet (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with Harmony through Ankr's infrastructure, add a required Harmony network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add Harmony Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Harmony Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/harmony/{your_token}`. * **Chain ID**: `1666600000`. * **Currency symbol**: `ONE`. * **Block explorer URL**: `https://explorer.harmony.one/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Harmony Mainnet. ### API methods For Harmony, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/harmony/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*`, `hmyv2_getCurrentBadBlocks`, `hmyv2_getNodeMetadata`, `hmy_getFilterLogs`, `hmy_newFilter`, `eth_newPendingTransactionFilter`, `eth_newBlockFilter`, `hmy_getFilterChanges`, `hmy_syncing` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/harmony/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/harmony/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/harmony/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/harmony/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0x206a48d" } ``` --- ## Horizen EON
> Horizen EON API is available on [Web3 API platform](https://www.ankr.com/rpc/horizen). EON is Horizen's Ethereum VM (Virtual Machine). EON has adopted Ethereum’s account-based transaction model to represent assets as balances within accounts. The account model, in VM capable blockchains, differentiate account types on whether they represent a normal account balance or an account which is bound to some code that has to be executed by the VM. Official quick links: [Website](https://eon.horizen.io/), [Docs](https://eon.horizen.io/docs/), [GitHub](https://github.com/horizenofficial) ### Networks * Mainnet (`HTTPS` and `WSS`) * Gobi Testnet (`HTTPS` and `WSS`) ### API methods For Horizen EON, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/horizen-eon/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/horizen_eon \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x47f66" } ``` --- ## Huobi ECO Chain
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > HECO API is available on [Web3 API platform](https://www.ankr.com/rpc/heco). Huobi ECO Chain (HECO) is a decentralized, high-efficiency and energy-saving public chain. It is compatible with smart contracts and supports high- performance transactions. The endogenous token of Heco is HT, and it adopts the HPoS consensus mechanism. Heco will continue to improve the efficiency of Ethereum by Layer2, which will supplement and empower the Ethereum ecosystem. Official quick links: [Website](https://www.hecochain.com/en-us/), [Docs](https://docs.hecochain.com/#/), [GitHub](https://github.com/stars-labs/) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For HECO, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/heco/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/heco/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/heco/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/heco/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/heco/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x15bafe2" } ``` --- ## IOTA
> IOTA API is available on [Web3 API platform](https://www.ankr.com/rpc/iota). IOTA is a Move-based protocol that provides a decentralized, scalable platform for digital asset management and smart contracts. Leveraging the Move programming language, IOTA Layer 1 ensures high performance and security for applications deployed on the IOTA Mainnet. Key Features: * **Move Programming Language**: Move is an object-centric programming language designed for secure and efficient smart contract development. It enables developers to model complex entities such as assets, users, and contracts in a natural and structured way. * **Performance**: Because Move is based on an object model rather than a shared global state, transactions can be executed in parallel. This results in high throughput, reduced network congestion, and lower gas fees. * **Security**: Move adopts principles from Rust’s ownership model to enforce strict memory and resource control. The compiler helps prevent common programming mistakes, but developers are still advised to audit smart contracts to guard against runtime issues and logic flaws. This architecture makes IOTA Layer 1 an ideal foundation for building high-performance, secure blockchain applications. Official quick links: [Website](https://www.iota.org/), [Docs](https://docs.iota.org/), [GitHub](https://github.com/iotaledger/) ### Networks * Mainnet (`HTTPS`) * Testnet (`HTTPS`) ### API methods For IOTA, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/iota/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: None. ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/iota_mainnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "iotax_getAllBalances", "params": ["0x94f1a597b4e8f709a396f7f6b1482bdcd65a673d111e49286c527fab7c2d0961"], "id": 1 }' ```` #### Response example ```json { "jsonrpc": "2.0", "result": [ { "coinType": "0x2::iota::IOTA", "coinObjectCount": 15, "totalBalance": "3000000000" } ], "id": 1 } ``` --- ## IOTA EVM
> IOTA EVM API is available on [Web3 API platform](https://www.ankr.com/rpc/iota_evm). IOTA EVM is a Layer 2 solution that operates on top of the IOTA Mainnet. It is part of the broader Iota Smart Contracts (ISC) framework, which provides smart contract functionality on Iota. It leverages the Iota Tangle's scalability and security while providing an environment for running decentralized applications (dApps). Official quick links: [Website](https://evm.iota.org/), [Docs](https://wiki.iota.org/isc/introduction/), [GitHub](https://github.com/iotaledger/) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For IOTA EVM, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/iota-evm/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/iota_evm \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/iota_evm" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/iota_evm' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/iota_evm' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4ab291" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/c-i-p4/ title: Supported Chains: C-I (4/4) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains C-I — Celo, Chiliz, Core, Corn, and more. source: docs/rpc-service/chains/chains-list/c-i-p4.mdx --- Supported chains **C-I** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 4 of 4: [1](/rpc-service/chains/chains-list/c-i/) · [2](/rpc-service/chains/chains-list/c-i-p2/) · [3](/rpc-service/chains/chains-list/c-i-p3/) · 4 ## IoTeX
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > IoTeX API is available on [Web3 API platform](https://www.ankr.com/rpc/iotex). IoTeX Network is the lightning-fast, ultra-secure, and highly scalable blockchain platform that connects real world data to on-chain Dapps. Official quick links: [Website](https://iotex.io/), [Docs](https://docs.iotex.io/), [GitHub](https://github.com/iotexproject) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with IoTeX through Ankr's infrastructure, add a required IoTeX network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add IoTeX Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `IoTeX Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/iotex/{your_token}`. * **Chain ID**: `4689`. * **Currency symbol**: `IOTX`. * **Block explorer URL**: `https://iotexscan.io/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with IoTeX Mainnet. ### API methods For IoTeX, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/iotex/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_syncing`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`, `eth_submitWork`, `eth_submitHashrate`, `eth_accounts`, `eth_getStorageAt`, `eth_getUncleCountByBlockHash`, `eth_getUncleCountByBlockNumber`, `eth_sign`, `eth_signTransaction`, `eth_sendTransaction`, `eth_getUncleByBlockHashAndIndex`, `eth_getUncleByBlockNumberAndIndex`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `eth_pendingTransactions`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `db_*`, `shh_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/iotex/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/iotex/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/iotex/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/iotex/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "id":1, "jsonrpc":"2.0", "result":"0x139dbf4" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/c-i/ title: Supported Chains: C-I (1/4) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains C-I — Celo, Chiliz, Core, Corn, and more. source: docs/rpc-service/chains/chains-list/c-i.mdx --- Supported chains **C-I** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 1 of 4: 1 · [2](/rpc-service/chains/chains-list/c-i-p2/) · [3](/rpc-service/chains/chains-list/c-i-p3/) · [4](/rpc-service/chains/chains-list/c-i-p4/) ## Celo
> Celo API is available on [Web3 API platform](https://www.ankr.com/rpc/celo). Celo is a mobile-first blockchain designed to make decentralized financial (DeFi) tools and services accessible to anyone with a mobile phone. Celo is a layer 1 protocol and blockchain platform. The Celo Mainnet is entirely separate from the Ethereum network. The Celo client originated as a fork of Ethereum Go language client, [go-ethereum](https://geth.ethereum.org/docs/) (or geth). Celo has several significant differences, including a Proof-of-Stake-based Practical Byzantine Fault Tolerance (PBFT) consensus mechanism. All the crypto assets on Celo have ERC-20 compliant interfaces, meaning that while they are not ERC-20 tokens on the Ethereum Mainnet, all familiar tooling and code that support ERC-20 tokens can be easily adapted for Celo assets, including Celo Native Asset (CELO) and Celo Dollar (cUSD). Official quick links: [Website](https://celo.org/), [Docs](https://docs.celo.org/), [GitHub](https://github.com/celo-org) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with Celo through Ankr's infrastructure, add a required Celo network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add Celo Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Celo Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/celo/`. * **Chain ID**: `42220`. * **Currency symbol**: `CELO`. * **Block explorer URL**: `https://explorer.celo.org/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Celo Mainnet. ### API methods For Celo, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/celo/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/celo \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/celo" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/celo' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/celo' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0xf6b842" } ``` --- ## Chiliz
> Chiliz API is available on [Web3 API platform](https://www.ankr.com/rpc/chiliz). Chiliz is an EVM-compatible Layer-1 blockchain built to serve as the foundation for an ever-growing ecosystem of enterprise-level sports and entertainment stakeholders developing blockchain-based user/fan experiences and B2B/B2C tools within their respective industries. Official quick links: [Website](https://www.chiliz.com/), [Docs](https://docs.chiliz.com/), [GitHub](https://github.com/chiliz-chain) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Chiliz, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/chiliz/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/chiliz \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/chiliz" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/chiliz' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/chiliz' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x2a35d7" } ``` --- ## Core
> Core API is available on [Web3 API platform](https://www.ankr.com/rpc/core). *Core* is a layer 1 blockchain built around a unique consensus mechanism called ["Satoshi Plus"](https://docs.coredao.org/core-white-paper-v1.0.5/satoshi-plus-consensus). Official quick links: [Website](https://coredao.org/), [Docs](https://docs.coredao.org/developer/introduction/getting-started), [GitHub](https://github.com/coredao-org) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Core, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/core/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/core \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/core" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/core' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/core' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x905bb4" } ``` --- ## Corn
> Corn API is available on [Web3 API platform](https://www.ankr.com/rpc/corn). Corn is an Ethereum Layer 2 network that offers a rich, Bitcoin-centric ecosystem powered by cutting-edge technologies. It includes Bitcorn (BTCN) as its gas token, the popCORN System for long-term incentives, and LayerZero for seamless cross-chain asset transfers. Built on Arbitrum Orbit, Corn brings unparalleled scalability and efficiency, with support for Stylus, enabling developers to use multiple programming languages for smart contract development. **Key components**: * **Bitcorn (BTCN)**: A Bitcoin-backed asset used as gas, transforming Bitcoin into a utility token for transactions and smart contracts. * **popCORN System**: veTokenomics-inspired mechanism allowing $CORN stakers to vote on yield distribution, aligning user and protocol incentives. * **Bitcoin Secured Network**: Integrates Bitcoin staking (via Babylon) with Ethereum staking for dual-layer security. * **Arbitrum Orbit Foundation**: Combines Ethereum's security with scalable and cost-effective infrastructure, supporting multi-language smart contracts via Stylus. * **Cross-Chain Interoperability**: LayerZero and ThorCorn enable seamless asset transfers across chains. * **BlueCorn & Bitcoin Clearing House**: Simplifies BTCN minting directly from Coinbase accounts, enhancing Bitcoin’s utility within Corn. Official quick links: [Website](https://usecorn.com/), [Docs](https://docs.usecorn.com/), [GitHub](https://github.com/usecorn) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Corn, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/corn/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/corn_maizenet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/corn_maizenet" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/corn_maizenet' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/corn_maizenet' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x209ac" } ``` --- ## Electroneum
> Electroneum API is available on [Web3 API platform](https://www.ankr.com/rpc/electroneum). Electroneum is an IBFT-based blockchain that operates with known validators, ensuring a high level of trust and security. Compatible with the Ethereum Virtual Machine (EVM), Electroneum allows developers to easily deploy and interact with smart contracts. The blockchain offers impressive 5-second transaction speeds, facilitated by its unique proprietary instant blockchain finality system. The finality system ensures that transactions are quickly and irreversibly confirmed, eliminating the need for multiple confirmations and enabling rapid and efficient transactions. Combined with ultra low-cost smart contract fees, Electroneum provides an attractive platform for developers and users alike. Official quick links: [Website](https://electroneum.com/blockchain/) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Electroneum, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/electroneum/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/electroneum \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/electroneum" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/electroneum' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/electroneum' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1e6d99" } ``` --- ## Ethereum
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Ethereum API is available on [Web3 API platform](https://www.ankr.com/rpc/ethereum). Ethereum is a blockchain with a computer embedded in it. It is the foundation for building apps and organizations in a decentralized, permissionless, censorship-resistant way. Ethereum uses a [proof-of-stake-based consensus mechanism](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/). Official quick links: [Website](https://ethereum.org/en/), [Docs](https://ethereum.org/en/developers/docs/), [GitHub](https://github.com/ethereum) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet: * Holesky (`HTTPS` and `WSS`) * Sepolia (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with Ethereum through Ankr's infrastructure, add a required Ethereum network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add Ethereum Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Ethereum Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/eth/{your_token}`. * **Chain ID**: `1`. * **Currency symbol**: `ETH`. * **Block explorer URL**: `https://etherscan.io/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Ethereum Mainnet. To add Ethereum Sepolia Testnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Ethereum Sepolia Testnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/eth_sepolia/{your_token}`. * **Chain ID**: `11155111`. * **Currency symbol**: `ETH`. * **Block explorer URL**: `https://sepolia.etherscan.io/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Ethereum Sepolia Testnet. ### API methods For Ethereum, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/ethereum/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/eth/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/eth/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/eth/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/eth/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xf3c34b" } ``` --- ## Ethereum Beacon
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Ethereum Beacon API is available on [Web3 API platform](https://www.ankr.com/rpc/eth) upon switching on the **Beacon** toggle. The Ethereum Beacon Chain is a consensus layer that introduced a [proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) to Ethereum. The Beacon Chain mechanism is responsible for creating new blocks, making sure those new blocks are valid, and rewarding validators with ETH for keeping the network secure. The Beacon Chain has several clients to choose from, serving the same purpose but built with slightly different focus in mind: * [Prysm](https://launchpad.ethereum.org/en/prysm) — focuses on usability, security, and reliability. Prysm is developed by Prysmatic Labs, a company with the sole focus on the development of their client. * [Lighthouse](https://launchpad.ethereum.org/en/lighthouse) — a client with a heavy focus on speed and security. Built by Sigma Prime, an information security and software engineering firm who have funded Lighthouse along with the Ethereum Foundation, ConsenSys, and private individuals. * [Nimbus](https://launchpad.ethereum.org/en/nimbus) — strives to be as lightweight as possible in terms of resources used. This allows it to perform well on embedded systems, resource-restricted devices — including Raspberry Pis — and multi-purpose servers. Official quick links: [Website](https://ethereum.org/en/roadmap/beacon-chain/), [Docs](https://ethereum.org/en/developers/docs/), [GitHub](https://github.com/ethereum), [Eth Beacon Node API specification](https://ethereum.github.io/beacon-APIs/) ### Networks * Mainnet (`HTTPS`) * Testnet: * Holesky (`HTTPS`) * Sepolia (`HTTPS`) ### API methods For the Ethereum Beacon Chain, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/eth-beacon/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `/eth/v1/node/identity` ### API querying #### Request example ```shell curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/genesis" \ -H "Accept: application/json" ``` #### Response example ```json { "data": { "genesis_time": "1606824023", "genesis_validators_root": "0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95", "genesis_fork_version": "0x00000000" } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/ title: Chains Quickstart description: The full list of blockchains supported on Ankr RPC, with mainnet and testnet endpoints for each. source: docs/rpc-service/chains/chains-list/index.mdx --- ## Chains Quickstart This docs section provides the list of all chains available on the [Web3 API platform](https://www.ankr.com/rpc/). Each chain in the list has the following information structure: > `Overview` —— `Networks` —— `Adding to MetaMask` —— `Methods` —— `API Querying` * **Overview** — chain description based on official docs with quicklinks to chain's website, docs, and GitHub. * **Networks** — networks (Mainnet/Testnet) and protocols (`HTTPS`/`WSS`) we support for each chain. * **Adding to MetaMask** — using Ankr as the blockchain provider for MetaMask. * **Methods** — supported (link to the chain's API Reference) and unsupported methods. * **API Querying** — code snippets with basic requests in various languages and the corresponding JSON responses.
Chain info ## Chains supported Find the chain you require and go to its docs section by clicking it. | | | | | | | |-----------------------------------------------------------------------|-------------------------------------------------------|----------------------------------------------------------------|-------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------------------------| | [0G](/rpc-service/chains/chains-list/0g-b/#0g) | [BNB Smart Chain](/rpc-service/chains/chains-list/0g-b/#bnb-smart-chain) | [Gnosis](/rpc-service/chains/chains-list/c-i/#gnosis) | [Linea](/rpc-service/chains/chains-list/k-r/#linea) | [Rollux](/rpc-service/chains/chains-list/k-r/#rollux) | [Telos](/rpc-service/chains/chains-list/s-t/#telos) | | [Allora](/rpc-service/chains/chains-list/0g-b/#allora) | [Botanix](/rpc-service/chains/chains-list/0g-b/#botanix) | [Gnosis Beacon](/rpc-service/chains/chains-list/c-i/#gnosis-beacon) | [Mantle](/rpc-service/chains/chains-list/k-r/#mantle) | [Scroll](/rpc-service/chains/chains-list/s-t/#scroll) | [Tenet](/rpc-service/chains/chains-list/s-t/#tenet) | | [Aptos](/rpc-service/chains/chains-list/0g-b/#aptos) | [Celo](/rpc-service/chains/chains-list/c-i/#celo) | [GOAT](/rpc-service/chains/chains-list/c-i/#goat) | [Matchain](/rpc-service/chains/chains-list/k-r/#matchain) | [Secret Network](/rpc-service/chains/chains-list/s-t/#secret-network) | [TON](/rpc-service/chains/chains-list/s-t/#ton) | | [Arbitrum](/rpc-service/chains/chains-list/0g-b/#arbitrum) | [Chiliz](/rpc-service/chains/chains-list/c-i/#chiliz) | [Gravity](/rpc-service/chains/chains-list/c-i/#gravity) | [Metis](/rpc-service/chains/chains-list/k-r/#metis) | [Sei](/rpc-service/chains/chains-list/s-t/#sei) | [TRON](/rpc-service/chains/chains-list/s-t/#tron) | | [Arbitrum Nova](/rpc-service/chains/chains-list/0g-b/#arbitrum-nova) | [Core](/rpc-service/chains/chains-list/c-i/#core) | [Harmony](/rpc-service/chains/chains-list/c-i/#harmony) | [Midnight](/rpc-service/chains/chains-list/k-r/#midnight) | [Solana](/rpc-service/chains/chains-list/s-t/#solana) | [Xai](/rpc-service/chains/chains-list/x-z/#xai) | | [Atleta](/rpc-service/chains/chains-list/0g-b/#atleta) | [Corn](/rpc-service/chains/chains-list/c-i/#corn) | [HECO Chain](/rpc-service/chains/chains-list/c-i/#huobi-eco-chain) | [Monad](/rpc-service/chains/chains-list/k-r/#monad) | [Somnia](/rpc-service/chains/chains-list/s-t/#somnia) | [XDC](/rpc-service/chains/chains-list/x-z/#xdc-network) | | [Avail](/rpc-service/chains/chains-list/0g-b/#avail) | [Electroneum](/rpc-service/chains/chains-list/c-i/#electroneum) | [Horizen EON](/rpc-service/chains/chains-list/c-i/#horizen-eon) | [Moonbeam](/rpc-service/chains/chains-list/k-r/#moonbeam) | [Sonic](/rpc-service/chains/chains-list/s-t/#sonic) | [X Layer](/rpc-service/chains/chains-list/x-z/#x-layer) | | [Avalanche](/rpc-service/chains/chains-list/0g-b/#avalanche) | [Ethereum](/rpc-service/chains/chains-list/c-i/#ethereum) | [Iota](/rpc-service/chains/chains-list/c-i/#iota) | [Movement](/rpc-service/chains/chains-list/k-r/#movement) | [Stellar](/rpc-service/chains/chains-list/s-t/#stellar) | [Xphere](/rpc-service/chains/chains-list/x-z/#xphere) | | [B2 Network](/rpc-service/chains/chains-list/0g-b/#b2-network) | [Ethereum Beacon](/rpc-service/chains/chains-list/c-i/#ethereum-beacon) | [Iota EVM](/rpc-service/chains/chains-list/c-i/#iota-evm) | [NEAR](/rpc-service/chains/chains-list/k-r/#near) | [Story](/rpc-service/chains/chains-list/s-t/#story) | [XRP](/rpc-service/chains/chains-list/x-z/#xrp) | | [Base](/rpc-service/chains/chains-list/0g-b/#base) | [Etherlink](/rpc-service/chains/chains-list/c-i/#etherlink) | [IoTeX](/rpc-service/chains/chains-list/c-i/#iotex) | [Nervos CKB](/rpc-service/chains/chains-list/k-r/#nervos-ckb) | [Sui](/rpc-service/chains/chains-list/s-t/#sui) | [zkSync Era](/rpc-service/chains/chains-list/x-z/#zksync-era) | | [Bitcoin](/rpc-service/chains/chains-list/0g-b/#bitcoin) | [Fantom](/rpc-service/chains/chains-list/c-i/#fantom) | [Kaia](/rpc-service/chains/chains-list/k-r/#kaia) | [Neura](/rpc-service/chains/chains-list/k-r/#neura) | [Swell](/rpc-service/chains/chains-list/s-t/#swell) | | | [Bitlayer](/rpc-service/chains/chains-list/0g-b/#bitlayer) | [Filecoin](/rpc-service/chains/chains-list/c-i/#filecoin) | [Kava](/rpc-service/chains/chains-list/k-r/#kava) | [Optimism](/rpc-service/chains/chains-list/k-r/#optimism) | [Syscoin](/rpc-service/chains/chains-list/s-t/#syscoin) | | | [Blast](/rpc-service/chains/chains-list/0g-b/#blast) | [Flare](/rpc-service/chains/chains-list/c-i/#flare) | [Kinto](/rpc-service/chains/chains-list/k-r/#kinto) | [Polkadot](/rpc-service/chains/chains-list/k-r/#polkadot) | [TAC](/rpc-service/chains/chains-list/s-t/#tac) | | | | [Fuel](/rpc-service/chains/chains-list/c-i/#fuel) | [Kite AI](/rpc-service/chains/chains-list/k-r/#kite-ai) | [Polygon](/rpc-service/chains/chains-list/k-r/#polygon) | [Taiko](/rpc-service/chains/chains-list/s-t/#taiko) | | | | | [Kusama](/rpc-service/chains/chains-list/k-r/#kusama) | | | | --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/k-r-p2/ title: Supported Chains: K-R (2/3) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains K-R — Kaia, Kava, Kinto, Kite AI, and more. source: docs/rpc-service/chains/chains-list/k-r-p2.mdx --- Supported chains **K-R** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 2 of 3: [1](/rpc-service/chains/chains-list/k-r/) · 2 · [3](/rpc-service/chains/chains-list/k-r-p3/) ## Linea
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Linea API is available on [Web3 API platform](https://www.ankr.com/rpc/linea). *Linea* is a network that scales the experience of Ethereum. Its out-of-the-box compatibility with the Ethereum Virtual Machine enables the deployment of already-existing applications, as well as the creation of new ones that would be too costly on Mainnet. It also enables the community to use those dapps, at a fraction of the cost, and at multiples the speed of Mainnet. It does this by leveraging quantum-resistant lattice-based cryptography to create zero-knowledge proofs that include every transaction performed on the network, and rolling them up to Mainnet. This ensures that every transaction is recorded to the Ethereum ledger while dividing the cost of that security by magnitudes. Official quick links: [Website](https://linea.build/), [Docs](https://docs.linea.build/) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Linea, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/linea/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/linea/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/linea/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/linea/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/linea/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xd0ffc" } ``` --- ## Mantle
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Mantle API is available on [Web3 API platform](https://www.ankr.com/rpc/mantle). Mantle is a high-performance Ethereum layer-2 network built with modular architecture delivering low fees and high security. Builders can leverage Mantle’s unique design to build dApps with exceptional UX, all while relying on Ethereum’s unrivaled security. Official quick links: [Website](https://www.mantle.xyz/), [Docs](https://docs.mantle.xyz/introducing-mantle/a-gentle-introduction), [GitHub](https://github.com/mantlenetworkio) ### Networks * Mainnet (`HTTPS` and `WSS`) * Sepolia Testnet (`HTTPS` and `WSS`) ### API methods For Mantle, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/mantle/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/mantle/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/mantle/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/mantle/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/mantle/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3ca75e" } ``` --- ## Matchain
> Matchain API is available on [Web3 API platform](https://www.ankr.com/rpc/matchain). *Matchain* is a decentralized AI blockchain platform dedicated to providing comprehensive digital identity solutions for all users. By integrating advanced artificial intelligence, Matchain enhances data categorization and user profiling, seamlessly merging social logins from both Web2 and Web3 into a unified digital identity. This empowers individuals with full control over their data, enabling them to own, manage, and monetize it according to their preferences. Official quick links: [Website](https://www.matchain.io/), [Docs](https://docs.matchain.io/) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Matchain, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/matchain/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/matchain_mainnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/matchain_mainnet" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/matchain_mainnet' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/matchain_mainnet' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0xed2d7c" } ``` --- ## Metis
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Metis API is available on [Web3 API platform](https://www.ankr.com/rpc/metis). Metis is an Ethereum Layer 2 Rollup platform that offers simple and fast smart contract deployment within the network. Metis provides several solutions to solve the big challenges we face in the Ethereum mainnet, including transaction speed, cost, and scalability. Official quick links: [Website](https://www.metis.io/), [Docs](https://docs.metis.io/dev/), [GitHub](https://github.com/MetisProtocol) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Metis, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/metis) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/metis/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/metis/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/metis/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/metis/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x45cd53" } ``` --- ## Midnight
> Midnight API is available on [Web3 API platform](https://www.ankr.com/rpc/midnight). Midnight is a data protection-focused sidechain of Cardano, designed to support confidential smart contracts and zero-knowledge (ZK) technology. Developed by IOG (Input Output Global)—the same team behind Cardano—Midnight aims to bring privacy-preserving decentralized applications (dApps) to Web3. **Key Features**: * **Confidential Smart Contracts**: Written in TypeScript, supporting zero-knowledge (ZK) privacy by default. * **Zero-Knowledge Proofs (ZKPs)**: Enable validation without revealing sensitive data. * **Privacy-First Architecture**: Built for data protection and regulatory compliance (example: GDPR). * **Selective Disclosure**: Users can choose what information to share and with whom. * **Cardano's Sidechain**: Interoperable with Cardano, using ADA and its wrapped token DUST. * **Custom PoS Consensus**: A privacy-aware Proof-of-Stake mechanism tailored for Midnight. Midnight is at a Testnet stage, providing a stable sandbox environment to develop commercially successful on-chain applications that benefit from the transparency of a blockchain while addressing granular data protection needs. Official quick links: [Website](https://midnight.network/), [Docs](https://docs.midnight.network/), [GitHub](https://github.com/MetisProtocol) ### Networks * Testnet (`HTTPS` and `WSS`) ### API methods For Midnight, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/midnight) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `system_addLogFilter`, `system_addReservedPeer`, `system_dryRun`, `system_dryRunAt`, `system_localListenAddresses`, `system_localPeerId`, `system_name`, `system_nodeRoles`, `system_peers`, `system_removeReservedPeer`, `system_reservedPeers`, `system_resetLogFilter`, `system_unstable_networkState`, `author_*` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/midnight_testnet/ \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "system_chain", "params": [], "id": 1 }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": "testnet-02-1" } ``` --- ## Monad
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Monad API is available on [Web3 API platform](https://www.ankr.com/rpc/monad). Monad is an Ethereum-compatible Layer-1 blockchain with 10,000 tps of throughput, 500ms block frequency, and 1s finality. Monad's implementation of the Ethereum Virtual Machine complies with the Cancun fork; simulation of historical Ethereum transactions with the Monad execution environment produces identical outcomes. Monad also offers full Ethereum RPC compatibility so that users can interact with Monad using familiar tools like Etherscan, Phantom, or MetaMask. Monad accomplishes these performance improvements, while preserving backward compatibility, through the introduction of several major innovations: * [MonadBFT](https://docs.monad.xyz/monad-arch/consensus/monad-bft) for performant, tail-fork-resistant BFT consensus. * [RaptorCast](https://docs.monad.xyz/monad-arch/consensus/raptorcast) for efficient block transmission. * [Asynchronous Execution](https://docs.monad.xyz/monad-arch/consensus/asynchronous-execution) for pipelining consensus and execution to raise the time budget for execution. * [Parallel Execution](https://docs.monad.xyz/monad-arch/execution/parallel-execution) for efficient transaction execution. * [MonadDb](https://docs.monad.xyz/monad-arch/execution/monaddb) for efficient state access. Although Monad features parallel execution and pipelining, it's important to note that blocks in Monad are linear, and transactions are linearly ordered within each block. Official quick links: [Website](https://www.monad.xyz/), [Docs](https://docs.monad.xyz/) ### Networks * Monad (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Monad, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/monad/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/monad_testnet/ \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/monad_testnet/" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/monad_testnet/' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/monad_testnet/' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x18ffb27" } ``` --- ## Moonbeam
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Moonbeam API is available on [Web3 API platform](https://www.ankr.com/rpc/moonbeam). Moonbeam is the most Ethereum compatible smart-contract parachain in the Polkadot ecosystem. It combines the best of both worlds: the familiar and easy-to-use tooling of Ethereum and the scalable, interoperable architecture of Polkadot. Official quick links: [Website](https://moonbeam.network/), [Docs](https://docs.moonbeam.network/), [GitHub](https://github.com/PureStake/moonbeam) ### Networks * Mainnet (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with Moonbeam through Ankr's infrastructure, add a required Moonbeam network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add Moonbeam Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Moonbeam Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/moonbeam/{your_token}`. * **Chain ID**: `1284`. * **Currency symbol**: `GLMR`. * **Block explorer URL**: `https://moonbeam.moonscan.io/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Moonbeam Mainnet. ### API methods For Moonbeam, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/moonbeam) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/moonbeam/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/moonbeam/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/moonbeam/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/moonbeam/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "result":"0x23218d", "id":1 } ``` --- ## Movement
> Movement API is available on [Web3 API platform](https://www.ankr.com/rpc/movement). Movement Mainnet is a general-purpose Layer 2 built by Movement Labs to scale Ethereum applications and introduce the Move Virtual Machine (MoveVM) to a broader ecosystem. It features dual execution, fast settlement, and decentralized sequencing for high performance and interoperability. **Key Components** * **Move Executor**: Supports both MoveVM and EVM smart contracts, enabling seamless deployment of Move and Ethereum dApps on one network. * **Fast Finality Settlement (FFS)**: A validator-driven system that achieves rapid, low-latency transaction finality without expensive proofs or long challenge periods. * **Decentralized Shared Sequencer (DSS)**: Ensures fair, censorship-resistant transaction ordering without relying on external sequencing marketplaces. **Key Features** * **Dual-VM Execution**: Run Move and EVM contracts side-by-side. * **Celestia Data Availability**: Modular, high-throughput data layer. * **Fast Finality**: Validator staking enables settlement in seconds. * **High Scalability**: Parallel execution and sovereign sequencing. Official quick links: [Website](https://www.movementnetwork.xyz/), [Docs](https://docs.movementnetwork.xyz/), [GitHub](https://github.com/movementlabsxyz) ### Networks * Mainnet (`HTTPS`) * Testnet (`HTTPS`) For Movement, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/movement/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `/v1/spec`, `/v1/-/healthy` ### API querying #### Request example ```shell curl -X GET https://rpc.ankr.com/http/movement_mainnet/v1/ \ -H 'Content-Type: application/json' ``` #### Response example ```json { "chain_id": 126, "epoch": "1220292", "ledger_version": "3391169", "oldest_ledger_version": "0", "ledger_timestamp": "1749205936830030", "node_role": "validator", "oldest_block_height": "0", "block_height": "1226595", "git_hash": "1d1cdbbd7fabb80dcb95ba5e23213faa072fab67" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/k-r-p3/ title: Supported Chains: K-R (3/3) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains K-R — Kaia, Kava, Kinto, Kite AI, and more. source: docs/rpc-service/chains/chains-list/k-r-p3.mdx --- Supported chains **K-R** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 3 of 3: [1](/rpc-service/chains/chains-list/k-r/) · [2](/rpc-service/chains/chains-list/k-r-p2/) · 3 ## NEAR
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > NEAR API is available on [Web3 API platform](https://www.ankr.com/rpc/near). NEAR is a user-friendly and carbon-neutral blockchain, built from the ground up to be performant, secure, and infinitely scalable. In technical terms, NEAR is a layer one, sharded, proof-of-stake blockchain built with usability in mind. Official quick links: [Website](https://near.org/), [Docs](https://docs.near.org/), [GitHub](https://github.com/near) ### Networks * Mainnet (`HTTPS`) ### API methods For Near, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/near/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `sandbox_patch_state`, `status`, `network_info` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/near/{your_token} \ -H "content-type: application/json" \ -d '{ "jsonrpc": "2.0", "id": "dontcare", "method": "query", "params": { "request_type": "view_access_key", "finality": "final", "account_id": "client.chainlink.testnet", "public_key": "ed25519:H9k5eiU4xXS3M4z8HzKJSLaZdqGdGwBG49o7orNC4eZW" } }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "nonce": 85, "permission": { "FunctionCall": { "allowance": "18501534631167209000000000", "receiver_id": "client.chainlink.testnet", "method_names": ["get_token_price"] } }, "block_height": 19884918, "block_hash": "GGJQ8yjmo7aEoj8ZpAhGehnq9BSWFx4xswHYzDwwAP2n" }, "id": "dontcare" } ``` --- ## Nervos CKB
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Nervos CKB API is available on [Web3 API platform](https://www.ankr.com/rpc/nervos). Nervos CKB (Common Knowledge Base) is the Layer 1, proof-of-work blockchain of the Nervos ecosystem, using an improved Nakamoto consensus and the generalized UTXO *Cell* model. It is designed to maximize decentralization while remaining minimal, flexible, and secure. :::warning The Nervos EVM / Polyjuice (Godwoken) Layer 2 endpoint has been **deprecated and removed** following the [sunset of the Godwoken network](https://sunset.forcebridge.com/announcement) by Nervos (June 2025). Only the native Nervos CKB (Layer 1) endpoint is available. ::: Official quick links: [Website](https://www.nervos.org/), [CKB Docs](https://docs.nervos.org/), [JSON-RPC reference](https://github.com/nervosnetwork/ckb/blob/develop/rpc/README.md), [GitHub](https://github.com/nervosnetwork/ckb) ### Networks * Mainnet: * Nervos CKB API (`HTTPS` and `WSS`) — `https://rpc.ankr.com/nervos_ckb/{your_token}` ### API methods For Nervos CKB, see the [supported methods](/rpc-service/chains/chains-api/nervos_ckb). Node administration, mining, network-control and `debug_*` methods are restricted on the shared endpoint; contact Sales (`sales@ankr.com`) for Enterprise access. ## Neura
> Neura API is available on [Web3 API platform](https://www.ankr.com/rpc/neura). Neura is a high-performance, EVM-compatible Layer 1 blockchain purpose-built for real-time decentralized applications across DeFi and AI-driven systems. Built on the enterprise-grade Hyperledger Besu client and powered by the QBFT consensus mechanism, Neura delivers immediate transaction finality, fork resistance, and low-latency block production — making it ideal for applications that demand speed, consistency, and trust. Official quick links: [Docs](https://docs.neuraprotocol.io/) ### Networks * Testnet (`HTTPS` and `WSS`) ### API methods For Neura, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/neura/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/neura_testnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/neura_testnet" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/neura_testnet' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/neura_testnet' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0xdb42a" } ``` --- ## Optimism
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Optimism API is available on [Web3 API platform](https://www.ankr.com/rpc/optimism). Optimism is a fast, stable, and scalable L2 blockchain built by Ethereum developers, for Ethereum developers. Built as a minimal extension to existing Ethereum software, Optimism’s [EVM-equivalent](https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306) architecture scales your Ethereum apps without surprises. If it works on Ethereum, it works on Optimism at a fraction of the cost. With the OVM 2.0 upgrade, which happened on November 11th, 2021, the Optimism protocol went through its biggest upgrade to date. The primary focus of this upgrade was EVM Equivalence, a new design for Optimism that brought it close to 1:1 parity with Ethereum. Official quick links: [Website](https://www.optimism.io/), [Docs](https://community.optimism.io/), [GitHub](https://github.com/ethereum-optimism) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet: * Sepolia (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with Optimism through Ankr's infrastructure, add a required Optimism network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add Optimism Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Optimism Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/optimism/{your_token}`. * **Chain ID**: `10`. * **Currency symbol**: `ETH`. * **Block explorer URL**: `https://optimistic.etherscan.io/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Optimism Mainnet. ### API methods For Optimism, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/optimism) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/optimism/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/optimism/{your_token}" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/optimism/{your_token}' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/optimism/{your_token}' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0x249c491" } ``` --- ## Polkadot
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Polkadot API is available on [Web3 API platform](https://www.ankr.com/rpc/polkadot). Polkadot is the first fully-sharded blockchain. Polkadot enables scalability by allowing specialized blockchains to communicate with each other in a secure, trust-free environment. Polkadot is built to connect and secure unique blockchains, whether they be public, permissionless networks, private consortium chains, or other Web3 technologies. It enables an internet where independent blockchains can exchange information under common security guarantees. Official quick links: [Website](https://polkadot.network/), [Docs](https://wiki.polkadot.network/), [GitHub](https://github.com/paritytech/polkadot) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Polkadot, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/polkadot/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `state_getMetadata`, `state_getPairs`, `state_traceBlock`, `state_trieMigrationStatus`, `state_subscribeStorage`, `state_unsubscribeStorage`, `state_queryStorage`, `sync_state_genSyncSpec`, `system_accountNextIndex`, `system_addLogFilter`, `system_addReservedPeer`, `system_health`, `system_localListenAddresses`, `system_localPeerId`, `system_name`, `system_nodeRoles`, `system_peers`, `system_properties`, `system_removeReservedPeer`, `system_reservedPeers`, `system_resetLogFilter`, `system_syncState`, `system_unstable_networkState`, `system_version`, `account_*`, `babe_*`, `mmr_*`, `dev_*`, `offchain_*`, `author_*` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/polkadot/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlock", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block": { "header": { "parentHash": "0xe121a7c43cbe19eab2601d422df9173a84553cda9f0cd59e0656227696f46d30", "number": "0xedaaed", "stateRoot": "0x4f4dd4f1bc408dfd01222a8d1401a96c9abb8be86ab60c0e01f10b4a54834b6f", "extrinsicsRoot": "0xf310b41030a9bbf5788176a0a187a7fe84833729fb763883329bcc2f9a308a03", "digest": { "logs": [ "0x0642414245b50103fc000000f4aebb1000000000440c17d240df02d42ddab5c961fe2649e30f69aea189e5bc95487ae5f889a74bc516a159ccc7db48e5253dae8f1168be0c66597b18ab1e2248ecd3862eae9e0a8c74b856d20d6916ab8cbe3cd4955f183c231bde98ca24dbb3f201468cc23b0f", "0x054241424501015a6148654f94084ca0373a6d708704ce54ae704e159d51eb00d7de032b2b3824a91a4509f94f90fda82a3ff372b0003c0440475b9218e6469d883eeba276ac8a" ] } }, "extrinsics": [ "0x280403000bc076d42e8801", "0xdd02040c00ecaaed009c98002408011220c9b7d94c0c8dc84ca9034c1a6926bfb2e0b1e31c0c9fbaee8126874d32d122840878742f6970342f3134312e39382e3231392e3139392f7463702f33303333336c682f6970342f3130302e36342e332e31322f7463702f333033333379190000f600000029010000903755c7655994b2ca1f457d26c947041f9e6970e6b3cf578ee8459d061cc20d3d7e65d5c166fcca21059ad60b89d21f8a2b5574da4414adb72941c0c2e44d8c" ] }, "justifications": null }, "id": 1 } ``` --- ## Polygon
> Polygon API is available on [Web3 API platform](https://www.ankr.com/rpc/polygon). Polygon is a scaling solution for public blockchains. Polygon PoS supports all the existing Ethereum tooling along with faster and cheaper transactions. Official quick links: [Website](https://polygon.technology/), [Docs](https://wiki.polygon.technology/), [GitHub](https://github.com/maticnetwork/) ### Networks * Mainnet (`HTTPS` and `WSS`) * Amoy Testnet (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with Polygon through Ankr's infrastructure, add a required Polygon network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add Polygon Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Polygon Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/polygon/`. * **Chain ID**: `137`. * **Currency symbol**: `MATIC`. * **Block explorer URL**: `https://polygonscan.com/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Polygon Mainnet. To add Polygon Amoy Testnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Polygon Amoy Testnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/polygon_amoy/`. * **Chain ID**: `80002`. * **Currency symbol**: `MATIC`. * **Block explorer URL**: `https://www.oklink.com/amoy/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Polygon Amoy Testnet. ### API methods For Polygon, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/polygon) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/polygon \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/polygon" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/polygon' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/polygon' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0x21fbd0f" } ``` --- ## Rollux
> Rollux API is available on [Web3 API platform](https://www.ankr.com/rpc/rollux). Rollux is a suite of rollup-based Layer 2 solutions designed to enable EVM users with near-instant low-cost transfers, executions, and contract deployments. Rollux utilizes Syscoin's Layer 1 for best-of-breed secure decentralized [settlement](https://docs.syscoin.org/docs/intro/syscoin-what/#settlement-layer) and Syscoin PoDA for Layer 1 data availability, offering more efficiency, lower costs, and higher throughput than other L1 DA alternatives. As a suite, Rollux is set to encompass both Optimistic and ZK (zero-knowledge) based approaches, enabling users and projects to choose a network or solution that fits them best. Official quick links: [Website](https://syscoin.org/rollux), [Docs](https://docs.syscoin.org/docs/tech/rollux), [GitHub](https://github.com/syscoin) ### Networks * Mainnet (`HTTPS` and `WSS`) * Op-node Mainnet (`HTTPS`) * Testnet (`HTTPS` and `WSS`) * Op-node Testnet (`HTTPS`) ### API methods For Rollux, we support blockchain interaction via all the [applicable EVM methods](/rpc-service/chains/chains-api/rollux/#evm-methods) except for those listed as unsupported. For Rollux Op-node, we support blockchain interaction via the applicable [Op-node methods](/rpc-service/chains/chains-api/rollux/#op-node-methods). #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/rollux \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/rollux" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/rollux' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/rollux' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x16bef5" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/k-r/ title: Supported Chains: K-R (1/3) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains K-R — Kaia, Kava, Kinto, Kite AI, and more. source: docs/rpc-service/chains/chains-list/k-r.mdx --- Supported chains **K-R** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 1 of 3: 1 · [2](/rpc-service/chains/chains-list/k-r-p2/) · [3](/rpc-service/chains/chains-list/k-r-p3/) ## Kaia
> Kaia API is available on [Web3 API platform](https://www.ankr.com/rpc/kaia). Kaia is an EVM-compatible Layer 1 public blockchain designed to bring Web3 services to millions of users across Asia. Formed through the merger of the Klaytn and Finschia blockchains — initially developed by Kakao and LINE respectively — Kaia aims to integrate a broad user base with vast on-chain assets and technology to help builders promptly implement and expand their ideas with successful results. Key Features of Kaia: * **High Performance**: Kaia achieves immediate transaction finality with a 1-second block time, processing approximately 4,000 transactions per second. * **User Accessibility**: By integrating with popular messaging apps like KakaoTalk and LINE, Kaia provides easy access to existing Web2 users, facilitating seamless onboarding to Web3 services. * **Developer-Friendly Environment**: Kaia offers EVM equivalence, allowing developers to deploy existing Ethereum-based applications with minimal modifications. Planned support for CosmWasm and integration with industry-leading cross-chain bridges provide developers with unparalleled flexibility. * **Scalability**: The network's modular architecture supports customizable and easily deployable service chains as Layer 2 solutions, enhancing scalability for high-throughput services. * **Governance**: Kaia implements an on-chain governance system designed to be fair and inclusive, with voting rights proportional to the amount of KAIA tokens staked. Official quick links: [Website](https://www.kaia.io/), [Docs](https://docs.kaia.io/), [GitHub](https://github.com/klaytn) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Kaia, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/kaia/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*`, `kaia_sign`, `kaia_syncing`, `kaia_clientVersion`, `kaia_isParallelDBWrite`, `kaia_isSenderTxHashIndexingEnabled`, `kaia_protocolVersion`, `kaia_rewardbase`, `kaia_getFilterChanges`, `kaia_getFilterLogs`, `kaia_newBlockFilter`, `kaia_newFilter`, `kaia_newPendingTransactionFilter`, `kaia_uninstallFilter`, `net_listening`, `net_peerCount`, `net_peerCountByType`, `kaia_sendTransaction`, `kaia_sendTransactionAsFeePayer`, `kaia_signTransaction`, `kaia_signTransactionAsFeePayer`, `governance_*`, `mainbridge_*`, `subbridge_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/kaia \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/kaia" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/kaia' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/kaia' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0xa3c7fb4" } ``` --- ## Kava
> Kava API is available on [Web3 API platform](https://www.ankr.com/rpc/kava). The Kava Network is the Layer-1 blockchain that combines the speed and scalability of the Cosmos SDK with the developer support of Ethereum. Kava will empower developers to build for Web3 and next-gen blockchain technologies through its unique co-chain architecture. KAVA is the native governance and staking token of the Kava Network, enabling its decentralization and security. Official quick links: [Website](https://www.kava.io/), [Docs](https://docs.kava.io/docs/intro/), [GitHub](https://github.com/kava-labs) ### Networks * Mainnet: * Cosmos REST API (`HTTPS`) * EVM JSON-RPC API (`HTTPS` and `WSS`) * Tendermint REST API (`HTTPS`) * Tendermint JSON-RPC API (`HTTPS` and `WSS`) ### API methods For Kava, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/kava/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **EVM JSON-RPC**: **HTTPS** `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS** `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` **Tendermint REST**: `/health`, `/broadcast_evidence`, `/dial_seeds`, `/dial_peers` ### API querying #### EVM JSON-RPC ```shell curl -X POST https://rpc.ankr.com/kava_evm \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```json { "jsonrpc":"2.0", "id":1, "result":"0xca0842" } ``` #### Tendermint REST ```shell curl https://rpc.ankr.com/http/kava_rpc/blockchain?minHeight=1&maxHeight=2 ``` ```json { "id": 1, "jsonrpc": "2.0", "result": { "last_height": "13211309", "block_metas": [ { "block_id": { "hash": "606AA3A0B325273C27FCD254D528DCCB968351ECF4C045920517A5269D76DB4E", "parts": { "total": 1, "hash": "8B827E255B0EFF6D3D66315F9460D180D7A1988A5281DE11699CE204A0308E79" } }, "block_size": "6590", "header": { "version": { "block": "11" }, "chain_id": "kava_2222-10", "height": "2", "time": "2022-05-25T18:39:32.196946927Z", "last_block_id": { "hash": "9D2AF876309BB9174604004A813DCFEE94F4947B08C5BB4C1A042F318488851E", "parts": { "total": 1, "hash": "510794F966632A503431FE4515D6C15D49BCFEA9E6753E06E582C8D26C826294" } }, "last_commit_hash": "093DC4B1414DE776AAC2388AAD616FCAC5E783930420710395732259CA023DB8", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "next_validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "4107A4EABA68DEF282B97D5071440DFB121307B524B0E2B64D7F348CB57E74A9", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "330871F4F79EF8572E4AB3A64A45AF0C88AFC24E" }, "num_txs": "0" }, { "block_id": { "hash": "9D2AF876309BB9174604004A813DCFEE94F4947B08C5BB4C1A042F318488851E", "parts": { "total": 1, "hash": "510794F966632A503431FE4515D6C15D49BCFEA9E6753E06E582C8D26C826294" } }, "block_size": "339", "header": { "version": { "block": "11" }, "chain_id": "kava_2222-10", "height": "1", "time": "2022-05-25T17:00:00Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "next_validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "BFA6235D95564560A73460860B8D6F847360A31B" }, "num_txs": "0" } ] } } ``` #### Tendermint JSON-RPC ```shell curl -X POST https://rpc.ankr.com/kava_rpc \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "blockchain", "params": ["1", "2"], "id": 1 }' ``` ```json { "id": 1, "jsonrpc": "2.0", "result": { "last_height": "13211309", "block_metas": [ { "block_id": { "hash": "606AA3A0B325273C27FCD254D528DCCB968351ECF4C045920517A5269D76DB4E", "parts": { "total": 1, "hash": "8B827E255B0EFF6D3D66315F9460D180D7A1988A5281DE11699CE204A0308E79" } }, "block_size": "6590", "header": { "version": { "block": "11" }, "chain_id": "kava_2222-10", "height": "2", "time": "2022-05-25T18:39:32.196946927Z", "last_block_id": { "hash": "9D2AF876309BB9174604004A813DCFEE94F4947B08C5BB4C1A042F318488851E", "parts": { "total": 1, "hash": "510794F966632A503431FE4515D6C15D49BCFEA9E6753E06E582C8D26C826294" } }, "last_commit_hash": "093DC4B1414DE776AAC2388AAD616FCAC5E783930420710395732259CA023DB8", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "next_validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "4107A4EABA68DEF282B97D5071440DFB121307B524B0E2B64D7F348CB57E74A9", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "330871F4F79EF8572E4AB3A64A45AF0C88AFC24E" }, "num_txs": "0" }, { "block_id": { "hash": "9D2AF876309BB9174604004A813DCFEE94F4947B08C5BB4C1A042F318488851E", "parts": { "total": 1, "hash": "510794F966632A503431FE4515D6C15D49BCFEA9E6753E06E582C8D26C826294" } }, "block_size": "339", "header": { "version": { "block": "11" }, "chain_id": "kava_2222-10", "height": "1", "time": "2022-05-25T17:00:00Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "next_validators_hash": "9D8248DFDD2C7571A1FB66F43C21FF698BACE04A4F2802AF63ED70FB7DC91B57", "consensus_hash": "AD82B220C509602720D74FD75BCE7CFE9B148039958F236D8894E00EB1599E04", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "BFA6235D95564560A73460860B8D6F847360A31B" }, "num_txs": "0" } ] } } ``` #### Cosmos REST ```shell curl https://rpc.ankr.com/http/kava_api/cosmos/auth/v1beta1/params ``` ```json { "params": { "max_memo_characters": "512", "tx_sig_limit": "7", "tx_size_cost_per_byte": "10", "sig_verify_cost_ed25519": "590", "sig_verify_cost_secp256k1": "1000" } } ``` --- ## Kinto
> Kinto API is available on [Web3 API platform](https://www.ankr.com/rpc/kinto). Kinto is a Layer 2 focused on providing safe access to on-chain finance. It's built on top of the Ethereum network using the [Arbitrum Nitro Stack](https://docs.arbitrum.io/why-nitro), and it's non-custodial, transparent, permissionless, and governed by the community. Official quick links: [Website](https://www.kinto.xyz/), [Docs](https://docs.kinto.xyz/kinto-the-safe-l2) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Kinto, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/kinto/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/kinto \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/kinto" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/kinto' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/kinto' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1db1f" } ``` --- ## Kite AI
> Kite AI API is available on [Web3 API platform](https://www.ankr.com/rpc/kite). Kite AI is the first AI payment blockchain, providing foundational infrastructure that empowers autonomous agents to operate and transact with identity, payment, and verification. The network enables AI agents to discover and pay for services autonomously through features like funded wallets, scoped spending sessions, and service discovery, all while maintaining user control. Official quick links: [Website](https://gokite.ai/), [Docs](https://docs.gokite.ai/) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Kite AI, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/kite/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/kite_mainnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/kite_mainnet" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/kite_mainnet' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/kite_mainnet' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x28244" } ``` --- ## Kusama
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > Kusama API is available on [Web3 API platform](https://www.ankr.com/rpc/kusama). Kusama is an early release of Polkadot: a scalable, multichain network for radical innovation. Kusama serves as a proving ground that allows teams and developers to build and deploy a parachain, and experiment with Polkadot’s governance and NPoS functionality in a real environment. Official quick links: [Website](https://kusama.network/), [Docs](https://guide.kusama.network/docs/kusama-getting-started), [GitHub](https://github.com/paritytech/polkadot) ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For Kusama, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/kusama/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `state_getMetadata`, `state_getPairs`, `state_traceBlock`, `state_trieMigrationStatus`, `state_subscribeStorage`, `state_unsubscribeStorage`, `state_queryStorage`, `sync_state_genSyncSpec`, `system_accountNextIndex`, `system_addLogFilter`, `system_addReservedPeer`, `system_health`, `system_localListenAddresses`, `system_localPeerId`, `system_name`, `system_nodeRoles`, `system_peers`, `system_properties`, `system_removeReservedPeer`, `system_reservedPeers`, `system_resetLogFilter`, `system_syncState`, `system_unstable_networkState`, `system_version`, `account_*`, `babe_*`, `mmr_*`, `dev_*`, `offchain_*`, `author_*` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/kusama/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "chain_getBlock", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": { "block": { "header": { "parentHash": "0x805af41d6b9e4a559a188c1824ca8bbfd454761d40791013ca9acbb7022f41b1", "number": "0x1136a68", "stateRoot": "0x512ca942fdd6ac82d445fddc9e6b3c23548bbbcff431dd9136fd73c3377fd1f1", "extrinsicsRoot": "0xd45d7104386fd2bc68ec0b9455c5395b53dd8d72fb73376f13e433e282bfda34", "digest": { "logs": [ "0x0642414245b50103a4030000cef6bc1000000000620f5a0e38b9f5c4695c9271c17aa6d75adbbd4ed06f5d08a0f17280524242133e3eb41876d2ff9609ee2cfa422ac8a4772179ad7310d950c8edb97f0e7543006eb79fd3fbd865c24f8601f8ee50409984c915b59480e01b9382d2abccd55f06", "0x05424142450101e45511be6785f935a0c729a15cab7503b06aeed6b881d9cdf75978e7d393060a356278eff9ac4918c1fba3127c4dfa88206ccd8a737b8796e99171728e0b448c" ] } }, "extrinsics": [ "0x280402000b217cd84c8801" ] }, "justifications": null }, "id": 1 } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/s-t-p2/ title: Supported Chains: S-T (2/4) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains S-T — Scroll, Secret Network, Sei, Solana, and more. source: docs/rpc-service/chains/chains-list/s-t-p2.mdx --- Supported chains **S-T** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 2 of 4: [1](/rpc-service/chains/chains-list/s-t/) · 2 · [3](/rpc-service/chains/chains-list/s-t-p3/) · [4](/rpc-service/chains/chains-list/s-t-p4/) ## Stellar
> Stellar API is available on [Web3 API platform](https://www.ankr.com/rpc/stellar). Stellar is a layer-1 open-source, decentralized, peer-to-peer blockchain network that provides a framework for developers to create applications, issue assets, and connect to existing financial rails. Stellar is designed to enable creators, innovators, and developers to build projects on the network that can interoperate with each other. Official quick links: [Website](https://stellar.org/), [Docs](https://developers.stellar.org/docs), [GitHub](https://github.com/stellar/) ### Networks * Mainnet: * Horizon (`HTTPS`) * Soroban (`HTTPS`) * Testnet: * Horizon (`HTTPS`) * Soroban (`HTTPS`) ### API methods For Stellar we support blockchain interaction via the following methods: * [Horizon REST](/rpc-service/chains/chains-api/stellar/#horizon-rest-methods). * [Soroban JSON-RPC](/rpc-service/chains/chains-api/stellar/transactions/#soroban-json-rpc-methods). #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: None. ### API querying #### Request example (Horizon REST) ```shell curl https://rpc.ankr.com/http/stellar_horizon/accounts?cursor=&limit=1&order=asc&signer=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U ``` #### Response example (Horizon REST) ```shell { "_links": { "self": { "href": "https://rpc.ankr.com/accounts?cursor=\u0026limit=1\u0026order=asc\u0026signer=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U" }, "next": { "href": "https://rpc.ankr.com/accounts?cursor=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U\u0026limit=1\u0026order=asc\u0026signer=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U" }, "prev": { "href": "https://rpc.ankr.com/accounts?cursor=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U\u0026limit=1\u0026order=desc\u0026signer=GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U" } }, "_embedded": { "records": [ { "_links": { "self": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U" }, "transactions": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/transactions{?cursor,limit,order}", "templated": true }, "operations": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/operations{?cursor,limit,order}", "templated": true }, "payments": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/payments{?cursor,limit,order}", "templated": true }, "effects": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/effects{?cursor,limit,order}", "templated": true }, "offers": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/offers{?cursor,limit,order}", "templated": true }, "trades": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/trades{?cursor,limit,order}", "templated": true }, "data": { "href": "https://rpc.ankr.com/accounts/GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U/data/{key}", "templated": true } }, "id": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U", "account_id": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U", "sequence": "24739097524306474", "subentry_count": 3, "inflation_destination": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U", "home_domain": "tempo.eu.com", "last_modified_ledger": 46469501, "last_modified_time": null, "thresholds": { "low_threshold": 5, "med_threshold": 0, "high_threshold": 0 }, "flags": { "auth_required": false, "auth_revocable": true, "auth_immutable": false, "auth_clawback_enabled": false }, "balances": [ { "balance": "0.0000000", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 40074670, "is_authorized": true, "is_authorized_to_maintain_liabilities": true, "asset_type": "credit_alphanum4", "asset_code": "EURT", "asset_issuer": "GAP5LETOV6YIE62YAM56STDANPRDO7ZFDBGSNHJQIYGGKSMOZAHOOS2S" }, { "balance": "0.0000000", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 20213845, "is_authorized": true, "is_authorized_to_maintain_liabilities": true, "asset_type": "credit_alphanum4", "asset_code": "NGN", "asset_issuer": "GCC4YLCR7DDWFCIPTROQM7EB2QMFD35XRWEQVIQYJQHVW6VE5MJZXIGW" }, { "balance": "0.0000000", "limit": "922337203685.4775807", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "last_modified_ledger": 7877447, "is_authorized": false, "is_authorized_to_maintain_liabilities": false, "asset_type": "credit_alphanum4", "asset_code": "PHP", "asset_issuer": "GBUQWP3BOUZX34TOND2QV7QQ7K7VJTG6VSE7WMLBTMDJLLAW7YKGU6EP" }, { "balance": "80.8945748", "buying_liabilities": "0.0000000", "selling_liabilities": "0.0000000", "asset_type": "native" } ], "signers": [ { "weight": 10, "key": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U", "type": "ed25519_public_key" } ], "data": {}, "num_sponsoring": 0, "num_sponsored": 0, "paging_token": "GDI73WJ4SX7LOG3XZDJC3KCK6ED6E5NBYK2JUBQSPBCNNWEG3ZN7T75U" } ] } } ``` #### Request example (Soroban JSON-RPC) ```shell curl 'https://rpc.ankr.com/stellar_testnet_soroban' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "getVersionInfo" }' ``` #### Response example (Soroban JSON-RPC) ```json { "id": 1, "jsonrpc": "2.0", "result": { "version": "23.0.0-67bf8456a32c74e1fe189ec8d0321614d07944d5", "commitHash": "67bf8456a32c74e1fe189ec8d0321614d07944d5", "buildTimestamp": "2025-08-14T15:20:26", "captiveCoreVersion": "stellar-core 23.0.0 (d5cbc0793d6eab25eac886969c5bc0f7da69d6ea)", "protocolVersion": 23 } } ``` --- ## Story
> Story API is available on [Web3 API platform](https://www.ankr.com/rpc/story). Story Network is a purpose-built layer 1 blockchain achieving the best of EVM and Cosmos SDK. It is 100% EVM-compatible alongside deep execution layer optimizations to support graph data structures, purpose-built for handling complex data structures like IP quickly and cost-efficiently. It does this by: Key Features: * **EVM Compatibility**: Full compatibility with Ethereum Virtual Machine. * **Optimized Data Structures**: Precompiled primitives for efficient IP graph traversal. * **Fast Finality**: CometBFT-based consensus layer for quick transaction finality. * **Modular Architecture**: Decoupled consensus from execution using Ethereum's Engine-API. Official quick links: [Website](https://www.story.foundation/), [Docs](https://docs.story.foundation/docs/what-is-story), [GitHub](https://github.com/storyprotocol) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Story, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/story/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS** `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/story_mainnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/story_mainnet" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/story_mainnet' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/story_mainnet' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x17a1c4" } ``` --- ## Sui
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Sui API is available on [Web3 API platform](https://www.ankr.com/rpc/sui). Sui is the first permissionless Layer 1 blockchain designed from the ground up to enable creators and developers to build experiences that cater to the next billion users in Web3. Sui is horizontally scalable to support a wide range of application development with unrivaled speed at low cost. Official quick links: [Website](https://sui.io/), [Docs](https://docs.sui.io/), [GitHub](https://github.com/MystenLabs) ### Networks * Mainnet (`HTTPS`, `WSS`, `gRPC`, `GraphQL`) * Testnet (`HTTPS`, `WSS`, `gRPC`) ### API methods For Sui, we support blockchain interaction via the following interfaces: * [Overview — all Sui interfaces](/rpc-service/chains/chains-api/sui/) * [JSON-RPC methods](/rpc-service/chains/chains-api/sui/json-rpc) * [gRPC methods](/rpc-service/chains/chains-api/sui/grpc) (mainnet, testnet, archive) * [GraphQL](/rpc-service/chains/chains-api/sui/graphql) (mainnet) #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: None. ### API querying (RPC methods) #### Request example ```shell curl -X POST https://rpc.ankr.com/sui/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "sui_getChainIdentifier", "params": [] }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "4c78adac", "id": 1 } ``` ### API querying (gRPC methods) #### Request example ```shell grpcurl \ -H "x-token: token-value" \ -d '{ "read_mask": { "paths": [ "sequence_number", "digest", "summary" ] } }' \ sui.grpc.ankr.com:443 \ sui.rpc.v2.LedgerService.GetCheckpoint ``` #### Response example ```json { "checkpoint": { "sequenceNumber": "214225619", "digest": "GNSviTUX6DXkiCPKYDo1uihJsm5oRcjtvrkT8mVQyay8", "summary": { "bcs": { "name": "CheckpointSummary", "value": "uAMAAAAAAADT0sQMAAAAADnoOwgBAAAAIPstfiDnwCpkcFlrp8nRs5js5xXtg0tbEcIIcaE+c+ldASDIgYxj9sUG3w0UPAMjIBpRGWeo4PV/1D5fw6pQLRm0VefE2UCSBwAAcCuegkRtAAC8pNR6PmsAABT/ZlEVAQAA/fdQoZoBAAAAAAoAAdn2AQAAAAAA" }, "digest": "GNSviTUX6DXkiCPKYDo1uihJsm5oRcjtvrkT8mVQyay8", "epoch": "952", "sequenceNumber": "214225619", "totalNetworkTransactions": "4433111097", "contentDigest": "HuVZqNZXeitWwTsHdNKT5JcjcsHZfT28CJAgpCFxy3kg", "previousDigest": "EVh7YWQnfvF89gg48v7tYDtX12SVyWSWQb5YtbCzJaxc", "epochRollingGasCostSummary": { "computationCost": "8324734633191", "storageCost": "120141016607600", "storageRebate": "117916092900540", "nonRefundableStorageFee": "1191071645460" }, "timestamp": "2025-11-20T12:50:29.501Z", "versionSpecificData": "AAHZ9gEAAAAAAA==" } } } ``` --- ## Swell
> Swell API is available on [Web3 API platform](https://www.ankr.com/rpc/swell). Swell is a non-custodial staking protocol with a mission to deliver the world’s best liquid staking and restaking experience, simplify access to DeFi, while securing the future of Ethereum and restaking services. With Swell, users are able to earn passive income by staking or restaking ETH to earn both blockchain rewards and restaked AVS rewards, and in return be provided with a yield-bearing liquid token (LST or LRT) to hold or participate in the wider DeFi ecosystem to earn additional yield. Official quick links: [Website](https://www.swellnetwork.io/), [Docs](https://docs.swellnetwork.io/), [GitHub](https://github.com/SwellNetwork) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet: * Sepolia (`HTTPS` and `WSS`) ### API methods For Swell, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/swell) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/swell \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/swell" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/swell' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/swell' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0x359a5" } ``` --- ## Syscoin
> Syscoin API is available on [Web3 API platform](https://www.ankr.com/rpc/syscoin). Syscoin is a Proof-of-Work blockchain solution merge-mined with Bitcoin. At its base is a dual-chain Layer 1: the core is the Syscoin native blockchain, and running in tandem with it is an Ethereum Virtual Machine (EVM) chain called NEVM (Network-Enhanced Virtual Machine), which provides modularity, enhanced security, and full byte-for-byte Ethereum compatibility. Official quick links: [Website](https://syscoin.org/), [Docs](https://docs.syscoin.org/docs/intro/syscoin-what/), [GitHub](https://github.com/syscoin) ### Networks * Mainnet (`HTTPS` and `WSS`) ### Add networks to MetaMask Using Ankr as the blockchain provider for MetaMask makes user interaction on Web3 not just easy and slick but also PRIVATE. We DON'T collect users' blockchain addresses — end of the story. Feel free to check our [terms](https://www.ankr.com/terms/ ) and [privacy policy](https://www.ankr.com/privacy-policy/) to be sure. For MetaMask to interact with Syscoin through Ankr's infrastructure, add a required Syscoin network either via Web3 API platform's or MetaMask's UI. #### Via Web3 API platform To be added soon. #### Via MetaMask To add Syscoin Mainnet, follow these steps: 1. In MetaMask extension, click **Networks** (drop-down menu) **> Add network** to open **Settings**. 2. In the **Add a network** pane, click **Add a network manually**, then enter the network details and click **Save**: * **Network name**: `Syscoin Mainnet by Ankr RPC`. * **New RPC URL**: `https://rpc.ankr.com/syscoin/`. * **Chain ID**: `57`. * **Currency symbol**: `SYS`. * **Block explorer URL**: `https://explorer.syscoin.org/`. Congrats — you've just added Ankr as the blockchain provider for MetaMask to interact with Syscoin Mainnet. ### API methods For Syscoin, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/syscoin) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/syscoin \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/syscoin" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/syscoin' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/syscoin' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0x2fb1c" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/s-t-p3/ title: Supported Chains: S-T (3/4) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains S-T — Scroll, Secret Network, Sei, Solana, and more. source: docs/rpc-service/chains/chains-list/s-t-p3.mdx --- Supported chains **S-T** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 3 of 4: [1](/rpc-service/chains/chains-list/s-t/) · [2](/rpc-service/chains/chains-list/s-t-p2/) · 3 · [4](/rpc-service/chains/chains-list/s-t-p4/) ## TAC
> TAC API is available on [Web3 API platform](https://www.ankr.com/rpc/tac). TAC (Tokenized Asset Chain) is a network extension for TON (The Open Network) that enhances its compatibility with the Ethereum Virtual Machine (EVM). It allows users to access EVM applications directly through their TON wallets, eliminating the need to manage multiple wallets or use traditional bridges. TAC key features: * **EVM-Equivalent Layer 1**: TAC uses an EVM Layer 1 based on CosmosSDK + Ethermint, secured by dPoS and Babylon Bitcoin Staking, running TON-native-like dapps. * **Secure Cross-Chain Communication**: A decentralized sequencer network ensures secure message delivery between TON and TAC, with validation by sequencers and consensus within groups. * **Economic Security Model**: Validators and sequencers stake collateral and participate in validation, earning rewards for good performance and facing penalties for errors. * **Proxy Apps**: Proxy contracts make EVM apps feel native to TON, with seamless interaction through TON wallets without extra complexity. Official quick links: [Website](https://tac.build/), [Docs](https://docs.tac.build/get-started/introduction) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet: * SPB (`HTTPS` and `WSS`) * Turin (`HTTPS` and `WSS`) ### API methods For TAC, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/tac/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **Tendermint (both for REST and JSON-RPC)**: `/health`, `/genesis`, `/broadcast_evidence`, `/dial_seeds`, `/dial_peers`, **Cosmos**: `/cosmos/auth/v1beta1/address_by_id/{id}`, `/cosmos/auth/v1beta1/module_accounts`, `/cosmos/auth/v1beta1/bech32`, `/cosmos/auth/v1beta1/bech32/{address_bytes}`, `/cosmos/auth/v1beta1/bech32/{address_string}`, `/cosmos/bank/v1beta1/supply/{denom}`, `/cosmos/bank/v1beta1/denom_owners/{denom}`, `/cosmos/bank/v1beta1/send_enabled`, `/cosmos/base/reflection/v1beta1/interfaces`, `/cosmos/base/reflection/v1beta1/interfaces/:interface_name/implementations`, `/cosmos/base/reflection/v1beta1/app_descriptor/authn`, `/cosmos/base/reflection/v1beta1/app_descriptor/chain`, `/cosmos/base/reflection/v1beta1/app_descriptor/codec`, `/cosmos/base/reflection/v1beta1/app_descriptor/configuration`, `/cosmos/base/reflection/v1beta1/app_descriptor/query_services`, `/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor`, `/cosmos/base/tendermint/v1beta1/abci_query`, `/cosmos/feegrant/v1beta1/issued/{granter}`, `/cosmos/gov/v1/proposals/{proposal_id}`, `/cosmos/gov/v1/proposals`, `/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}`, `/cosmos/gov/v1/proposals/{proposal_id}/votes`, `/cosmos/gov/v1/params/{params_type}`, `/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}`, `/cosmos/gov/v1/proposals/{proposal_id}/deposits`, `/cosmos/gov/v1/proposals/{proposal_id}/tally`, `/cosmos/group/v1/group_info/{group_id}`, `/cosmos/group/v1/group_policy_info/{address}`, `/cosmos/group/v1/group_members/{group_id}`, `/cosmos/group/v1/groups_by_admin/{admin}`, `/cosmos/group/v1/group_policies_by_group/{group_id}`, `/cosmos/group/v1/group_policies_by_admin/{admin}`, `/cosmos/group/v1/proposal/{proposal_id}`, `/cosmos/group/v1/proposals_by_group_policy/{address}`, `/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}`, `/cosmos/group/v1/votes_by_proposal/{proposal_id}`, `/cosmos/group/v1/votes_by_voter/{voter}`, `/cosmos/group/v1/groups_by_member/{address}`, `/cosmos/group/v1/proposals/{proposal_id}/tally`, `/cosmos/nft/v1beta1/balance/{owner}/{class_id}`, `/cosmos/nft/v1beta1/owner/{class_id}/{id}`, `/cosmos/nft/v1beta1/supply/{class_id}`, `/cosmos/nft/v1beta1/nfts`, `/cosmos/nft/v1beta1/nfts/{class_id}/{id}`, `/cosmos/nft/v1beta1/classes/{class_id}`, `/cosmos/nft/v1beta1/classes`, `/cosmos/params/v1beta1/subspaces`, `/cosmos/upgrade/v1beta1/module_versions`, `/cosmos/upgrade/v1beta1/authority`, `/cosmos/base/tendermint/v1beta1/node_info`, `/cosmos/base/tendermint/v1beta1/syncing`, `/cosmos/params/v1beta1/params`, `/syncing`, `/blocks/latest`, `/blocks/{height}`, `/validatorsets/latest`, `/validatorsets/{height}`, `/wasm/code`, `/wasm/code/{codeID}`, `/wasm/code/{codeID}/contracts`, `/wasm/contract/{contractAddress}`, `/wasm/contract/{contractAddress}/code-hash`, `/wasm/contract/{contractAddress}/query/{query}`, `/wasm/code/{codeID}/hash`, `/reg/consensus-io-exch-pubkey` ### API querying #### EVM JSON-RPC ```shell curl -X POST https://rpc.ankr.com/tac_turin \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```json { "jsonrpc":"2.0", "id":1, "result":"0x1fc3ce" } ``` #### Tendermint JSON-RPC ```shell curl -X POST https://rpc.ankr.com/tac_turin_tendermint \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "blockchain", "params": ["1", "2"], "id": 1 }' ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "last_height": "2081751", "block_metas": [ { "block_id": { "hash": "84268D1C68D2D1C4FE8E684299AD9671D9716086B16E8D772A40B45CED4A0C60", "parts": { "total": 1, "hash": "FA96827A730FE9D774551E05F89F2AAF38B4591B0AEBE526550531D4DB03F037" } }, "block_size": "915", "header": { "version": { "block": "11" }, "chain_id": "tacchain_2390-1", "height": "2", "time": "2024-11-08T13:20:24.990445609Z", "last_block_id": { "hash": "07726785B5E5EF0701CEAFA0B929BDF852ABE35840C885A2F740A9E7108A610A", "parts": { "total": 1, "hash": "4289823D5E0104E13D4D5D72A84BF412914C900B2AE14FC6F285F80287B5F0C4" } }, "last_commit_hash": "E27BCFA2763BABDB460A1C0A56995C910A7B89C1C70E4FF2693DBC6DD44E50CD", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "307B2281CBDCC5D12F69345E9DA7B262C984BFFDD3EE85D7C732654EECB94B9D", "next_validators_hash": "307B2281CBDCC5D12F69345E9DA7B262C984BFFDD3EE85D7C732654EECB94B9D", "consensus_hash": "16DBFD0AAA36E214D4E55A6EAADF68E9802DD4845DBD49EB58DAA89F885D1FC0", "app_hash": "80ED329668AFDE0C947FFFF5AA6BE6384A71DFA4DF96E0A6D392D755DFC61EF9", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "A0E2E65C71DE9D8A59D182933122934A1FA23837" }, "num_txs": "0" }, { "block_id": { "hash": "07726785B5E5EF0701CEAFA0B929BDF852ABE35840C885A2F740A9E7108A610A", "parts": { "total": 1, "hash": "4289823D5E0104E13D4D5D72A84BF412914C900B2AE14FC6F285F80287B5F0C4" } }, "block_size": "348", "header": { "version": { "block": "11" }, "chain_id": "tacchain_2390-1", "height": "1", "time": "2024-11-08T12:01:27.393983011Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "307B2281CBDCC5D12F69345E9DA7B262C984BFFDD3EE85D7C732654EECB94B9D", "next_validators_hash": "307B2281CBDCC5D12F69345E9DA7B262C984BFFDD3EE85D7C732654EECB94B9D", "consensus_hash": "16DBFD0AAA36E214D4E55A6EAADF68E9802DD4845DBD49EB58DAA89F885D1FC0", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "A0E2E65C71DE9D8A59D182933122934A1FA23837" }, "num_txs": "0" } ] } } ``` #### Tendermint REST ```shell curl https://rpc.ankr.com/http/tac_turin_tendermint/blockchain?minHeight=1&maxHeight=2 ``` ```json { "jsonrpc": "2.0", "id": -1, "result": { "last_height": "2564234", "block_metas": [ { "block_id": { "hash": "ED3BF22DDEAABE5B194ECE00FC97B73B31D6B6E381946054ADF248FADA65FD4F", "parts": { "total": 1, "hash": "268422F8D294840DBC5B24FB031F976357E8478F72C16B66E7B7388C2429D18F" } }, "block_size": "830", "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "2", "time": "2024-06-24T07:25:41.380275895Z", "last_block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "last_commit_hash": "5148301A7ABA311392D676C3C967F299F85A1AD48D74E96AF083DA4787FF9C2D", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "21181DF7C886CEE14012C07031E55BF04428BF77979015F2869ED1EACABAD22E", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "CDFF531A3AFA255BC193D52721027366935F9BF8" }, "num_txs": "0" }, { "block_id": { "hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89", "parts": { "total": 1, "hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA" } }, "block_size": "353", "header": { "version": { "block": "11" }, "chain_id": "zgtendermint_16600-2", "height": "1", "time": "2024-06-24T07:24:31.526533772Z", "last_block_id": { "hash": "", "parts": { "total": 0, "hash": "" } }, "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1", "consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453", "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", "proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD" }, "num_txs": "0" } ] } } ``` #### Cosmos REST ```shell curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/auth/v1beta1/params ``` ```json { "params": { "max_memo_characters": "256", "tx_sig_limit": "7", "tx_size_cost_per_byte": "10", "sig_verify_cost_ed25519": "590", "sig_verify_cost_secp256k1": "1000" } } ``` --- ## Taiko
> Taiko API is available on [Web3 API platform](https://www.ankr.com/rpc/taiko). Taiko is as a fully open source, permissionless, Ethereum-equivalent ZK-Rollup. Using Taiko feels the exact same as using Ethereum. There are no centralized actors that operate the network; all operations are permissionlessly run by the community. Official quick links: [Website](https://taiko.xyz/), [Docs](https://docs.taiko.xyz/start-here/getting-started), [GitHub](https://github.com/taikoxyz) ### Networks * Hekla Testnet (`HTTPS` and `WSS`) ### API methods For Taiko, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/taiko/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/taiko_hekla \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/taiko_hekla" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/taiko_hekla' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/taiko_hekla' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x28244" } ``` --- ## Telos
> Telos API is available on [Web3 API platform](https://www.ankr.com/rpc/telos). *Telos* EVM integrates the Telos blockchain's high performance with Ethereum's development environment. It offers fast transactions, low fees, and full compatibility with Ethereum tools and smart contracts. Key features include: * **High Performance**: Thousands of transactions per second with low latency. * **Low Fees**: Significantly cheaper transactions than Ethereum. * **Compatibility**: Supports Ethereum smart contracts and development tools like Solidity and Metamask. * **Governance**: Robust governance model allowing token holder participation. * **Frontrunning Protection**: Built-in mechanisms to prevent frontrunning, ensuring fairer transaction execution. * **Arbitration**: Dispute resolution mechanism to handle conflicts, enhancing trust and security. Official quick links: [Website](https://www.telos.net/), [Docs](https://docs.telos.net/), [GitHub](https://github.com/telosnetwork) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Telos, we support blockchain interaction via the [applicable methods](/rpc-service/chains/chains-api/telos/). #### Unsupported :::warning For Telos, on _Premium_ service plan, we don't support any other methods except for those referenced in API methods. ::: :::tip If you require any methods other than those in the API methods section, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/telos \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/telos" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/telos' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/telos' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1461d7b4" } ``` --- ## Tenet
> Tenet API is available on [Web3 API platform](https://www.ankr.com/rpc/tenet). Tenet is an EVM-compatible Layer-1 bringing liquidity and yield opportunities to LSDs by using them as collateral for network validators through [Diversified Proof of Stake](https://docs.tenet.org/diversified-pos/diversified-proof-of-stake-implementation). This increases network security and improves governance inclusivity. Official quick links: [Website](https://tenet.org/), [Docs](https://docs.tenet.org/tenet/general), [GitHub](https://github.com/tenet-org) ### Networks * Mainnet Beta (`HTTPS` and `WSS`) ### API methods For Tenet, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/tenet/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/tenet_evm \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/tenet_evm" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/tenet_evm' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/tenet_evm' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x9207af" } ``` --- ## TON
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > TON API is available on [Web3 API platform](https://www.ankr.com/rpc/ton). The Open Network (TON) is a decentralized and open internet platform made up of several components. These include: TON Blockchain, TON DNS, TON Storage, and TON Sites. TON Blockchain is the core protocol that connects TON’s underlying infrastructure together to form the greater TON Ecosystem. TON is focused on achieving widespread cross-chain interoperability, while operating in a highly scalable secure framework. TON is designed to process millions of transactions per second (TPS), with the goal of eventually reaching hundreds of millions of users moving forward. Official quick links: [Website](https://ton.org/), [Docs](https://docs.ton.org/), [GitHub](https://github.com/ton-blockchain) ### Networks * Mainnet * REST API (`HTTPS`) * JSON-RPC API (`HTTPS` and `WSS`) ### API methods For TON, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/ton/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: None. ### API querying #### Request example ```shell curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/{your_token}/getConsensusBlock ``` ```shell curl --location 'https://rpc.ankr.com/ton_api_v2/{your_token}' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "getConsensusBlock", "params": {}, "id": "1" }' ``` #### Response example ```json { "ok": true, "result": { "consensus_block": 41808671, "timestamp": 1731070487.261679 } } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/s-t-p4/ title: Supported Chains: S-T (4/4) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains S-T — Scroll, Secret Network, Sei, Solana, and more. source: docs/rpc-service/chains/chains-list/s-t-p4.mdx --- Supported chains **S-T** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 4 of 4: [1](/rpc-service/chains/chains-list/s-t/) · [2](/rpc-service/chains/chains-list/s-t-p2/) · [3](/rpc-service/chains/chains-list/s-t-p3/) · 4 ## TRON
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > TRON API is available on [Web3 API platform](https://www.ankr.com/rpc/tron). TRON is an open source public blockchain platform that supports smart contracts. TRON is compatible with Ethereum, which means that you can migrate smart contracts on Ethereum to TRON directly or with minor modifications. TRON relies on a unique consensus mechanism to realize the high TPS of the TRON network that is far beyond Ethereum, bringing developers a good experience of a faster transaction. Official quick links: [Website](https://tron.network/), [Docs](https://developers.tron.network/), [GitHub](https://github.com/tronprotocol) ### Networks * Mainnet * REST API (`HTTPS`) * JSON-RPC API (`HTTPS`) ### API methods For TRON, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/tron/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `/wallet/easytransferbyprivate`, `/wallet/easytransferassetbyprivate`, `/wallet/easytransfer`, `/wallet/easytransferasset`, `/wallet/gettransactionsign`, And all the methods with the following segments in their path: `easytransferbyprivate`, `easytransferassetbyprivate`, `easytransfer`, `easytransferasset`, `gettransactionsign`, `createaddress`, `listnodes`, `generateaddress`, `getnodeinfo`, `addtransactionsign`, `getakfromask`, `getnkfromnsk`, `getspendingkey`, `getexpandedspendingkey`, `getdiversifier`, `getincomingviewingkey`, `createspendauthsig`, `getnewshieldedaddress`, `createshieldedtransaction`, `createshieldedcontractparameters`, `createshieldedcontractparameterswithoutask`, `scanshieldedtrc20notesbyivk`, `scanshieldedtrc20notesbyovk`, `isshieldedtrc20contractnotespent` ### API querying #### Request example (JSON-RPC) ```shell curl -X POST https://rpc.ankr.com/tron_jsonrpc/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` #### Response example (JSON-RPC) ```json { "jsonrpc": "2.0", "id": 1, "result": "0x30dc665" } ``` #### Request example (REST) ```shell curl -X GET 'https://rpc.ankr.com/premium-http/tron/{your_token}/walletsolidity/getnowblock' ``` #### Response example (REST) ```json { "blockID": "0000000002fa7ad50ad1632efffc6f8376488681897834ac17bdf137e961b5f3", "block_header": { "raw_data": { "number": 49969877, "txTrieRoot": "9fb478348a2f48bd15eb5cff7d6b6a3845e7014a444125981e41c761c05c8898", "witness_address": "411761716b76c6a3d885299c366826046c09b08d26", "parentHash": "0000000002fa7ad442c90c1be8ab67467e1940017258cb28496bcafe7bcb1bbd", "version": 27, "timestamp": 1680522399000 }, "witness_signature": "50243f8d127f417f407e1df845c77bdf600d33d155cbcebe82b6b6903b8e74492c1bfabbf7be683ff0a20f9ce22565f9e6fe05c4202bb950e0390d4bbc38f7f301" }, "transactions": [ { "ret": [ { "contractRet": "SUCCESS" } ], "signature": [ "8939604c6e12c894a5c45abca9337121f172281522227b51a78ddeaf3105c6a959378ef0d7541473ae15b28ee6c744525552577cac04d4ec0a48925e69a2f1ca00" ], "txID": "e8a35f80078d8e7f562d7b19c91102388d400029f9454d90d4b638bf6094621e", "raw_data": { "contract": [ { "parameter": { "value": { "data": "a9059cbb000000000000000000000000149e4be8e140208f5640814249406404f475fb1700000000000000000000000000000000000000000000000000000000097a25c0", "owner_address": "41cebabc6a66da33d2135f11207d6ab88b82829813", "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c" }, "type_url": "type.googleapis.com/protocol.TriggerSmartContract" }, "type": "TriggerSmartContract" } ], "ref_block_bytes": "7ac2", "ref_block_hash": "182e27a1484a4f66", "expiration": 1680533174894, "fee_limit": 30000000, "timestamp": 1680522374779 }, "raw_data_hex": "0a027ac22208182e27a1484a4f6640eef4d4bcf4305aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541cebabc6a66da33d2135f11207d6ab88b82829813121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb000000000000000000000000149e4be8e140208f5640814249406404f475fb1700000000000000000000000000000000000000000000000000000000097a25c070fbdcc1b7f43090018087a70e" } ] } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/s-t/ title: Supported Chains: S-T (1/4) description: Ankr RPC networks, endpoints, methods, and code examples for supported chains S-T — Scroll, Secret Network, Sei, Solana, and more. source: docs/rpc-service/chains/chains-list/s-t.mdx --- Supported chains **S-T** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. > Part 1 of 4: 1 · [2](/rpc-service/chains/chains-list/s-t-p2/) · [3](/rpc-service/chains/chains-list/s-t-p3/) · [4](/rpc-service/chains/chains-list/s-t-p4/) ## Scroll
> Scroll API is available on [Web3 API platform](https://www.ankr.com/rpc/scroll). Scroll is a zkEVM-based zkRollup on Ethereum that enables native compatibility for existing Ethereum applications and tools. Official quick links: [Website](https://scroll.io/), [Docs](https://guide.scroll.io/), [GitHub](https://github.com/scroll-tech) ### Networks * Mainnet (`HTTPS` and `WSS`) * Sepolia Testnet (`HTTPS` and `WSS`) The Alpha Testnet consists of Ethereum's Goerli Testnet and the Scroll Alpha test network. Goerli is an Ethereum test network with PoS-based consensus, while Scroll Alpha is a zero-knowledge rollup testnet deployed on top of the former. ### API methods For Scroll, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/scroll/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/scroll \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/scroll" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/scroll' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/scroll' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x1965e" } ``` --- ## Secret Network
> Secret Network API is available on [Web3 API platform](https://www.ankr.com/rpc/scrt). Secret Network is the first blockchain with customizable privacy. You get to choose what you share, who you share with, and how long you share it for. This protects users and empowers developers to build a better Web3. Official quick links: [Website](https://scrt.network/), [Docs](https://docs.scrt.network/secret-network-documentation/), [GitHub](https://github.com/scrtlabs/SecretNetwork) ### Networks * Mainnet: * Tendermint RPC API (`HTTPS` and `WSS`) * Tendermint REST API (`HTTPS`) * Cosmos REST API (`HTTPS`) ### API methods For Secret Network, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/secret-network) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **Tendermint (both for REST and JSON-RPC)**: `/health`, `/genesis`, `/broadcast_evidence`, `/dial_seeds`, `/dial_peers`, **Cosmos**: `/cosmos/auth/v1beta1/address_by_id/{id}`, `/cosmos/auth/v1beta1/module_accounts`, `/cosmos/auth/v1beta1/bech32`, `/cosmos/auth/v1beta1/bech32/{address_bytes}`, `/cosmos/auth/v1beta1/bech32/{address_string}`, `/cosmos/bank/v1beta1/supply/{denom}`, `/cosmos/bank/v1beta1/denom_owners/{denom}`, `/cosmos/bank/v1beta1/send_enabled`, `/cosmos/base/reflection/v1beta1/interfaces`, `/cosmos/base/reflection/v1beta1/interfaces/:interface_name/implementations`, `/cosmos/base/reflection/v1beta1/app_descriptor/authn`, `/cosmos/base/reflection/v1beta1/app_descriptor/chain`, `/cosmos/base/reflection/v1beta1/app_descriptor/codec`, `/cosmos/base/reflection/v1beta1/app_descriptor/configuration`, `/cosmos/base/reflection/v1beta1/app_descriptor/query_services`, `/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor`, `/cosmos/base/tendermint/v1beta1/abci_query`, `/cosmos/feegrant/v1beta1/issued/{granter}`, `/cosmos/gov/v1/proposals/{proposal_id}`, `/cosmos/gov/v1/proposals`, `/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}`, `/cosmos/gov/v1/proposals/{proposal_id}/votes`, `/cosmos/gov/v1/params/{params_type}`, `/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}`, `/cosmos/gov/v1/proposals/{proposal_id}/deposits`, `/cosmos/gov/v1/proposals/{proposal_id}/tally`, `/cosmos/group/v1/group_info/{group_id}`, `/cosmos/group/v1/group_policy_info/{address}`, `/cosmos/group/v1/group_members/{group_id}`, `/cosmos/group/v1/groups_by_admin/{admin}`, `/cosmos/group/v1/group_policies_by_group/{group_id}`, `/cosmos/group/v1/group_policies_by_admin/{admin}`, `/cosmos/group/v1/proposal/{proposal_id}`, `/cosmos/group/v1/proposals_by_group_policy/{address}`, `/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}`, `/cosmos/group/v1/votes_by_proposal/{proposal_id}`, `/cosmos/group/v1/votes_by_voter/{voter}`, `/cosmos/group/v1/groups_by_member/{address}`, `/cosmos/group/v1/proposals/{proposal_id}/tally`, `/cosmos/nft/v1beta1/balance/{owner}/{class_id}`, `/cosmos/nft/v1beta1/owner/{class_id}/{id}`, `/cosmos/nft/v1beta1/supply/{class_id}`, `/cosmos/nft/v1beta1/nfts`, `/cosmos/nft/v1beta1/nfts/{class_id}/{id}`, `/cosmos/nft/v1beta1/classes/{class_id}`, `/cosmos/nft/v1beta1/classes`, `/cosmos/params/v1beta1/subspaces`, `/cosmos/upgrade/v1beta1/module_versions`, `/cosmos/upgrade/v1beta1/authority`, `/cosmos/base/tendermint/v1beta1/node_info`, `/cosmos/base/tendermint/v1beta1/syncing`, `/cosmos/params/v1beta1/params`, `/syncing`, `/blocks/latest`, `/blocks/{height}`, `/validatorsets/latest`, `/validatorsets/{height}`, `/wasm/code`, `/wasm/code/{codeID}`, `/wasm/code/{codeID}/contracts`, `/wasm/contract/{contractAddress}`, `/wasm/contract/{contractAddress}/code-hash`, `/wasm/contract/{contractAddress}/query/{query}`, `/wasm/code/{codeID}/hash`, `/reg/consensus-io-exch-pubkey` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/scrt \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/http/scrt/block?height=1 ``` ```shell curl https://rpc.ankr.com/http/scrt_cosmos/cosmos/base/tendermint/v1beta1/blocks/{height} ``` #### Response example ```json { "id": 0, "jsonrpc": "2.0", "result": { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } } ``` --- ## Sei
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Sei API is available on [Web3 API platform](https://www.ankr.com/rpc/sei). Sei is a general purpose, open-source Layer 1 blockchain specialized for the exchange of digital assets. Sei has only one value prop: exchange apps — whether it’s an NFT marketplace or gaming economy — Sei offers the best user experience to build upon. Official quick links: [Website](https://www.sei.io/), [Docs](https://docs.sei.io/), [GitHub](https://github.com/sei-protocol/sei-chain) ### Networks * Mainnet: * EVM JSON-RPC (`HTTPS` and `WSS`) * Tendermint JSON-RPC (`HTTPS` and `WSS`) * Tendermint REST (`HTTPS`) * Cosmos REST (`HTTPS`) * Cosmos gRPC (`HTTPS`) ### API methods For Sei, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/sei) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **EVM JSON-RPC**: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` **Tendermint (both for REST and JSON-RPC)**: `/health`, `/genesis`, `/broadcast_evidence`, `/dial_seeds`, `/dial_peers`, `/remove_tx` ### API querying #### Request example (EVM) ```shell curl -X POST https://rpc.ankr.com/sei_evm/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` #### Response example (EVM) ```json { "jsonrpc": "2.0", "id": 1, "result": "0x4190ab00" } ``` #### Request example (Tendermint/Cosmos) ```shell curl -X POST https://rpc.ankr.com/sei/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "block", "params": ["1"], "id": 1 }' ``` ```shell curl https://rpc.ankr.com/premium-http/sei/{your_token}/block?height=1 ``` ```shell curl https://rpc.ankr.com/premium-http/sei_cosmos/{your_token}/cosmos/base/tendermint/v1beta1/blocks/{height} ``` #### Response example (Tendermint/Cosmos) ```json { "id": 0, "jsonrpc": "2.0", "result": { "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "block": { "header": { "version": { "block": "10", "app": "0" }, "chain_id": "cosmoshub-2", "height": "12", "time": "2019-04-22T17:01:51.701356223Z", "last_block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "last_commit_hash": "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812", "data_hash": "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73", "validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "next_validators_hash": "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0", "consensus_hash": "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8", "app_hash": "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C", "last_results_hash": "", "evidence_hash": "", "proposer_address": "D540AB022088612AC74B287D076DBFBC4A377A2E" }, "data": [ "yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0=" ], "evidence": [ { "type": "string", "height": 0, "time": 0, "total_voting_power": 0, "validator": { "pub_key": { "type": "tendermint/PubKeyEd25519", "value": "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4=" }, "voting_power": 0, "address": "string" } } ], "last_commit": { "height": 0, "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "signatures": [ { "type": 2, "height": "1262085", "round": 0, "block_id": { "hash": "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7", "parts": { "total": 1, "hash": "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD" } }, "timestamp": "2019-08-01T11:39:38.867269833Z", "validator_address": "000001E443FD237E4B616E2FA69DF4EE3D49A94F", "validator_index": 0, "signature": "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg==" } ] } } } } ``` --- ## Solana
:::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Solana API is available on [Web3 API platform](https://www.ankr.com/rpc/solana). Solana is a decentralized blockchain built to enable scalable, user-friendly apps for the world. Official quick links: [Website](https://solana.com/), [Docs](https://docs.solana.com/), [GitHub](https://github.com/solana-labs) ### Networks * Mainnet (`HTTPS` and `WSS`) * Devnet (`HTTPS` and `WSS`) ### API methods For Solana, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/solana) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: `getLargestAccounts` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/solana_devnet/{your_token} \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "getAccountInfo", "params": [ "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg", { "encoding": "base58" } ], "id": 1 }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "context": { "apiVersion": "2.2.3", "slot": 374628996 }, "value": { "data": [ "", "base58" ], "executable": false, "lamports": 88860054690252, "owner": "11111111111111111111111111111111", "rentEpoch": 18446744073709551615, "space": 0 } } } ``` --- ## Somnia
> Somnia API is available on [Web3 API platform](https://www.ankr.com/rpc/somnia). Somnia is a high-performance, cost-efficient EVM-compatible Layer 1 blockchain capable of processing over 1,000,000 transactions per second (TPS) with sub-second finality. It is suitable for serving millions of users and building real-time mass-consumer applications like games, social applications, metaverses, and more, all fully on-chain. Key Features: * **[Accelerated Sequential Execution](https://codex.somnia.network/somnia-blockchain/accelerated-sequential-execution)**: through compiled EVM bytecode. * **[IceDB](https://codex.somnia.network/somnia-blockchain/somnias-icedb)**: a faster, more predictable database for storing blockchain state. * **[MultiStream consensus](https://codex.somnia.network/somnia-blockchain/multistream-consensus)**: a Proof-of-Stake, partially synchronous BFT protocol inspired by [Autobahn BFT](https://arxiv.org/pdf/2401.10369). * **[Advanced compression techniques](https://codex.somnia.network/somnia-blockchain/advanced-compression-techniques)**: to deal with increased node-to-node data traffic due to the throughput. Official quick links: [Website](https://somnia.network/), [Docs](https://codex.somnia.network//) ### Networks * Testnet (`HTTPS` and `WSS`) ### API methods For Somnia, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/somnia) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/somnia_testnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/somnia_testnet" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/somnia_testnet' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/somnia_testnet' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x6d1d8b" } ``` --- ## Sonic
> Sonic API is available on [Web3 API platform](https://www.ankr.com/rpc/sonic). Sonic is an EVM-compatible Layer 1 blockchain designed to deliver high-speed, low-latency transactions, aiming to process over 10,000 transactions per second with sub-second finality. Key Features of Sonic: * **High Throughput and Speed**: Sonic achieves transaction finality in approximately 720 milliseconds, positioning it among the fastest EVM-compatible blockchains. * **Developer Incentives**: The platform offers attractive incentives, including a fee monetization program that allows developers to earn up to 90% of the fees generated by their applications. * **EVM Compatibility**: Sonic's compatibility with the Ethereum Virtual Machine enables seamless deployment of existing Ethereum-based decentralized applications (dApps) without significant modifications. * **Secure Ethereum Gateway**: Sonic provides a secure bridge to Ethereum, facilitating easy access to Ethereum's liquidity and assets while maintaining high transaction speeds and low costs. Official quick links: [Website](https://www.soniclabs.com/), [Docs](https://docs.soniclabs.com/), [GitHub](https://github.com/Fantom-Foundationf) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Sonic, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/sonic) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/sonic_mainnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/sonic_mainnet" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/sonic_mainnet' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/sonic_mainnet' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x51008" } ``` --- --- url: https://www.ankr.com/docs/rpc-service/chains/chains-list/x-z/ title: Supported Chains: X-Z description: Ankr RPC networks, endpoints, methods, and code examples for supported chains X-Z — X Layer, Xai, XDC Network, Xphere, and more. source: docs/rpc-service/chains/chains-list/x-z.mdx --- Supported chains **X-Z** on the [Web3 API platform](https://www.ankr.com/rpc/). See the [full chain list](/rpc-service/chains/chains-list/) for every network. ## X Layer > X Layer API is available on [Web3 API platform](https://www.ankr.com/rpc/xlayer/). X Layer is a decentralized Ethereum Layer 2 network that offers a secure and user-friendly blockchain experience to all users, using advanced cryptographic zero-knowledge proofs to provide validity and near-instant finality to off-chain transaction computations. **Benefits**: * **Lower fees**: X Layer does not consume expensive gas (i.e., DA to store transaction data off-chain). * **ZKP-powered scalability**: X1 is not bounded by the amount of transaction data that can be published to Ethereum with ZK-validity proofs. * **Ethereum security**: X Layer natively inherits the security of Ethereum, securing user funds from malicious operators. * **Unified liquidity**: X Layer ensures fluid asset transfers across different CDK-developed chains within Polygon 2.0's L2 ecosystem, building a vibrant, efficient, and interconnected digital economy. * **Near-instant finality**: X Layer utilizes cryptographic security to ensure the integrity of transactions, achieving near-instant finality and robust security. * **Powered by OKX**: X Layer provides seamless OKX product integrations, an all-in-one Web3 gateway, and access to 50M users in the OKX ecosystem. * **Portal to Web3**: Enter the world of Web3 via OKX Wallet, built with compact infrastructure modules to create innovative DApps. Official quick links: [Website](https://www.okx.com/xlayer), [Docs](https://www.okx.com/xlayer/docs/getting-started/welcome/welcome-to-xlayer) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For X Layer, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/xlayer/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/xlayer \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/xlayer" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/xlayer' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/xlayer' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc":"2.0", "id":1, "result":"0x148b7" } ``` --- ## Xai
> Xai API is available on [Web3 API platform](https://www.ankr.com/rpc/xai). The *Xai* Blockchain, developed by Offchain Labs and overseen by the Xai Foundation, was custom-developed to address the needs of web3 gaming at scale. Tailored specifically for gaming, this blockchain offers traditional gamers an abstracted wallet and account experience, provides developers with increased gas and contract limits, and establishes a fully decentralized ecosystem that fosters trust and transparency for all participants. By leveraging Ethereum's robust security measures, the Xai Blockchain cements its resilience against potential hacks and other vulnerabilities. Xai operates as an Arbitrum Orbit chain, harnessing Anytrust technology to achieve maximum speed and minimal costs. Unlike most Orbit chains that are "self-managed," Xai benefits from direct technical support courtesy of Offchain Labs. This support is not available to other orbit chains and is a crucial component of Xai as a strategic gaming initiative within the Arbitrum ecosystem. Official quick links: [Website](https://xai.games/), [Docs](https://xai-foundation.gitbook.io/xai-network), [GitHub](https://github.com/xai-foundation) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Xai, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/xai/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/xai \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/xai" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/xai' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/xai' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x5f2039" } ``` --- ## XDC Network
> XDC Network API is available on [Web3 API platform](https://www.ankr.com/rpc/xdc). The XDC Network is a global, open-source, delegated proof of stake consensus network (XDPoS), with near-zero gas fees, 2 second block finality, and interoperability with ISO 20022 financial messaging standards. The network’s enterprise-grade architecture is designed to support institutional use in trade finance and asset tokenization. Featuring interoperable smart contracts, 2,000 transactions per second, and Ethereum Virtual Machine compatibility, the XDC Network provides a scalable infrastructure for enterprises and independent community contributors. Official quick links: [Website](https://xdc.org/), [Docs](https://docs.xdc.community/), [GitHub](https://github.com/XDC-Community) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For XDC Network, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/xdc/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/xdc \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/xdc" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/xdc' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/xdc' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x3f76cd6" } ``` --- ## Xphere
> Xphere Era API is available on [Web3 API platform](https://www.ankr.com/rpc/xphere). Xphere is an EVM-compatible Layer-1 with a dual-chain architecture that separates consensus and heavy computation for scalability and security. A PBFT-based Main Chain finalizes transactions via a Council/Committee model to cut communication overhead, while a Proof Chain uses SHA-256 Proof-of-Work to select validators and generate cryptographic proofs. The design preserves decentralization, boosts throughput, and stays developer-friendly with Ethereum tooling. Official quick links: [Website](https://x-phere.com/), [Docs](https://docs.x-phere.com/), [GitHub](https://github.com/xpherechain) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For Xphere, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/xphere/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/xphere_mainnet \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` ```go package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" ) func main() { const url = "https://rpc.ankr.com/xphere_mainnet" // url string rpcClient,err := ethclient.Dial(url) if err != nil { panic(err) } blockNumber, err := rpcClient.BlockNumber(context.Background()) if err != nil { panic(err) } fmt.Println(blockNumber) } ``` ```js const Web3 = require('web3'); const url = 'https://rpc.ankr.com/xphere_mainnet' // url string const web3 = new Web3(new Web3.providers.HttpProvider(url)); web3.eth.getBlockNumber((error, blockNumber) => { if(!error) { console.log(blockNumber); } else { console.log(error); } }); ``` ```python from web3 import Web3 def test_block_number(self): url = 'https://rpc.ankr.com/xphere_mainnet' # url string web3 = Web3(HTTPProvider(url)) print(web3.eth.block_number) ``` #### Response example ```json { "jsonrpc": "2.0", "id": 1, "result": "0x13460bc" } ``` --- ## XRP
:::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: > XRP API is available on [Web3 API platform](https://www.ankr.com/rpc/xrp). The XRP Ledger (XRPL) is a decentralized blockchain optimized for fast, low-cost payments and asset transfers. It uses a federated consensus algorithm in which a trusted set of validators propose and agree on transactions; once 80%+ reach consensus, a new ledger is finalized in 3–5 seconds with deterministic finality. XRPL supports native issued assets, a built-in DEX, escrows, payment channels, and multi-signing. **XRPL Ecosystem Overview** * **Core Servers**: The network is powered by rippled, the open-source server responsible for ledger synchronization, transaction processing, and consensus. Clio servers provide scalable, API-focused access without participating in the P2P consensus network. * **Client Libraries**: SDKs streamline integration by wrapping XRPL APIs and performing secure local transaction signing. * **Middleware**: Services built on XRPL APIs provide indexed data, higher-level abstractions, or custom interfaces, typically running continuously with their own storage layers. * **Apps and Services**: Wallets, exchanges, token issuers, marketplaces, payment processors, and DEX interfaces form the user-facing layer, enabling transfers, trading, and broader financial use cases. ### Networks * Mainnet (`HTTPS` and `WSS`) ### API methods For XRP, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/xrp/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: None. ### API querying #### Request example ```shell curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "account_channels", "params": [ { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "ledger_index": "validated" } ] }' ``` #### Response example ```json { "id": 1, "jsonrpc": "2.0", "result": { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "channels": [ { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "amount": "1000", "balance": "0", "channel_id": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7", "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", "public_key": "aBR7mdD75Ycs8DRhMgQ4EMUEmBArF8SEh1hfjrT2V9DQTLNbJVqw", "public_key_hex": "03CFD18E689434F032A4E84C63E2A3A6472D684EAF4FD52CA67742F3E24BAE81B2", "settle_delay": 60 } ], "ledger_hash": "42C4F4E81710B015B3BA2A81E357E30E261F58964A6AB6C012734FADB67AB40D", "ledger_index": 99672209, "status": "success", "validated": true } } ``` --- ## zkSync Era
:::warning The zkSync Era node is still in alpha and subject to further updates. Users may experience downtime. If you notice discrepancies from the [main node API](https://era.zksync.io/docs/dev/building-on-zksync/interacting.html#quickstart-on-zksync), please report directly to [Matter Labs](https://zksync.io/contact). ::: > zkSync Era API is available on [Web3 API platform](https://www.ankr.com/rpc/zksync_era). zkSync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on security or decentralization. Since it's EVM compatible (Solidity/Vyper), 99% of Ethereum projects can redeploy without refactoring or re-auditing a single line of code. zkSync Era also uses an LLVM-based compiler that will eventually let developers write smart contracts in C++, Rust, and other popular languages. Official quick links: [Website](https://zksync.io/), [Docs](https://era.zksync.io/docs/), [GitHub](https://github.com/matter-labs/) ### Networks * Mainnet (`HTTPS` and `WSS`) * Testnet (`HTTPS` and `WSS`) ### API methods For zkSync Era, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/zksync-era/) except for those listed as unsupported. #### Unsupported :::warning This section contains a list of methods we don't support for _Premium_ service plan. ::: :::tip If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. ::: **HTTPS**: `eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, `debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), `personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` **WSS**: `txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` ### API querying #### Request example ```shell curl -X POST https://rpc.ankr.com/zksync_era \ -H 'Content-Type: application/json' \ -d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' ``` #### Response example ```json { "jsonrpc": "2.0", "result": "0x5ac192", "id": 1 } ``` --- url: https://www.ankr.com/docs/rpc-service/charging-policy/ title: Charging policy & account balance description: How Ankr bills API credits, what happens when your Premium balance runs out, the −$5 overdraft allowance, balance notifications, and Enterprise overage handling. source: docs/rpc-service/charging-policy.mdx --- # Charging policy & account balance This page covers the billing failure modes: what happens when you hit rate limits, run your balance down, or exceed committed volume. For per-method credit prices, see [Pricing](/rpc-service/pricing/); for what each plan includes, see [Service plans](/rpc-service/service-plans/). ## Freemium Freemium accounts get **200M API credits monthly** under Public rate limits, with no balance to manage. - Exceeding the rate limit returns **HTTP 429** (or JSON-RPC error `-32090`, `call rate limit exhausted`). - Rate limiting is temporary and self-restores — back off and retry. - Credits renew monthly; no overdraft and no charges. ## Premium (pay-as-you-go) Premium runs on a prepaid credit balance that you top up manually. - **There is no automatic top-up.** Your balance only increases when you top it up yourself. - **Overdraft allowance**: your balance may go negative down to **−$5**, and service continues uninterrupted in that range. This gives you a buffer to top up without dropping traffic. - **Below −$5 the account is suspended** shortly after crossing the threshold. While suspended, your API keys reject requests with authentication errors (`401`/`403`). - **Recovery is immediate**: top up your balance and the same endpoints and API keys resume working — no re-provisioning needed. :::tip Set up balance notifications In the [Ankr dashboard](https://www.ankr.com/rpc/) you can configure balance notifications with your own thresholds, so you get alerted before the balance reaches zero — not after requests start failing. ::: ## Enterprise Enterprise agreements include a committed monthly volume. - Usage above the committed volume is billed at the overage rates defined in your agreement. - Sustained overage typically triggers a re-pricing conversation with your account manager rather than surprise invoices. ## Related - [Pricing](/rpc-service/pricing/) — per-method credit costs. - [SLA & service reliability](/rpc-service/sla/) — uptime commitments per plan. --- url: https://www.ankr.com/docs/rpc-service/enterprise/ title: Enterprise description: How Ankr works with large customers — dedicated nodes in the regions you choose, a direct line to our engineers, custom rate and connection limits, heavy methods at scale, a 99.9% uptime SLA with a 10% service credit (99.99% negotiable), and SOC 2 Type II. Built around your workload. source: docs/rpc-service/enterprise.mdx --- # Enterprise Enterprise is for teams that need more than a shared endpoint — **dedicated capacity, custom limits, a direct line to our engineers, and a contractual SLA**, all shaped around your workload. Wherever the shared plans have a default, Enterprise is where we tailor it to you. ## Who it's for Exchanges, wallets, indexers, DeFi protocols, and infrastructure teams running **high, sustained throughput**, with strict **latency**, **reliability**, or **compliance** requirements — anyone for whom RPC is production-critical. ## Dedicated regional nodes We provision **dedicated nodes for your workload**, isolated from the shared pool, in the **[region(s)](/rpc-service/regions/) you choose**. This gives you: - **Predictable latency** — a pinned region close to your users or your own infrastructure. - **Isolation** — your traffic isn't sharing capacity with anyone else. - **Headroom for heavy work** — archive history and `trace_*`/`debug_*` at scale, large `eth_getLogs` ranges, and high steady request rates. - **Data-locality / jurisdiction** — capacity placed to meet geographic or regulatory needs. ## Custom limits & capabilities The shared-plan defaults (rate limits, connection counts, batch and block-range caps) are **raised or removed** to fit your traffic. Enterprise routinely includes: - Custom **request-rate** and **concurrent-connection** limits. - **Heavy methods** — `trace_*`, `debug_*`, and archive queries — provisioned for sustained use. - Higher **WebSocket** connection allowances. - Custom **batch** and **block-range** limits where your workload needs them. ## A direct line to our engineers Enterprise support isn't a ticket queue: - A **shared Slack or Telegram channel** with our engineering and node-operations teams. - **Priority response** and **named technical contacts** who know your setup. - **24/7** coverage for production-critical issues. - Help with **integration, migration, and solution design** — not just break/fix. ## Reliability & SLA - A **standard 99.9% uptime SLA with a 10% service credit** — with **99.99% available as negotiated upside** for qualifying deployments. See [SLA](/rpc-service/sla/) for the structure. - **[Multi-region](/rpc-service/regions/)** serving with automatic failover. ## Security & compliance - **SOC 2 Type II** — independently audited; report available under NDA. See [Trust & security](/trust/overview/). - Support for security reviews, questionnaires, and data-handling requirements. ## Flexible commercials - **Committed-volume** contracts sized to your usage, with **invoicing**. - Pay by **crypto or card**, with usage drawn down per the [Charging policy](/rpc-service/charging-policy/). ## Talk to us Tell us the chains, regions, throughput, and requirements you're planning for, and we'll scope a setup around them. **[Contact our team](https://www.ankr.com/rpc/)**, or reach out through your existing Ankr contact. ## FAQ ### Can I get nodes in a specific region or country? Yes — Enterprise runs dedicated nodes in the [region(s)](/rpc-service/regions/) you choose, including for data-residency or compliance needs. Tell us where you need to be. ### What support do Enterprise customers get? A shared Slack/Telegram channel with our engineering and node-ops teams, priority response, named contacts, and 24/7 coverage for production issues — plus hands-on help with integration and migration. ### What uptime can you commit to? A standard **99.9%** SLA with a **10% service credit**, backed by multi-region failover; **99.99% is available as negotiated upside** for qualifying deployments. See [SLA](/rpc-service/sla/) for how it's structured; exact terms are set in your contract. ### How is Enterprise billed? On a committed-volume contract with invoicing, payable by crypto or card. [Contact us](https://www.ankr.com/rpc/) to scope pricing for your workload. --- url: https://www.ankr.com/docs/rpc-service/errors/overview/ title: Error Reference description: Every error the Ankr RPC gateway can return — JSON-RPC code, HTTP status, what it means, and what to do. Covers authentication, access, rate limits, request size, and node-availability errors, plus the trace_id you can quote to support. source: docs/rpc-service/errors/overview.mdx --- # Error Reference When a request fails, the Ankr RPC gateway returns a standard **JSON-RPC error object** — a numeric `code`, a human-readable `message`, and a `data.trace_id` you can quote to support. HTTP requests also carry the matching **HTTP status code**. Codes in the `-320xx` range are returned by the Ankr gateway; errors from the blockchain node itself pass straight through to you. ## How errors are returned **JSON-RPC** (HTTP `POST`, batch, and WebSocket) — the response replaces `result` with an `error`: ```json { "jsonrpc": "2.0", "id": 1, "error": { "code": -32055, "message": "No nodes available", "data": { "trace_id": "4b1f...e9c2" } } } ``` **Plain HTTP** (request rejected before it reaches JSON-RPC handling — bad auth, rate limit, oversized body) — the gateway returns the HTTP status with a short text body: ``` message: API key not found, trace_id: 4b1f...e9c2 ``` :::tip Always keep the `trace_id` Every gateway error carries a `trace_id`. Include it when you contact support and we can look up the exact request — no need to reproduce it. ::: ## Client-side vs server-side Two kinds of error, and they need opposite responses: - **Client-side** (HTTP `4xx`) — something about the request, key, or plan needs to change. **Retrying as-is won't help** — fix the cause first. - **Server-side** (HTTP `5xx`) — a transient condition on our side or the upstream node. **Safe to retry** with backoff. See [Retry strategies](/rpc-service/errors/retry-strategies/). ## Standard JSON-RPC errors These follow the [JSON-RPC 2.0 spec](https://www.jsonrpc.org/specification#error_object). | Code | HTTP | Message | What it means / what to do | |---|---|---|---| | `-32700` | 400 | Parse error | The request body isn't valid JSON. Check serialization. | | `-32600` | 400 | Invalid Request | The JSON isn't a valid JSON-RPC request object. | | `-32601` | 404 | Method not found | The method doesn't exist or isn't enabled for this chain. Check the method name and the chain's [API reference](/rpc-service/chains/chains-list/). | | `-32602` | 400 | Invalid params | Wrong number or type of params — check the method signature. **Also returned when a `trace_*`/`debug_*` block range exceeds the per-API-key cap**: narrow the block range, or contact support to raise the cap. See [Per-chain & method quirks](/rpc-service/errors/per-chain-quirks/#block-range-limits-on-eth_getlogs-and-trace_). | | `-32603` | 500 | Internal error | Unexpected server-side error. Safe to retry. | ## Authentication & API-key errors Returned when the key is missing, unknown, or not entitled. All are **client-side** — fix the key or your plan in the [dashboard](https://www.ankr.com/rpc/) before retrying. | Code | HTTP | Message | What it means / what to do | |---|---|---|---| | `-32049` | 401 | API Key required | This endpoint needs a key. Use your Premium endpoint with the key in the path. | | `-32050` | 401 | API key not found | The key doesn't exist. Check for typos or a deleted key. | | `-32051` | 403 | API key disabled | The key was disabled in the dashboard. Re-enable it or use another. | | `-32060` | 403 | API key expired | The key's validity period has ended. | | `-32052` | 403 | API key is not allowed to access blockchain | This chain isn't enabled for the key. Add it in the project settings. | | `-32053` | 403 | API key is not allowed to access method | The method isn't permitted for this key. | | `-32054` | 403 | API key is not allowed to access from this IP | The request came from an IP outside the key's [IP allowlist](/rpc-service/getting-started/projects/). | | `-32079` | 403 | Origin not allowed | The request `Origin` isn't on the key's domain allowlist. | | `-32080` | 403 | Contract address not allowed | The call targets a contract outside the key's smart-contract allowlist. | ## Feature & availability restrictions The request is well-formed and authenticated, but the feature isn't available on this key, plan, or chain. **Client-side.** | Code | HTTP | Message | What it means / what to do | |---|---|---|---| | `-32074` | 403 | Blockchain disabled | This chain is temporarily disabled. | | `-32075` | 403 | Method disabled | This method is disabled on the gateway. | | `-32093` | 403 | Blockchain not supported | This chain isn't served. See [supported chains](/rpc-service/chains/chains-list/). | | `-32083` | 403 | Proxy is disabled | The endpoint is disabled. | | `-32078` | 403 | Streaming not supported | A streaming request hit a non-streaming endpoint. | | `-32082` | 403 | Event not supported | The WebSocket subscription event isn't supported here. | | `-32092` | 403 | WebSocket is disabled | WebSocket isn't enabled for this key. | ## Rate-limit & connection-limit errors You're sending more than your plan allows. **Client-side** — slow down, back off, or upgrade. See [Avoid rate limiting](/rpc-service/errors/retry-strategies/). | Code | HTTP | Message | What it means / what to do | |---|---|---|---| | `-32090` | 429 | Too many requests | Request-rate limit exceeded. Back off and retry. | | `-32067` | 429 | Max connections per blockchain reached | Too many concurrent connections to one chain. | | `-32068` | 429 | Max connections per api key reached | Too many concurrent connections on the key. | | `-32069` | 429 | Max connections per ip reached | Too many concurrent connections from one IP. | | `-32077` | 429 | Max connections per tenant reached | Account-wide connection cap reached. | | `-32070` | 429 | Max total connections reached | The gateway is at capacity. Retry with backoff. | ## Request-size errors The request exceeds a size or range limit. **Client-side** — split it up. | Code | HTTP | Message | What it means / what to do | |---|---|---|---| | `-32062` | 413 | Request is too large | The request body exceeds the limit. | | `-32062` | 413 | Block range is too large | An `eth_getLogs` range is too wide. Split into smaller block ranges. (A too-wide `trace_*`/`debug_*` range returns `-32602` instead — see above.) | | `-32062` | 413 | Batch size too large | Too many calls in one batch. Send fewer per batch. | | `-32081` | 413 | WS message is too large. Please use RPC instead | A WebSocket payload is too big — use HTTP RPC. | ## Node-availability & upstream errors Transient conditions reaching a healthy node. **Server-side (`5xx`) — safe to retry** with backoff. | Code | HTTP | Message | What it means / what to do | |---|---|---|---| | `-32055` | 503 | No nodes available | No healthy node could serve the request right now. Retry. | | `-32061` | 503 | No archive nodes available | An archive-only query (historical state, `trace_*`) found no archive node available. Retry. | | `-32057` | 503 | Node responded with non success status code | The upstream node returned an error status. Retry. | | `-32059` | 503 | Failed to dial node | The gateway couldn't connect to a node. Retry. | | `-32056` | 500 | Proxy error | A request couldn't be completed within the upstream deadline. Retry. | | `-32063` | 500 | Node returned unexpected error | An unexpected upstream error. Retry. | | `-32064` | 503 | Retry failed | The gateway retried across nodes and all attempts failed. Retry after a short pause. | | `-32071` | 504 | Request timeout error | The request exceeded the time limit. Retry; if it's a heavy call, narrow it. | | `-32076` | 500 | Invalid response | The node returned a malformed response. Retry. | | `-32065` | 500 | Decompress response error | The gateway couldn't decompress the node response. Retry. | ### WebSocket node availability No node currently supports the requested subscription. **Server-side — retry**, or fall back to HTTP polling. | Code | HTTP | Message | |---|---|---| | `-32085` | 503 | No alive WS nodes | | `-32086` | 503 | No alive WS nodes supporting newHeads | | `-32087` | 503 | No alive WS nodes supporting logs | | `-32088` | 503 | No alive WS nodes supporting newPendingTransactions | | `-32089` | 503 | No alive WS nodes supporting transactionReceipts | ## Internal & connection errors | Code | HTTP | Message | What it means / what to do | |---|---|---|---| | `-32072` | 500 | Failed to rebuild request | Internal error preparing the request. Retry. | | `-32073` | 500 | Failed to rebuild response | Internal error preparing the response. Retry. | | `-32084` | 500 | WS message IO error | A WebSocket read/write failed. Reconnect. | | `-32091` | 500 | Failed to hijack connection | Internal connection-upgrade error. Reconnect. | | `-32100` | 400 | Failed to write response | The response couldn't be written back. Retry. | | `-32099` | 499 | Client disconnected | The client closed the connection before the response was sent — usually a client-side timeout that's too short. | ## Errors from the blockchain node Codes **not in the `-320xx` gateway set listed above** come straight from the node and mean your request reached a node and was executed. Common examples: - `3` / `"execution reverted"` — the contract call reverted (a normal smart-contract outcome, not an Ankr error). - `-32000` — a node-level condition such as `"header not found"`, a block/state that's been pruned, or a block that doesn't exist yet (a future block number). For these, consult the node client's documentation for the chain. For history that's been pruned from a full node, use an archive-tier endpoint. ## FAQ ### What is the `trace_id` for? Every gateway error includes a `trace_id` in `error.data` (JSON-RPC) or the text body (HTTP). Quote it to support and we can find the exact request without you reproducing it. ### Which errors should I retry? Server-side errors (HTTP `5xx`: `-32055`, `-32056`, `-32057`, `-32059`, `-32061`, `-32063`, `-32064`, `-32071`, `-32076`, and the WS `-3208x` codes) are transient — retry with exponential backoff. Client-side errors (`4xx`: auth, access, rate-limit, size) need a fix first. See [Retry strategies](/rpc-service/errors/retry-strategies/). ### A code isn't in this list — what is it? The Ankr gateway returns codes in the `-320xx` range (all the codes listed on this page), plus the standard JSON-RPC codes (`-32700`, `-32600`, `-32601`, `-32602`, `-32603`). Anything else — including node-level `-32000` and the `3` `"execution reverted"` code — came from the blockchain node, not Ankr. See [Errors from the blockchain node](#errors-from-the-blockchain-node). ### I keep getting `429` (`-32090`). How do I fix it? You're over your plan's request rate. Add exponential backoff, batch where you can, or upgrade your plan. See [Retry strategies](/rpc-service/errors/retry-strategies/) and [Pricing](/rpc-service/pricing/). --- url: https://www.ankr.com/docs/rpc-service/errors/per-chain-quirks/ title: Per-Chain & Method Quirks description: Errors that depend on the chain or method rather than your code — archive vs full nodes, block-range limits on eth_getLogs and trace_*, subscription support, batch caps, and historical-data availability. source: docs/rpc-service/errors/per-chain-quirks.mdx --- # Per-Chain & Method Quirks Some errors aren't about a malformed request — they're about **what a given chain or method supports**. The same call can succeed on one chain and return an error on another. The patterns below are the common ones; codes are detailed in the [Error Reference](/rpc-service/errors/overview/). ## Archive vs full nodes Full nodes keep recent state and a limited history; **archive** nodes keep full historical state. Calls that read old state or replay execution need an archive node: - `trace_*`, `debug_trace*`, `eth_call`/`eth_getBalance`/`eth_getStorageAt` **at an old block**. - If no archive node is available, the gateway returns **`-32061` No archive nodes available** (retryable). - If a **full** node is asked for state it has pruned, the *node itself* answers with a node-level error (e.g. `-32000` `"missing trie node"` / `"header not found"`). That's expected — use an archive-tier endpoint for that history. ## Block-range limits on `eth_getLogs` and `trace_*` Wide ranges are capped to protect latency. A too-wide `eth_getLogs` range returns **`-32062` Block range is too large**; a too-wide `trace_*`/`debug_*` range hits the per-API-key block-range cap and returns **`-32602`** (contact support to raise the cap). Either way, split the range into smaller windows and page through them: ```js const STEP = 2_000n; // tune per chain for (let from = start; from <= end; from += STEP) { const to = from + STEP - 1n > end ? end : from + STEP - 1n; await getLogs({ fromBlock: hex(from), toBlock: hex(to), address, topics }); } ``` ## Method support varies by chain Not every method exists on every chain. Calling one that doesn't returns **`-32601` Method not found**, or **`-32075` Method disabled** if it's gated on the gateway. Check the chain's page under [Supported Chains](/rpc-service/chains/chains-list/) for the methods it serves — for example, `trace_*`/`debug_*` availability differs across EVM chains, and non-EVM chains (Solana, TON, Sui, TRON, Aptos, …) expose entirely different method sets. ## WebSocket subscriptions vary Subscription support is per-chain and per-node. If no node currently serves a subscription type you'll get a specific code — `-32086` (`newHeads`), `-32087` (`logs`), `-32088` (`newPendingTransactions`), `-32089` (`transactionReceipts`), or `-32085` (no alive WS nodes at all). These are transient: retry, or **fall back to HTTP polling** for that data. ## Batch size Large JSON-RPC batches are capped — too many sub-calls returns **`-32062` Batch size too large**. Send fewer calls per batch (and remember every sub-call in a batch is billed and rate-limited individually). ## Historical data on non-EVM chains Non-EVM chains keep history differently, and "missing" history surfaces as a **node-level** response (not a `-320xx` gateway error): - **Solana** — a full node serves a rolling ledger window; `getTransaction` / `getSignaturesForAddress` for older history returns `null`. Use an archive source or an explorer for data beyond the window. - Other chains have their own retention; when a node legitimately doesn't have the data, you get the node's own "not found"/`null` answer, not an Ankr error. For these, the request **did** reach a node — see [Errors from the blockchain node](/rpc-service/errors/overview/#errors-from-the-blockchain-node). ## FAQ ### Why does `trace_filter` / `debug_traceTransaction` work on one chain but not another? Trace and debug namespaces require an archive node and aren't enabled on every chain. You'll get `-32601`/`-32075` where they aren't served, or `-32061` if no archive node is momentarily available. Check the chain's API reference. ### My `eth_getLogs` call returns `-32062`. What's the fix? The block range is too wide. Split it into smaller windows (start around ~2,000 blocks and tune) and page through them. ### `getTransaction` returns `null` on Solana for an old signature — is that an error? No. Full nodes keep a limited ledger window; older transactions return `null`. Query an archive source or explorer for history beyond the window. --- url: https://www.ankr.com/docs/rpc-service/errors/retry-strategies/ title: Retry Strategies & Rate Limits description: How to handle transient RPC errors and rate limits — which codes are safe to retry, exponential backoff with jitter in JavaScript, Python, and Go, idempotency, and connection management. source: docs/rpc-service/errors/retry-strategies.mdx --- # Retry Strategies & Rate Limits Transient errors are normal in distributed infrastructure. A resilient client **retries the right errors with backoff** and **fixes — not retries — the rest**. This page shows which is which and how to back off. ## What to retry, what to fix | Retry with backoff (server-side, `5xx`) | Fix first — don't retry (client-side, `4xx`) | |---|---| | `-32055` No nodes available | `-32049/-32050/-32051/-32060` API-key problems | | `-32056` Proxy error | `-32052/-32053/-32054` key not allowed (chain/method/IP) | | `-32057` Node non-success status | `-32602` Invalid params | | `-32059` Failed to dial node | `-32601` Method not found | | `-32061` No archive nodes available | `-32062` Request / block range / batch too large | | `-32063` Node returned unexpected error | `-32079/-32080` origin / contract not allowed | | `-32064` Retry failed | | | `-32071` Request timeout | | | `-32076` Invalid response | | | `-32085`–`-32089` No alive WS nodes | | | `-32090` Too many requests **(429 — back off)** | | Rule of thumb: **HTTP `5xx` → retry; HTTP `4xx` → fix.** The one `4xx` you *do* retry is `429` (`-32090`) — but only with backoff, never in a tight loop. See the full list in the [Error Reference](/rpc-service/errors/overview/). ## Exponential backoff with jitter Back off exponentially and add **jitter** so many clients don't retry in lockstep. Cap the delay and the attempt count. **JavaScript** ```js const RETRYABLE = new Set([-32055, -32056, -32057, -32059, -32061, -32063, -32064, -32071, -32076, -32090]); async function rpc(url, body, { maxRetries = 5, baseMs = 200, capMs = 10_000 } = {}) { for (let attempt = 0; ; attempt++) { const res = await fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body), }); if (res.status === 429 || res.status >= 500) { if (attempt >= maxRetries) throw new Error(`giving up after ${attempt} retries (HTTP ${res.status})`); await sleepBackoff(attempt, baseMs, capMs); continue; } const json = await res.json(); if (json.error && RETRYABLE.has(json.error.code) && attempt < maxRetries) { await sleepBackoff(attempt, baseMs, capMs); continue; } return json; // success, or a non-retryable error to handle } } function sleepBackoff(attempt, baseMs, capMs) { const exp = Math.min(capMs, baseMs * 2 ** attempt); const delay = Math.random() * exp; // full jitter return new Promise((r) => setTimeout(r, delay)); } ``` **Python** ```python import random, time, requests RETRYABLE = {-32055, -32056, -32057, -32059, -32061, -32063, -32064, -32071, -32076, -32090} def rpc(url, body, max_retries=5, base=0.2, cap=10.0): for attempt in range(max_retries + 1): res = requests.post(url, json=body) if res.status_code == 429 or res.status_code >= 500: if attempt == max_retries: res.raise_for_status() time.sleep(random.uniform(0, min(cap, base * 2 ** attempt))) continue data = res.json() err = data.get("error") if err and err.get("code") in RETRYABLE and attempt < max_retries: time.sleep(random.uniform(0, min(cap, base * 2 ** attempt))) continue return data ``` **Go** ```go var retryable = map[int]bool{ -32055: true, -32056: true, -32057: true, -32059: true, -32061: true, -32063: true, -32064: true, -32071: true, -32076: true, -32090: true, } func backoff(attempt int) time.Duration { exp := math.Min(10_000, 200*math.Pow(2, float64(attempt))) // ms, capped at 10s return time.Duration(rand.Float64()*exp) * time.Millisecond // full jitter } ``` ## Honor `429` and `Retry-After` A `429` / `-32090` means you're over your plan's request rate. Don't hammer — back off, and if a `Retry-After` header is present, wait at least that long. Sustained `429`s mean it's time to batch requests or [upgrade your plan](/rpc-service/pricing/). ## Idempotency — what's safe to resend - **Reads** (`eth_call`, `eth_getLogs`, `eth_getBlockByNumber`, …) are idempotent — always safe to retry. - **`eth_sendRawTransaction`** is safe to resend: the transaction is already signed, so resending the same bytes yields the **same transaction hash** — it can't double-spend. Treat `"already known"` / `"nonce too low"` on a retry as success (the first attempt landed). - Always propagate a fresh request and keep the returned **`trace_id`** from any error for support. ## Connection management The connection-limit errors (`-32067`, `-32068`, `-32069`, `-32077`) mean too many *concurrent* connections, not too many requests. Reuse a connection pool / keep-alive instead of opening a socket per call, and for WebSockets reconnect with the same backoff after `-32084` (IO error) or a dropped subscription. ## FAQ ### How many times should I retry? Cap at ~5 attempts with exponential backoff (base ~200 ms, max delay ~10 s). Beyond that, surface the error with its `trace_id`. ### Is it safe to retry a transaction send? Yes. `eth_sendRawTransaction` carries a signed transaction with a fixed hash, so resending can't create a duplicate. Handle `"already known"`/`"nonce too low"` as confirmation the original was accepted. ### Why am I getting `429` even under my request limit? Check the connection-limit codes (`-32067`–`-32077`) — those cap *concurrent connections*, separately from request rate. Pool and reuse connections rather than opening one per call. --- url: https://www.ankr.com/docs/rpc-service/getting-started/analytics/ title: Usage Analytics description: Monitor your traffic with the Statistics overview and inspect every individual request from the last 7 days in the raw Requests tab — with filters for chain, method, error code, latency, country, and more. source: docs/rpc-service/getting-started/analytics.mdx --- # Usage Analytics :::tip Available for both [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: Ankr gives you two levels of visibility into your traffic: a high-level **Statistics** overview, and a per-request **Requests** view for raw, self-serve debugging. ## Statistics overview To open the **Statistics** pane, [sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform and click **Statistics** in **Navigation**. Here you can monitor: * **Total Requests** — the total number of requests. * **Top chain** — your most-queried chain. * **Requests health** — overall success-to-failure rate based on our node performance. * **Requests** — a diagram of requests over time. * **Requests overview** — requests broken down by one of: projects, chains, IPs, countries, or methods. * **Requests health breakdown** — a detailed success/failure distribution. * **Usage History** — chain requests by month. ## Requests (raw request telemetry) The **Requests** tab shows **every individual request** your account made over the **last 7 days**, in raw form — so you can answer "what exactly happened to this call?" yourself, without opening a support ticket. Open it from **Statistics > Requests**. :::note The Requests tab is available to paid accounts and populates once your account has request history. A brand-new account with no traffic will see an empty table. ::: ### Columns Each row is a single request. Columns include: | Column | What it shows | |---|---| | **Time** | When the request was received (UTC). | | **Trace ID** | Unique identifier for the request — use it to look up one specific call. | | **Status** | Outcome of the request (HTTP status combined with the first error, if any). | | **Chain** | The blockchain queried. | | **Method** | The RPC method(s) called. | | **Protocol** | `HTTP` or `WebSocket`. | | **Latency** | End-to-end response time in milliseconds. | | **Req / Resp** | Request and response sizes in bytes. | | **Calls** | Number of calls in the request (more than one for batch requests). | | **Country / City** | Approximate, general location the request came from. | | **IP** | The client network, anonymized (see [Privacy](#privacy)). | | **Origin / Referer / User-Agent** | Client metadata, where available. | ### Filters Narrow the table to exactly what you're investigating: * **Time range** — within the last 7 days. * **Project / API key** — one or more of your keys. * **Chain** — one or more blockchains. * **Protocol** — HTTP or WebSocket. * **Method** — specific RPC methods. * **Country** — origin country. * **Minimum latency** — show only requests slower than a threshold. * **Error code** — filter by a specific error code. * **Errors only** — show only failed requests. * **Batch** — only batch, only non-batch, or any. * **Trace ID** — jump straight to one request. * **Error message** — search by error text (partial match). ### Common workflows * **Why did my request fail?** Turn on **Errors only**, filter by **Chain**, and read the **Status** / **Error code** columns. * **Trace one specific call.** Paste its **Trace ID** into the filter. * **Find slow calls.** Set a **Minimum latency** (e.g. 1000 ms) and sort by **Latency**. * **See where traffic comes from.** Filter or group by **Country**. ### Privacy The Requests view is designed to be safe to expose: client **IP addresses are anonymized** to the network only (`/24` for IPv4, `/48` for IPv6), only **general location** (country/city) is shown, and internal infrastructure details (node names, endpoints, exact coordinates) are never returned. ### Access it via the API The same data is available programmatically, so you can pull request telemetry into your own tooling. Use the Telemetry endpoint exposed in the [Platform Swagger](/rpc-service/getting-started/platform-swagger/) — `POST /api/v1/telemetry/requests` — which accepts the same filters (chains, methods, protocols, countries, error codes, errors-only, minimum latency, batch, trace ID, time range) and returns results with cursor-based pagination. Congrats — you can now inspect, filter, and export every request your account makes. --- url: https://www.ankr.com/docs/rpc-service/getting-started/basics-premium/ title: Basics with Premium plan description: Set up a Premium Ankr RPC account: sign in, deposit funds, and unlock higher limits, archive data, and premium features. source: docs/rpc-service/getting-started/basics-premium.mdx --- # Basics with Premium plan The [Premium service plan](/rpc-service/service-plans/#service-plans-comparison) enables using the Node API endpoints and Advanced APIs at the corresponding [rate limits](/rpc-service/service-plans/#rate-limits). Here is the path to access Premium and start using its functionality: > `Interface schema` —> `Sign in` —> `Deposit funds` —> `Use private endpoints` * [`Interface schema`](/rpc-service/getting-started/intro/#interface-schema): surely, it's always helpful to orient yourself in a new environment. Hardcore users can skip this step and proceed to the following one. * [`Sign in`](/rpc-service/getting-started/basics-premium/#sign-in): first things first, the road to using Premium starts with signing in into your account (so we can provide you with the private endpoints and know which account to charge under the [PAYG model](/rpc-service/service-plans/#pay-as-you-go) for the requests you make). * [`Deposit funds`](/rpc-service/getting-started/basics-premium/#deposit-funds): second, the positive balance of [API Credits](/rpc-service/service-plans/#how-we-charge) in your account is a must to be able to query the endpoints. That's why you'll have to deposit funds (we support both *Ethereum wallet* and *credit card* payment flows) to be converted into API Credits and stored into your account to make requests. It might be useful to know the [prices](/rpc-service/pricing/) before depositing funds. * [`Use private endpoints`](/rpc-service/getting-started/basics-premium/#use-private-endpoints): finally, after you've signed in and deposited funds into your account, you're all set to start using private Web3 API endpoints. ## Sign in Web3 API platform supports two authentication options: Authentication method * [**Google account**](/rpc-service/getting-started/basics-premium/#via-google-account) — sign in with your Google account. This option provides for the credit card payment flow only, though you can connect your wallet anytime to use the Ethereum wallet payment flow. * [**Ethereum wallet**](/rpc-service/getting-started/basics-premium/#via-ethereum-wallet) — connect your wallet to sign in. This option enables using both Ethereum wallet and credit card payment flows. :::note Other sign-in options — GitHub, X, Microsoft, Slack, Telegram, and Auth0 — are also available. Like Google, these social logins use the credit-card payment flow by default; connect an Ethereum wallet anytime to enable the crypto flow. ::: ### Via Google account The Google sign in procedure is the following: 1. Go to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. In the top right corner, click **Sign in >** **Continue with Google**, and then select the account to use. Google authentication Congrats — you've signed in to Web3 API using your Google account. ### Via Ethereum wallet :::warning Upon authentication, the system checks whether your Ethereum account has prior transactions.
Accounts with no transactions can't be used for authentication. ::: The Ethereum wallet sign in procedure is the following: 1. Go to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. In the top right corner, click **Sign in > Continue with ETH Wallet**, select the wallet to use (example: **MetaMask**). Wallet selection 3. In your wallet, go through required steps: * Click **Provide** — to use your public key for token encryption. * Click **Sign** — to confirm interactions with our platform. MetaMask connection Congrats — you now have an account with Web3 API, associated with your wallet. ## Deposit funds :::note We’ve pegged the price of our API Credits to USD. It means that upon using ANKR tokens for PAYG, `ANKR` calculates into `API Credits` at the current _ANKR/USD exchange rate on the moment of block's validation_. ::: Prerequisites: * [Sign in via Google account](/rpc-service/getting-started/basics-premium/#via-google-account) * [Sign in via Ethereum wallet](/rpc-service/getting-started/basics-premium/#via-ethereum-wallet) The payment process contains the following steps: 1. In **Navigation**, click **Billing** to open the corresponding pane. 2. In the **Payments** box, select the following parameters, and then click **Pay**: * **Payment type**: * **One-time**: single Pay-as-you-go balance payment. * **Recurring**: monthly-repeating Pay-as-you-go balance payment. * **Deal**: monthly subscriptions with 20% extra API credits. * **Currency**: * **USD**, **ANKR**, **USDT**/**USDC**: all three options available for the **One-time** payment type only. * **USD**: the only option for both **Recurring** and **Deal** payment types. * **Amount**: select the amount in the presets or enter it manually. 3. In the **Payment summary** dialog, check whether all the payment parameters selected are valid, and then either proceed to checkout with [Stripe](https://stripe.com/) or confirm the transaction with your Ethereum wallet. Congrats — you've just deposited funds into your account balance, and you're all set to use your private endpoints. ## Use private endpoints Prerequisites: * [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) * [Deposit funds](/rpc-service/getting-started/basics-premium/#deposit-funds) ### Premium URL structure As a Premium user, you have private Endpoints at hand to enable your projects to interact with blockchains. A Premium URL consists of a connection protocol (`https` or `wss`), domain name (`rpc.ankr.com`), common path of a blockchain to use (`/eth`), and your personal JWT token as the last segment of the path: ``` https://rpc.ankr.com/eth/6fe08843fa0966456eaa3fb19d4828b12389e71f48829f50df25e45bc5fd6cc5 ``` ### Premium endpoint interaction formula For a Premium user, the blockchain interaction capabilities still revolve around using Node/Advanced API endpoints but start from a different angle — [Projects](/rpc-service/getting-started/projects/) — which in essence represent individual unique tokens to differentiate and group your private endpoints around a single particular scope of work. The endpoint for the Premium user can be schematically described by the following formula: > `Endpoint` = `Project (API key)` + `Network` ### Copy endpoint into your app's library To enable your web3 application to interact with a blockchain, copy the corresponding endpoint into your app's project library or config file: 1. In **Navigation**, click **Projects** to open the pane. 2. In **Projects list**, click the project you'd like to work under. 3. In the **Chains** box of the project opened, click the chain you'd like to interact with to expand its contents. 4. In the chain expanded, click the **HTTPS/WSS endpoint** to copy it, and then paste it into your app's working library or config file. Congrats — you've just added a private endpoint into your app's working library or config file to enable blockchain interaction. --- url: https://www.ankr.com/docs/rpc-service/getting-started/basics-public/ title: Basics with Public plan description: What's available for the Public service plan user: Node API at the corresponding rate limits. Connection code snippets. source: docs/rpc-service/getting-started/basics-public.mdx --- # Basics with Public plan What's available for the [Public service plan](/rpc-service/service-plans/#service-plans-comparison) user: * Node API at the corresponding [rate limits](/rpc-service/service-plans/#rate-limits). * Connection code snippets. * Public usage data (stats on requests from all Public service users). ## Use public endpoints To enable your project to interact with a blockchain, add the blockchain's endpoint into the project's library or config file: 1. In **Navigation**, click **Chains List** to open the pane. 2. In **Chains List**, locate and click a chain you'd like to query. Chain selection 3. In the **Chain** opened, select a network (**Mainnet**/**Testnet**) required for your project. Network selection 4. In the **HTTPS Endpoint** field, copy the URL and paste it into your project's library or config file. Use public endpoint Congrats — you've just added a public endpoint into your project to enable blockchain interaction. --- url: https://www.ankr.com/docs/rpc-service/getting-started/billing/ title: Billing & Payments description: Top up your account balance with crypto across six networks (Ethereum, BNB Chain, Polygon, Arbitrum, Optimism, Scroll) or with a credit/debit card, and track your payments and expenses. source: docs/rpc-service/getting-started/billing.mdx --- # Billing & Payments :::tip Available for both [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. Manage from the **Billing** pane. ::: Your account runs on a balance of **API credits**. You top that balance up whenever you like — with **crypto** or a **card** — and Ankr draws down credits as you make requests. For how credits are priced and consumed, see [Pricing](/rpc-service/pricing/) and the [Charging policy](/rpc-service/charging-policy/). ## Payment methods ### Pay with crypto Top up with the stablecoins **USDC** or **USDT** on any of **six networks**: * **Ethereum** * **BNB Chain** * **Polygon** * **Arbitrum** * **Optimism** * **Scroll** You can also pay with **ANKR** on **Ethereum**. Choose whichever network is cheapest or most convenient for you at checkout. :::tip Pay with ANKR, get 20% extra Top up your balance with **ANKR** and we add a **20% bonus** to the credited amount. ::: ### Pay with a card Pay with a **credit or debit card**. Card payments are processed securely through Stripe. ## Deposit funds 1. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. In **Navigation**, click **Billing**. 3. Click **Deposit** (or **Add funds**) and choose your method: * **Crypto** — select one of the six supported networks, then send the amount from your wallet. * **Card** — enter your card details to pay in USD. 4. Confirm the payment. Your balance updates once the payment is processed. ## Track your spending In **Billing** you can also: * **Account balance** — check the API credits remaining and see if you need to top up. * **Payments history** — review your past deposits. * **Expenses** — see your consumption over time on the expense chart. :::note You can run on pay-as-you-go, or set up a subscription for bonus credits. See [Pricing](/rpc-service/pricing/) for the current options. ::: Congrats — you know how to fund your account and keep an eye on your spending. --- url: https://www.ankr.com/docs/rpc-service/getting-started/intro/ title: Intro description: Get started with the Ankr RPC platform: create a project, mint an API key, and make your first Node API or Advanced API call. source: docs/rpc-service/getting-started/intro.mdx --- # Intro Getting Started docs will help you land on your feet safely and orient yourself on the unfamiliar territory of our Web3 API platform in no time. Here is your map to our basics: > `Interface schema` — `Public: basics` — `Premium: basics` — `Team accounts` — `Projects` * [`Interface schema`](/rpc-service/getting-started/intro/#interface-schema): your way around Web3 API interface. * [`Public: basics`](/rpc-service/getting-started/basics-public/): your way around Public endpoints for blockchain interaction. * [`Premium: basics`](/rpc-service/getting-started/basics-premium/): your way around Premium endpoints for blockchain interaction. * [`Team accounts`](/rpc-service/getting-started/team-accounts/): your way around team accounts structuring your business. * [`Projects`](/rpc-service/getting-started/projects/): your way around setting your projects and adding whitelists. ## Interface schema Here you'll find information on what you can expect from all the main panes you're working with on the Web3 API platform. Here are panes you usually work with: > [`Chains list (Endpoints)`](/rpc-service/getting-started/intro/#chains-list) — [`Advanced API`](/rpc-service/getting-started/intro/#advanced-api) — [`Statistics`](/rpc-service/getting-started/intro/#statistics) — [`Settings`](/rpc-service/getting-started/intro/#settings) — [`Billing`](/rpc-service/getting-started/intro/#billing) ### Chains list Once you type down `ankr.com/rpc` in your browser and press `Enter`, you'll find yourself in the **Chains list** pane. This is your starting point to empower your Web3 project with blockchain interaction capabilities.
UI Schema You usually start as a [Public plan](/rpc-service/service-plans/) user, meaning that you haven't signed in to our platform yet and can only use free Node API endpoints with the corresponding [features](/rpc-service/service-plans/#feature-list) and [rate limits](/rpc-service/service-plans/#rate-limits) available. For a Public plan user, the following actions are available from the start: * **Navigation**: selecting the pane to work with. * **User authentication**: signing in to the platform to use [Premium capabilities](/rpc-service/getting-started/basics-premium/). * **Chains selection**: selecting the chain to [use Public endpoints](/rpc-service/getting-started/basics-public/#use-public-endpoints) for your project's blockchain interaction. ### Advanced API :::tip Available for both [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: The Advanced API (AAPI) functionality is intended for a more savvy and demanding user. Advanced API optimizes, indexes, caches, and stores blockchain data to make it access-ready for you. Some AAPI methods support simultaneous querying of multiple EVM-compatible blockchains in a single request.
Advanced API pane For a Freemium/Premium user, the blockchain interaction capabilities still revolve around using Node/Advanced API endpoints but start from a different angle — [Projects](/rpc-service/getting-started/projects/) — which in essence represent individual unique tokens to differentiate and group your private endpoints around a single particular scope of work. The endpoint for the Freemium/Premium user can be schematically described by the following formula: > `Endpoint` = `Project (API key)` + `Network` In terms of the things you can do in the **Advanced API** pane, it comes to the following options based on whether you've already added AAPI to a project or not: * **AAPI added**: the project added with AAPI functionality will have the **Copy endpoint** button to copy and paste your endpoint into the source code. * **AAPI not added**: the project not added with AAPI functionality will have the **+ Add to project** button to create an endpoint which then can be copied into your source code.
Advanced API pane ### Statistics :::tip Available for both [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: To open the **Statistics** pane, follow these steps: 1. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. In **Navigation**, click **Statistics** to open the corresponding pane. Congrats — you can now see your statistics.
In **Statistics**, you can monitor the following data: * **Total Requests**: a number of total requests. * **Top chain**: the most queried chain. * **Requests health**: the overall requests' success-to-failure rate based on our node performance. * **Requests**: a diagram of requests. * **Requests overview** info on requests filtered by one of the parameters — projects, chains, IPs, countries, and methods. * **Requests health breakdown**: a detailed node distribution of success and failure requests. * **Usage History**: a number of chain requests by month. ### Settings :::tip Available for both [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: To open the **Settings** pane, follow these steps: 1. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. In **Navigation**, click **Settings** and select one of the submenus to work with: * **Platform**: define general Web3 API platform settings. * **Platform Swagger**: interact with the platform's internal endpoints in Swagger UI. * **Notifications**: manage Email, Telegram, and Slack notifications for your personal or team account. #### Platform
UI Schema In **Settings > Platform**, the following actions are available for you: * **Sign-in methods**: manage the sign-in methods associated with your account (Google, GitHub, X, Microsoft, Slack, Telegram, an Ethereum wallet, or Auth0). * **Account security**: Secure account with two-factor authentication. * **Theme**: Select theme preference — dark/light. ### Billing :::tip Available for both [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: To open the **Billing** pane, follow these steps: 1. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. In **Navigation**, click **Billing** to open the corresponding pane. Congrats — you can now check your balance, deposit funds into your account, see payments history, and expenses chart.
In **Billing**, the following actions are available for you: * **Account balance**: check your account balance for API credits left and see if you need to top it up. * **Payments**: [deposit funds](/rpc-service/getting-started/basics-premium/#deposit-funds) into your account. * **Payments history**: check your history of funds depositing. --- url: https://www.ankr.com/docs/rpc-service/getting-started/notifications/ title: Notifications & Alerts description: Stay on top of your account and the blockchains you use. Ankr sends balance, usage, and blockchain-status alerts to Email, Telegram, and Slack. source: docs/rpc-service/getting-started/notifications.mdx --- # Notifications & Alerts :::tip Available for both [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. Manage from **Settings > Notifications**. ::: Ankr keeps you informed about two things that matter in production: the health of **your account** (so you never run out of credits unexpectedly) and the health of **the blockchains you actually use** (so you hear about an issue before your users do). Alerts are delivered to the channels you choose — **Email, Telegram, and Slack**. ## Channels You can receive notifications on any combination of: * **Email** — sent to your account email address. * **Telegram** — connect the Ankr notifications bot to your Telegram. * **Slack** — connect Ankr to a channel in your Slack workspace. ## What you get notified about ### Account & balance Alerts that keep your service running: * **Low balance / credit threshold** — when your account balance of API credits runs low, so you can [top up](/rpc-service/getting-started/billing/) before requests start failing. * **Usage** — notable changes in your consumption. ### Blockchain status Subscribe to **blockchain-status alerts** through the Telegram bot or Slack, and Ankr will tell you when something affects the chains you depend on: * **Endpoint issues** — if our internal monitoring detects a problem serving one of your chains, you get an alert for that chain. * **Critical network updates** — informational messages when a network ships a critical upgrade (for example, a hard fork) that may need your attention. :::note Blockchain-status alerts are **dynamic**: Ankr looks at which networks you've actually queried over the **last 30 days** and only notifies you about those. You get the signal for the chains you use — without the noise of chains you don't. ::: ## Set up notifications 1. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. In **Navigation**, click **Settings > Notifications**. 3. Connect the channels you want — **Email**, **Telegram** (via the bot), and/or **Slack** (to a workspace channel). 4. Choose what to subscribe to: account & balance alerts and/or blockchain-status alerts. Congrats — you'll now be alerted about your account and the chains you use, on the channels you chose. --- url: https://www.ankr.com/docs/rpc-service/getting-started/platform-swagger/ title: Web3 Platform Swagger UI description: The Ankr platform management API (OpenAPI/Swagger): manage keys, billing, usage, security, and team members programmatically. source: docs/rpc-service/getting-started/platform-swagger.mdx --- # Web3 Platform Swagger UI :::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: ## Introduction The Web3 API Platform **Swagger UI** offers developers direct, structured access to their Web3 API account through an interactive API documentation interface — bypassing the standard dashboard UI. Built on the [OpenAPI (Swagger)](https://spec.openapis.org/oas/v3.1.0.html) standard, it provides a familiar experience for those already accustomed to testing and integrating with APIs. With the Swagger UI, developers and advanced users can automate workflows, integrate Web3 API capabilities into scripts or backend systems, and manage their account with precision and control. **Key Features** Through the Swagger interface, you can do the following: * **Access Account Data** * Retrieve balance, usage stats, referral rewards, and transaction history. * View and manage your API keys and JWTs. * **Monitor and Optimize Usage** * Track blockchain-specific usage across multiple protocols. * Analyze interval-based metrics and top consumer stats. * **Manage Billing and Payments** * Access invoices, Stripe or crypto payment documents. * Subscribe, manage, or cancel bundles and recurring payments. * **Control Notifications** * Configure and manage notification channels (email, Slack, Telegram). * Set thresholds for alerts on balance, usage, and credit levels. * **Configure Security and Access** * Manage 2FA setup and email bindings. * Handle enterprise client settings and access controls. * **Organize Teams** * Create and manage team accounts, invite members, assign roles. This interface is ideal for users looking to streamline operations, implement custom automation, or integrate Web3 API platform features into CI/CD pipelines and backend services. ## Usage Before jumping into Swagger UI interaction, you have to go through several preparation steps that include generating an API key for Swagger access, navigating to the Swagger UI, and authorizing your Swagger UI session with the API key generated. > `API key creation` —> `Swagger UI interaction` * [`API key creation`](/rpc-service/getting-started/platform-swagger/#api-key-creation) — your temporary passcode for Swagger interaction. * [`Swagger UI interaction`](/rpc-service/getting-started/platform-swagger/#swagger-ui-interaction) — your way around the Swagger UI (navigation, session authorization). ### API key creation To create an API Key, follow these steps: 1. In **Navigation**, click **Settings > Platform Swagger** to open the corresponding pane. 2. In the **Web3 API Platform Swagger** pane, click **+ Create API key**, enter the basic fields, and then click **Create API key**: * **Name**: enter a name for your API key. * **Validity period**: select your key's validity timeframe (**30 days** / **6 months** / **1 year**). 3. In the **Save API key** dialog, copy your API key for further usage. Congrats — you've just created and copied an API Key for Swagger interaction. ### Swagger UI interaction **Prerequisites**: * [API key creation](/rpc-service/getting-started/platform-swagger/#api-key-creation) To authorize your Swagger UI session, follow these steps: 1. In the **Web3 API Platform Swagger** pane, click **Platform Swagger UI** to open it in a new tab. 2. In the Swagger UI opened, click **Authorize**; in the **Value** field, enter `Bearer`, paste in your copied API key preceded with a space, and then click **Authorize** once again. Congrats — you've just authorized your Swagger session; now you're all set to interact with our platform endpoints. --- url: https://www.ankr.com/docs/rpc-service/getting-started/projects/ title: Projects description: Organize Ankr RPC usage into projects, each with its own API key, security rules, usage analytics, and limits. source: docs/rpc-service/getting-started/projects.mdx --- # Projects :::tip Available for both [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: ## Introduction The Projects feature aims to provide a business that manages multiple projects — dApps/platforms (powered with Ankr's blockchain interaction) — with the means to organize, monitor, control, and secure the endpoints used to power each of those projects. The Projects feature is built to help you with the following: * **Organize endpoints**: Now you can organize your endpoints by their specific sphere of usage — by project. * **Monitor projects**: Our Statistics now serves to build your insights around a particular project's scope of work, equipping your business with proactive tools for decision-making. * **Freeze projects**: You now have a single-click ability to put your projects on/off handbrake — to stop/start powering your projects with our endpoints. * **Safeguard endpoints**: We have your project's back covered with the whitelist security mechanisms safeguarding your endpoints from abuse and enabling you to define domains, IPs, or smart contracts allowed for endpoints communication. In simple terms, each new project provides a new unique token to be used in your private endpoints. Your projects differ from each other based on that token. The endpoints with the same token power a single project. And you can view each project's metrics in the **Statistics** pane. In essence, the endpoint for the Freemium/Premium user can be schematically described by the following formula: > `Endpoint` = `Project (API key)` + `Network` ## Usage The **Default** project contains all your previously configured data — chains, networks, and transactions history. On top of that, now you can configure additional projects and secure your endpoints with multiple whitelist options. ### Create project #### Major parts Project creation consists of the following parts: > `General info` —> `Chains` —> `Endpoints whitelist` * `General info`: The project’s basic details such as name and description, helping you define its scope of work. For example, if the project’s endpoints are used for a specific application, naming the project accordingly will make it easier to distinguish its stats and spending later. * `Chains`: The chains and networks you'd like to interact with in terms of this project. You won't be able to interact with a particular network unless it's added into your project. * `Endpoints whitelist`: A safeguard that prevents your endpoints from unauthorized use. Ideal for cases when you already know the domains, IPs, or smart contracts that will interact with your endpoints. Must be configured individually for each project's endpoint. #### Creation flow To create a new project, follow these steps: 1. In **Navigation**, click **Projects** to open the corresponding pane. 2. In the **Projects** pane, click **+ Create Project**, and go through the steps to configure it: * **General info** — enter a name (required) and give your project a description (optional) to identify its purpose; click **Next**. * **Chains** — select chains and networks your project requires; click **Next**. * **Endpoints whitelist** — click **Configure > Add** and select whitelist option (**Domain**/**IP**/**Smart contract**), enter the **Domain**/**IP**/**Smart contract** address, select chains the endpoints of which can be accessed by the address provided, then click **Confirm**, close the side menu, and click **Next**; this step can be configured right away or later (**Save** without configuring). Congrats — you've just configured and created a new project. ### View project To view a project, click the corresponding project's tile. Each project consists of four main blocks: > [`General info`](/rpc-service/getting-started/projects/#general-info) — [`Total requests (1h/24h)`](/rpc-service/getting-started/projects/#total-requests) — [`Whitelist`](/rpc-service/getting-started/projects/#whitelist) — [`Endpoints`](/rpc-service/getting-started/projects/#endpoints) #### General info The `General info` block contains your private token, buttons to enable/disable the project's endpoints, and the button for project deletion. #### Total requests The `Total requests` block shows total requests for the past 1h or 24h and contains the button that moves you to a larger statistics dashboard.
#### Whitelist The `Whitelist` block contains the button to create whitelists, and shows the number of configured and available whitelist entities.
#### Endpoints The `Endpoints` block helps you add chains and networks required for your project, access HTTPS and WSS endpoints. And copy connection code snippets.
--- url: https://www.ankr.com/docs/rpc-service/getting-started/team-accounts/ title: Team Accounts description: Ankr team accounts: invite members, scope roles, and share Premium access and billing without sharing a single login. source: docs/rpc-service/getting-started/team-accounts.mdx --- # Team Accounts :::tip Available for [Premium](/rpc-service/service-plans/#service-plans-comparison) users only. ::: *Team account* is a type of account that provides the means for collaboration. In a nutshell, it's an account that can be simultaneously accessed by several teammates to perform their specific tasks. :::note A team account is a separate account with its individual account balance, service plan, and dedicated endpoints using a JWT token different from that of the personal account. In other words, an account owner can use both their personal and team accounts. ::: As a personal account owner, you have the means to establish and manage multiple teams focused on particular tasks. As a team account participant, you can perform tasks according to the access rights provided to you. `Personal account owner`: * Creates a team-specific account. * Adds required teammates to it. * Provides teammates with access rights to perform their duties. `Team account participant`: * Switches between multiple team accounts to exercise the roles according to the access rights granted. ## Personal account owner Premium users can establish up to *5 team accounts* to structure and manage their business. That procedure consists of two parts: * [Create team account](/rpc-service/getting-started/team-accounts/#create-team-account) * [Invite teammates](/rpc-service/getting-started/team-accounts/#invite-teammates) ### Create team account :::warning Only Premium users registered on our platform via a social login (Google, GitHub, X, Microsoft, Slack, or Telegram) can use the **Enable assets transfer** option upon creating a team account. ::: To create a team account, follow these steps: 1. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. Click the **Accounts** menu > **+ Create team account** to start the procedure. 3. In the **Create team account** dialog, specify the following parameters: * **Name** — enter a team account's name. * **Enable assets transfer (personal —> team)** — here you have 2 options available for account creation: * **Toggle On** — to create a team account based on your personal account's structure. This means that all the assets (JWT token, Premium service plan, account balance, projects, and analytics) will be cut from your personal account's structure and pasted as the structure for the team account you create. Meanwhile, your personal account obtains a new JWT token and switches to the **Freemium** [service plan](/rpc-service/service-plans/) until you make the [initial deposit](/rpc-service/getting-started/basics-premium/#deposit-funds). Other personal account's assets (account balance, projects, and analytics) will look like you've just started using our service from scratch. * **Toggle Off** — to create a team account from scratch. This means that your personal account stays the same, and you start creating the whole structure for the team account from ground zero. 4. Click **Confirm and create** if you've toggled **On** the **Enable assets transfer** option, or just **Create** if you've toggled it **Off**. Congrats — you've just created a team account. The next step is to invite teammates to the account created. ### Invite teammates :::warning Currently, only users with **Google email addresses** can be added as teammates. ::: To invite teammates (max.: `20`) to a team account, follow these steps: 1. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. Click the **Accounts** menu > **Manage team accounts** to open the **Team accounts** pane. 3. In the **Team accounts** pane, click **Invite** to open the **Invite teammates** dialog. 4. In **Invite teammates** dialog, add your teammates' gmails, assign the applicable access roles for them, and then click **Invite**: * **Admin** — manages the account's service plan, adds/deletes teammates, edits teammates' access roles, and manages projects. * **Developer** — adds/edits endpoints and whitelists, views projects' statistics. * **Finance** — manages the account's service plan, deposits funds into account balance, views financial data (payments history, expense chart). Congrats — you've just added teammates to a team account. The selected teammates will receive email invitations that they need to accept to join the team. ### Edit access roles To edit teammates' access roles, do the following: 1. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. Click the **Accounts** menu > **Manage team accounts** to open the **Team accounts** pane. 3. In the **Team accounts** pane, click the required account to expand its contents. 4. For the required user, click the **Access role** drop-down menu, select an applicable access role, and then click **Update role**: * **Admin** — manages the account's service plan, adds/deletes teammates, edits teammates' access roles, and manages projects. * **Developer** — adds/edits endpoints and whitelists, views projects' statistics. * **Finance** — manages the account's service plan, deposits funds into account balance, views financial data (payments history, expense chart). Congrats — you've just edited your teammate's access role. The teammate will receive the email invitation that they need to accept to join the team in the new role. ### Switch accounts To switch your current account, do the following: 1. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. Click the **Accounts** menu and select the account you'd like to switch to. Congrats — you've selected an account to work with. ## Team account participant ### Accept invitation 1. In your Google mailbox, find the team account invitation and open it. 2. In the **Team account invitation** email, click **View invitation** to get to our Platform. 3. In the **Welcome to the team** dialog, click **Join team** to accept the invitation. Congrats — you've just joined the team and can collaborate according to your access rights. ### Switch accounts To switch between the team accounts you belong to and exercise the corresponding access rights granted, do the following: 1. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [Web3 API](https://www.ankr.com/rpc/) platform. 2. Click the **Accounts** menu and select the account you'd like to switch to. Congrats — now you can start performing the tasks according to your access rights. --- url: https://www.ankr.com/docs/rpc-service/mcp/agent-rpc/ title: Agent RPC MCP: Blockchain Data for AI Agents description: Connect Claude Code, Cursor, or VS Code to Ankr RPC over the Model Context Protocol. Seventeen read-only tools return ABI-decoded, token-compressed chain data using your Ankr API key. source: docs/rpc-service/mcp/agent-rpc.mdx --- # Agent RPC MCP **Agent RPC MCP is a hosted [Model Context Protocol](https://modelcontextprotocol.io/) server that gives an AI agent read access to every chain Ankr serves.** You point your coding agent at one URL, give it your Ankr API key, and it gets seventeen tools that return chain data already decoded and compressed for a context window, instead of raw hex the model has to spend tokens parsing. It is a **data plane only**. Every tool reads. Nothing in it can sign, broadcast, or change chain state, on any chain family. Account and key management lives in a separate server, the [Management MCP](/rpc-service/mcp/management/). ## Why it is not just an RPC endpoint An agent that calls JSON-RPC directly pays twice: once for the hex it cannot read, and again for the reasoning it spends turning that hex into meaning. Each tool here calls `rpc.ankr.com` asking for **TORPC tier 2**, so a response comes back with contract calls and event logs ABI-decoded into named arguments, hex numbers turned into decimals, and bulky fields such as `logsBloom` and header roots dropped. On decode-heavy reads (transactions, receipts, logs) that is typically **25% to 58% fewer tokens** for the same information. Every tool result also carries a real token count for the text it emitted, so an agent can budget its own context rather than guess at it. ## Connect it You need an Ankr API key. Create a project and copy its key from the [Web3 API platform](https://www.ankr.com/rpc/); see [Premium: basics](/rpc-service/getting-started/basics-premium/) if you have not made one yet. The server speaks **Streamable HTTP** at: ``` https://mcp.ankr.com/rpc ``` Authenticate with your key in the `x-ankr-api-key` header, or as `Authorization: Bearer `. A request with no key is refused. Your key is passed straight through to Ankr RPC, so the [rate limits](/rpc-service/service-plans/#rate-limits) and [charging](/rpc-service/charging-policy/) of your plan apply exactly as they do to your own calls. The MCP server adds no quota of its own and has no keyless trial. ### Claude Code ```sh claude mcp add --transport http ankr-agent-rpc https://mcp.ankr.com/rpc \ --header "x-ankr-api-key: " ``` Then run `/mcp` inside Claude Code to confirm the server is connected and see the tools it advertises. ### Cursor Add the server to `.cursor/mcp.json` in your project, or to `~/.cursor/mcp.json` for every project: ```json { "mcpServers": { "ankr-agent-rpc": { "url": "https://mcp.ankr.com/rpc", "headers": { "x-ankr-api-key": "" } } } } ``` ### VS Code Add it to `.vscode/mcp.json` (workspace) or your user MCP configuration, and keep the key out of the file by prompting for it: ```json { "servers": { "ankr-agent-rpc": { "type": "http", "url": "https://mcp.ankr.com/rpc", "headers": { "x-ankr-api-key": "${input:ankr-api-key}" } } }, "inputs": [ { "id": "ankr-api-key", "type": "promptString", "description": "Ankr API key", "password": true } ] } ``` :::note A session is bound to the key it was opened with, and every later request on that session has to present the same key. To switch keys, start a new session (in most clients, reconnect the server). ::: ## The seventeen tools ### Chain reads, compressed These three request TORPC tier 2 and are the reason the server exists. * **`getTransaction`**: a transaction plus, by default, its receipt, with calldata and logs ABI-decoded. * **`getLogs`**: event logs decoded to contract, event, and named arguments. A wide block range is scanned in ascending chunks and paged with a cursor, rather than fetched whole and mostly discarded. * **`getBlock`**: a block by number, hash, or tag (`latest`, `finalized`, `safe`, `earliest`, `pending`), optionally with decoded transactions. ### Wallet, token, and NFT data Indexer-backed reads through the [Advanced API](/advanced-api/overview/). These are not TORPC-compressed. * **`getBalances`**: native balance plus ERC-20 balances with USD value. The asset list is bounded and value-ordered, with a cursor to the tail; assets the indexer has no price for are reported as unknown value, never as zero. * **`getAccountBalance`**: balances across several chains at once, in prose form. * **`getWalletActivity`**: an address's recent transaction history, newest first, paged. * **`getNFTs`**: NFTs held by an address, with collection, token id, standard, and image. * **`getTokenHolders`**: holders of an ERC-20 contract, with balances and a total count. * **`getTokenPrice`**: USD price, with the block and timestamp the quote is as of. * **`getTokenPriceHistory`**: a historical USD price series for a token. * **`getInteractions`**: which chains an address has used, as a first step before per-chain queries. ### Contract and identifier lookups * **`resolveContract`**: whether an address is a contract, best-effort ERC-20 metadata, and EIP-1967 proxy detection. * **`searchChain`**: resolves an on-chain identifier: a 32-byte hash to a transaction (or block), a 20-byte address to an account, digits to a block number. It is not a name lookup: tickers, contract names, and ENS names are reported as unresolved rather than guessed. ### Discovery and paging * **`listChains`**: the live capability matrix of which chains have Advanced API coverage, and where tier-2 compression is verified. * **`describeMethods`**: for any JSON-RPC method, the positional parameter shape and a worked example, plus whether your key may actually call it on that chain. Pass `probe:true` with an explicit `methods` list to ask the node, so the answer reflects your key, your tenant, and the chain's schema rather than a guess; a method the escape hatch refuses is never sent. * **`expandResult`**: continues a paged result from `getLogs`, `getWalletActivity`, or `getBalances` using the opaque cursor the previous call returned. ### The escape hatch * **`rpcCall`**: any read method on any chain Ankr serves, for the cases the routed tools do not cover (`eth_call`, `eth_estimateGas`, `eth_getStorageAt`, `eth_getCode`, `eth_feeHistory`, `trace_*`, `debug_trace*`, and the equivalent reads on non-EVM families). Prefer a routed tool where one fits: those are tuned and decoded. ## Compression is negotiated per call, and can degrade Tier 2 is what a tool **asks for**, not what it is promised. The proxy applies the requested tier only while the response stays inside its compression budget; a response above that budget comes back at **tier 0**, raw and undecoded, no matter what was requested. | Tier | What you get | | ---- | ------------ | | 0 | Passthrough. Standard JSON-RPC, raw hex, no decoding. | | 1 | Hex converted to decimal, plus field renaming. | | 2 | Full: ABI decode of functions and events with named arguments, log collapse, `logsBloom` dropped. | **`_meta.tier`** carries the tier actually applied and is present on every successful result, so check it before looking for decoded fields such as `args`. A downgrade to tier 0 happens when a response is over the proxy's compression budget, and also on methods the proxy does not compress at all, such as `eth_call`, `eth_getCode` and `eth_getStorageAt`. Some tools additionally put **`tier_degraded: true`** in the body when they asked for tier 2 on your behalf and got less, alongside `tier_applied` and a note on how to narrow the request. Not all of them do, so `_meta.tier` is the field to rely on. Treat a degradation as "ask for less data" (a narrower block range, fewer transactions) rather than as an error. An error result carries `_meta.error_code` and no tier at all. :::warning Decoded amounts are **raw base units**, with no decimals applied. An `args.value` of `41695680` on a 6-decimal token is 41.69568, not 41 million. Fetch the token's `decimals` (with `resolveContract`) before reporting a human-readable amount. ::: ## Reads only, and broadcast is refused `rpcCall` is a data escape hatch, not a wallet. The server closes write paths itself, before the request leaves it: * **It is a write denylist, not a read allowlist.** The server refuses an enumerated set of write paths on every chain family and **forwards everything else**. It keeps no list of permitted reads, so a read it does not recognize is forwarded rather than refused. * **Broadcast and signing are refused on every chain family, with no exceptions.** That covers `eth_sendRawTransaction`, MEV bundle and private-transaction variants, `personal_*` and `eth_sign*`, Solana `sendTransaction` and `requestAirdrop`, Bitcoin `sendrawtransaction`, Sui `sui_executeTransactionBlock`, XRPL `submit`, Tron `broadcasttransaction` and `createtransaction`, Cosmos `broadcast_tx_*`, and Starknet `add*Transaction`. * **Node administration, dev-node state, and consensus-layer namespaces are refused too**: `admin_*`, `miner_*`, `personal_*`, `hardhat_*`, `anvil_*`, `evm_*`, `engine_*`, any mutating verb (`set*`, `write*`, `start*`, `stop*`, `compact*`), and the node-operation half of geth's `debug_*` namespace such as profilers and chaindb compaction. * **Transaction building is refused where it is namespaced as such**, even though it broadcasts nothing: Sui's `unsafe_*` namespace returns an unsigned transaction, and that is a wallet's job. This is scoped to that namespace, not a general rule about builders. * **Simulation still works.** Read-only simulation is not broadcasting, so `eth_call`, `eth_estimateGas`, Solana `simulateTransaction`, and Sui's dry-run methods are permitted. Sign and send with your own wallet or signer. To keep the guarantee independent of this server as well, point the agent at a read-only key. **What this does and does not decide.** The refusal of broadcast, signing and node administration is enforced here and holds on every chain. Which *reads* you may call is not decided here at all: a forwarded read is answered or refused by the chain's blockchain schema and by your tenant, and that refusal (`Method disabled, reason: restricted by blockchain schema`) is the authoritative answer. Call `describeMethods` with `probe:true` to ask the endpoint what your key may actually call, rather than inferring it from this list. ## Supported chains * **Raw-RPC tools and `rpcCall` reach any chain Ankr serves.** Pass the chain slug as it appears in `rpc.ankr.com/`: 200+ EVM mainnets and testnets, plus non-EVM families such as Solana, Bitcoin, Sui, XRP, TON, NEAR, Aptos, and Cosmos chains. See the [chains list](/rpc-service/chains/chains-list/) for the full set. * **Tier-2 compression is verified on the common EVM chains** (Ethereum, BSC, Polygon, Arbitrum, Optimism, Base, Avalanche, Fantom, Gnosis, Linea, Scroll, zkSync Era, and others). Elsewhere the call still works and passes through at tier 0. * **Indexer tools need Advanced API coverage**, which is a smaller set than "everything Ankr serves". Call **`listChains`** rather than hardcoding any of this: it returns the Advanced API set and the tier-2 examples as they are today, and it is the surface we keep current. ## Good to know * **Tool inputs are strict.** A misspelled argument is reported as a validation error instead of being silently dropped, so an agent finds out it got the name wrong. * **Pass block numbers above 2^53 as strings.** A JSON number that large is not exact. * **Results are bounded on purpose.** Large lists are capped, and the response says what it withheld and how to reach the rest through `expandResult`. A truncated list always admits it is truncated. ## Related * [Management MCP](/rpc-service/mcp/management/): the control plane for keys, per-key security, usage, balance, and notifications. * [Advanced API](/advanced-api/overview/): the indexed data the wallet and token tools read. * [Service plans](/rpc-service/service-plans/) and [Charging policy](/rpc-service/charging-policy/): what your key's calls cost. * [Error reference](/rpc-service/errors/overview/): what an error from the underlying endpoint means. --- url: https://www.ankr.com/docs/rpc-service/mcp/management/ title: Management MCP: Manage Your Ankr Account from an Agent description: Manage Ankr API keys, per-key security, usage, balance, payments, and notifications from an MCP client. Browser OAuth login, and out-of-band human approval on key deletion and Platform key revocation. source: docs/rpc-service/mcp/management.mdx --- # Management MCP **Management MCP is the control plane for your Ankr account, exposed to an MCP client.** It manages API keys and their security settings, reads usage and spending, handles balance and payment setup, and configures notifications, so an agent can do the account work you would otherwise do by hand in the [Web3 API platform](https://www.ankr.com/rpc/). It is a separate server from the [Agent RPC MCP](/rpc-service/mcp/agent-rpc/) data plane, with a separate auth model. Reading chain data needs no identity, only a key. Changing your account needs to know who you are, so this server signs you in. :::info The Management MCP is new and we are still rolling it out. The tool surface below is what ships today, with each limit stated where you would meet it. ::: ## What it manages **Keys and projects.** Create a key, optionally scoped to a set of chains, and get back a URL you can call immediately. List your keys with their name, description, slot, and chain scope. Rename one, change its chain scope, freeze or unfreeze it, or delete it. Check how many keys your plan allows. * `mgmt_create_api_key`, `mgmt_list_api_keys`, `mgmt_reveal_api_key`, `mgmt_get_api_key_status`, `mgmt_get_allowed_key_count`, `mgmt_edit_api_key`, `mgmt_freeze_api_key`, `mgmt_delete_api_key` `mgmt_list_api_keys` stays redacted on purpose: it never returns key material. To get the endpoint token of a key you did not just create, use `mgmt_reveal_api_key`, which is gated by a human approval per key. Keys that also carry Enterprise access are labeled as such, and the reply names the `enterprise.onerpc.com` entry point rather than assembling a per-chain URL for it. **Per-key security.** Restrict a key to specific IPs, referers, or contract addresses, restrict it to a set of chains, and read the enforcement mode back. * `mgmt_add_allowlist_item`, `mgmt_edit_allowlist`, `mgmt_replace_allowlist`, `mgmt_set_allowlist_mode`, `mgmt_set_blockchain_allowlist`, `mgmt_get_allowlist`, `mgmt_get_allowlist_mode`, `mgmt_get_blockchain_allowlist` Three limits worth knowing before you rely on this: `mgmt_get_allowlist` reports the mode but **does not list the entries** in it, turning enforcement **off** is not effective today (the way to widen access is to replace the list), and **CIDR ranges are not accepted** anywhere in the allowlist path, only single addresses. Use the [console](https://www.ankr.com/rpc/) when you need to read a list back item by item. **Usage and spending.** Requests by day or interval, per chain, and spending split between pay-as-you-go and bundles. * `mgmt_get_usage`, `mgmt_get_interval_stats`, `mgmt_get_spending_stats` Usage rollups lag behind live traffic by longer than the smallest interval window, so a report for the last few minutes will read low. The tool descriptions say so at the point of use. **Balance and payments.** Current balance, level, and an estimate of how long it lasts at your current burn. Card top-ups and recurring subscriptions are started here, along with reads for subscriptions, prices, card eligibility, and invoices. * `mgmt_get_balance`, `mgmt_get_days_estimate`, `mgmt_deposit_with_card`, `mgmt_subscribe_recurrent`, `mgmt_get_subscriptions`, `mgmt_get_subscription_prices`, `mgmt_card_payment_eligibility`, `mgmt_get_invoice_details` **Notifications.** Read notifications and mark them seen, add an email address, connect Telegram or Slack, choose which alerts fire, and enable, disable, or delete a delivery channel. See [Notifications and alerts](/rpc-service/getting-started/notifications/) for what each alert covers. * `mgmt_get_notifications`, `mgmt_mark_notifications_seen`, `mgmt_get_notification_channels`, `mgmt_get_notification_config`, `mgmt_set_notification_config`, `mgmt_add_notification_email`, `mgmt_integrate_telegram`, `mgmt_integrate_slack`, `mgmt_set_delivery_channel_status`, `mgmt_delete_delivery_channel` The write side configures more alert types than the read side reports back, so after changing the configuration, trust what you set rather than what the read returns. **Identity.** Which account you are acting on, and a way to assert it. * `mgmt_whoami`, `mgmt_pin_account` ## Connect and sign in The server is at: ``` https://mcp.ankr.com/mcp ``` There is no token to paste. Login is a **real browser OAuth flow**: your client discovers the authorization server, registers itself automatically, and opens a browser where you sign in to your Ankr account with Google. The client only ever holds a short-lived bearer issued by the MCP server; the Ankr session behind it stays server-side. ### Claude Code ```sh claude mcp add --transport http ankr-management https://mcp.ankr.com/mcp ``` Run `/mcp` inside Claude Code, pick the server, and complete the browser login it opens. ### Cursor ```json { "mcpServers": { "ankr-management": { "url": "https://mcp.ankr.com/mcp" } } } ``` ### VS Code ```json { "servers": { "ankr-management": { "type": "http", "url": "https://mcp.ankr.com/mcp" } } } ``` :::note A session acts on the account you signed in with, and there is no account switcher: which account a login lands on is decided by the credential you sign in with. If you own more than one Ankr account, this matters. Every state-changing result and every account-scoped read names the account address it applied to, `mgmt_whoami` returns the same address, and you can assert the one you expect (with `expectAccount` on any call, or `mgmt_pin_account` once per session) so a call on the wrong account is refused and names both addresses instead of quietly succeeding. To act on a different account, sign in again as that account. ::: ## Two actions need a human, out of band An agent cannot approve its own sensitive action here, and neither can a compromised prompt. Where an action IS gated, it needs an **out-of-band human approval** that the model has no way to fabricate. Which actions those are is stated exactly below; the flow is: 1. The agent calls the tool. Instead of acting, the server mints a short-lived, single-use approval link bound to that exact action, those exact arguments, and your account. The tool result tells the agent it needs approval, and describes the action in the same words the page will. 2. You open the link and **sign in again, interactively, in a browser**. Approval succeeds only when the freshly signed-in human is the same account the request came from. 3. The login alone does not approve anything. You get a **consent page that names the action, what it affects, the concrete effects, an explicit warning when it cannot be undone, the account it applies to as its address, and when the link expires**. Approval is a deliberate click on that page, so a link merely opened while signed in cannot grant it. The whole round-trip is bound to the browser it started in, and no key material is ever rendered on the page. 4. The agent's next call carries the approved token, and the action goes through once. Human approval covers **two** actions: deleting a dedicated API key, and revoking a Platform API key. Everything else executes on the first call with no human in the path, including revealing a key's endpoint token, minting a Platform API key, freezing a key, starting a payment, and every allowlist, notification, team and session write. Each tool states which of the two it is. There is one case in between: six gateway routes are protected by the gateway's own second factor, and on an account with 2FA enabled those keep the approval page, because it is the only place a code is collected. On an account without 2FA they execute on the first call like everything else. A `confirm` argument exists on some tools as a dry-run convenience. It is a model-set input and is **never** a security boundary: a client that wants a human in the loop for the ungated writes has to ask for one itself, because this server cannot see, require, or audit a prompt you show. Six gateway routes are additionally protected by your account's **2FA**, on accounts that have it enabled. The code is collected **on the approval page**, by the human, and never reaches the model, the transcript, or a log. A `totp` argument exists for a caller that genuinely holds a code already and is normally left empty — you should not be asked to type a 2FA code into a conversation with an agent. ## What it cannot do These are limits of the design, not gaps waiting on a release: * **Accounts whose key material is MetaMask-encrypted are not supported.** Recovering the value of such a key requires `eth_decrypt` with the user's own wallet key, which no server can perform on your behalf. The tool says exactly this and points you at the [console](https://www.ankr.com/rpc/), where your wallet does the decryption. Everything else on the account still works here. * **The agent cannot charge a card.** `mgmt_deposit_with_card` starts a Stripe Checkout session and returns the hosted checkout URL for a human to open and pay. The agent never sees or handles card data, and cannot move money on its own. * **Transaction broadcast is out of scope by design.** Custody belongs to a wallet, not to an RPC management server. Nothing here signs or sends a transaction, and the [data plane](/rpc-service/mcp/agent-rpc/) refuses broadcast on every chain family. * **Scoping a usage report to a single project costs one human approval**, because it needs that key's token, which is itself approval-gated. An unattended agent can report on the whole account, not per key. * **A key created here is not immediately usable by an existing data-plane session.** The create and reveal replies hand you a working `rpc.ankr.com//` URL you can call over plain HTTPS right away, but an [Agent RPC MCP](/rpc-service/mcp/agent-rpc/) session is bound to the key it was opened with, so the data tools pick up a new key on a new session. ## Related * [Agent RPC MCP](/rpc-service/mcp/agent-rpc/): the data plane, with read-only, key-authenticated chain data for agents. * [Projects](/rpc-service/getting-started/projects/): what a key is, and how allowlists work in the console. * [Billing](/rpc-service/getting-started/billing/) and [Charging policy](/rpc-service/charging-policy/): balance, top-ups, and what calls cost. * [Notifications and alerts](/rpc-service/getting-started/notifications/): the alerts the notification tools configure. --- url: https://www.ankr.com/docs/rpc-service/overview/ title: Overview description: Ankr provides the top-performing globally-distributed infrastructure of nodes to empower your Web3 projects with blockchain interaction capabilities. source: docs/rpc-service/overview.mdx --- # Overview Ankr provides the top-performing globally-distributed infrastructure of nodes to empower your Web3 projects with blockchain interaction capabilities. > **Your project requires blockchain interaction?**
> Head straight to **[Web3 API platform](https://www.ankr.com/rpc/)**.
## Web3 API Service *Web3 API Service (https://www.ankr.com/rpc/)* — a platform that provides access to our top-class nodes infrastructure to query the vast list of [supported chains](/rpc-service/chains/chains-list/), monitor requested data telemetry, and test the RPC API methods you require before actually using them. Our [Web3 API](https://www.ankr.com/rpc/) platform has the following solutions to offer: * *[Node API](/rpc-service/getting-started/intro/)* — the endpoints that enable your Web3 projects to start interacting with an extensive list of [supported blockchains](/rpc-service/chains/chains-list/), give access to viewing the usage statistics for the data queried, and provide the means for RPC API methods testing. * *[Advanced API](/advanced-api/overview)* — a ready-to-use indexed collection of endpoints that supports simultaneous querying of multiple blockchains (19 mainnet and 7 testnet chains available) for the most popular Web3 scenarios at near-instant speeds; available via [JavaScript](/advanced-api/javascript-sdk)/[Python](/advanced-api/python-sdk) SDKs and [React Hooks](/advanced-api/react-hooks). Advanced API also gives you access to the usage statistics for the data queried. > Learn using our platform in the [Getting Started](/rpc-service/getting-started/intro/) docs. ### Architecture The thing we stand out by is that we don't have a single centralized Gateway. Similar to the competition, our infrastructure consists of nodes behind a load balancer that gets a request from the client and calculates the fastest processing solution to route the request through.
RPC Service dataflow Our fundamental distinction is that we use a whole network of geo-distributed load balancers instead of a single one for that purpose. Such an approach reduces the time needed for the request to get to a load balancer. And you don't have to work in NASA to realize that it's quicker for a user from Australia to reach an Australia-based load balancer than the one elsewhere. Secondly, we can boast having a vast geographical distribution of nodes themselves, which never really ends to expand. And we're committed to building our network of nodes coupled by location to the network of load balancers. Thereby, we reduce the requests processing time (the time a request goes from the load balancer to the node and back), making the geographical distribution and the nodes-to-load-balancers coupling a powerful solution to increase infrastructure effectiveness and reduce querying latency. The idea behind our geo-distributed architecture of nodes and load balancers is to provide the user with the same predictable top-quality services regardless of the user's location. ### Technology From a technology point of view, RPC Service infrastructure relies heavily on the following pillars to provide the highest quality blockchain interaction to power your Web3 projects:
There is a monitoring system that checks the nodes' performance with a very high regularity. If something goes wrong with a node, it will be disconnected from a load balancer. Certainly, it's not performed instantly, but the speed is rather high. In other words, if anything goes wrong with a node, then it disconnects from the load balancer, and the load balancer doesn't regard that node as a candidate for sending user requests.
The load balancing algorithm uses a scoring system to determine the best possible node to serve an RPC request at any given time. A load balancer selects the quickest node to answer. To do so, each load balancer instance regularly sends a standard request to each node and measures their answer times to find out the quickest one. Therefore, we can say that each instance of a load balancer knows the quickest nodes to serve the requests for each of the blockchains.
We cache the nodes' responses. The information is stored depending on the response type. Caching duration depends on the request type. Caching serves as an additional way to reduce request processing times.
Our monitoring system checks the nodes' performance 24/7. The implemented safeguard mechanisms protect us from connecting our infrastructure with the nodes sending incorrect data. Moreover, before updating the nodes' software, we always research the peculiarities of each specific version and never use it without a complete understanding of what the update brings us, if there are any benefits in it, and how secure it is.
User transactions data is stored on the backend in anonymized form. The system knows an Ethereum address the data associates with, but it doesn't know, for example, the private endpoint that has been used. We don't store that kind of information. Therefore, even if the inconceivable happens and someone hacks into our production database, the only thing to be seen is the existence of transactions — no one would be able to create fraudulent tokens or steal funds. ### Premium user-service interaction > User transactions security relies on two premises: **smart contracts** and **consensus mechanism**.
First is that the Premium user interacts with the system via a straightforward logic of a *smart contract* — you can't negotiate with it, you can't outsmart it — you deposit funds (USD, ANKR) into the contract, and then you can use the corresponding amount of API Credits to make requests. Also, if you'd like to withdraw your funds, you request the operation, which will also be performed via a smart contract.
The second premise is our consensus mechanism. The consensus mechanism is the means to confirm that a user has fulfilled particular conditions and therefore qualifies for particular services. It is implemented by means of three identical oracle-like services. They receive information on the transaction being made and the user claiming to have a right for some service regarding it. Each of the consensus mechanism's parties goes to a particular blockchain involved and checks the transaction completion, verifies if that's the right smart contract the transaction made to, checks whether the transaction has been mined yet, and whether the transaction's block has at least 12 blocks on top of it.
Meeting all the conditions confirms the claimed interaction with the smart contract. If all the three parties of the consensus mechanism agree on meeting all the conditions, then a JWT token is issued for the user that enables the person to use Premium RPCs. The token issued by the consensus mechanism is encrypted. The only moment it appears in the consensus mechanism explicitly is upon generation. Then it gets stored encrypted in the database.
The system uses asymmetric encryption. It means there is a pair of keys, one of which is used for encryption and another for decryption. The user transaction data passed into the consensus mechanism contains a public encryption key by means of which the issued JWT token gets encrypted before storing. Therefore, even if anyone hacks the consensus mechanism, the only thing to be found would be encrypted data which needs private keys to be decrypted, and those private keys only the users have, so no explicit data can be found.
In the future, we are also planning to increase the number of consensus mechanism participants to involve the collaborating third parties willing to work with us. In such a case, not only our internal microservices but also the external ones would participate in the consensus mechanism to confirm its validity of providing tokens security. --- url: https://www.ankr.com/docs/rpc-service/pricing/ title: Pricing description: How Ankr RPC pricing works: one flat credit rate per method, pay-as-you-go, and archive data included on every tier. source: docs/rpc-service/pricing.mdx --- # Pricing > Premium plan's blockchain requests measure in *API Credits*. For both our Premium plan's charging models — [Pay-as-you-go (PAYG)](/rpc-service/service-plans/#pay-as-you-go) and [Deal](/rpc-service/service-plans/#deal) — we charge per method used in request. Various methods have different API credit values per request. A method's API credit value calculates based on a method's usage intensity and multiple factors that include using the computational, memory, storage, and network resources.
**The price of our API Credits is pegged to USD**. It means that upon using ANKR tokens for PAYG, `ANKR` calculates into `API Credits` at the latest _ANKR/USD_ exchange rate. > **Our PAYG pricing model:** > **0.10 USD = 1M API Credits** ## Pricing per request: RPC over HTTPS | API Type | Method | API Credits | in USD | |-----------------|-------------|-------------|----------| | EVM-compatible | all methods | 200 | $0.00002 | | Solana | all methods | 500 | $0.00005 | | Beacon Chains | all methods | 700 | $0.00007 | | Other (non-EVM) | all methods | 200 | $0.00002 | | Advanced API | all methods | 700 | $0.00007 | ## Pricing per request: RPC over WSS WebSockets interaction consists of the following actions: * **Subscription**: Establishing WSS connection and subscribing to events. * **Notification**: Receiving notifications from the events you've subscribed to. | Action Type | Chain | API Credits | in USD | |----------------|---------------------|-------------|----------| | Subscription | Solana | 500 | $0.00005 | | | EVM-compatible | 200 | $0.00002 | | Notification | Solana | 500 | $0.00005 | | | Other | 100 | $0.00001 | ## Pricing: gRPC gRPC interaction consists of the following actions: * **Method call**: Establishing gRPC connection using a particular method call. * **Receiving data**: Receiving binary data pertaining to the method you've established connection with. | Action Type | Billing metric | API Credits | in USD | |--------------------------|-------------------|-------------|-----------| | Method call (all chains) | per 1 request | 10 | $0.000001 | | Receiving data | per 1 GB | 5,000,000 | $0.5 | --- url: https://www.ankr.com/docs/rpc-service/regions/ title: Regions & Routing description: Where Ankr serves RPC from — multiple regions across North America, Europe, and Asia-Pacific — and how requests are automatically routed to the nearest healthy region for low latency. Region pinning and dedicated regional nodes are available on Enterprise. source: docs/rpc-service/regions.mdx --- # Regions & Routing Ankr serves RPC from **multiple regions across North America, Europe, and Asia-Pacific**. You connect to a **single global endpoint** and each request is automatically routed to the **nearest healthy region**, so you get low latency without managing region-specific URLs. Need a guaranteed region or isolated capacity? That's available on [Enterprise](/rpc-service/enterprise/). ## Where Ankr serves from | Area | Regions | |---|---| | **North America** | East (New York) · West (Los Angeles) | | **Europe** | Frankfurt | | **Asia-Pacific** | Tokyo · Singapore | These regions back the public and Premium endpoints. The set evolves as we expand — Enterprise customers can also have capacity stood up to meet specific geographic or regulatory needs (see below). ## How routing works - **One endpoint, global routing.** You use the same `rpc.ankr.com` / Premium endpoint everywhere; traffic is directed to the closest region with healthy capacity for your chain. - **Automatic failover.** If a region is degraded, requests are served from the next-best region — you don't change anything. - **No region to configure** on the shared endpoints. Routing is automatic and continuous. :::tip Lowest, most consistent latency On shared endpoints, latency follows wherever you call from. If you need a **pinned region**, **isolated capacity**, or a presence in a specific jurisdiction, that's what [dedicated Enterprise nodes](/rpc-service/enterprise/#dedicated-regional-nodes) are for. ::: ## Region pinning & dedicated nodes (Enterprise) Enterprise plans can run **dedicated nodes in the region(s) you choose**, isolated from the shared pool — useful for predictable latency, data-locality requirements, or high, steady throughput. See [Enterprise](/rpc-service/enterprise/). ## FAQ ### Can I choose which region serves my requests? On the shared public and Premium endpoints, routing is automatic — you're always sent to the nearest healthy region. To pin a specific region, use dedicated [Enterprise](/rpc-service/enterprise/) nodes. ### What happens if a region goes down? Requests automatically shift to the next-best healthy region. There's nothing to reconfigure on your side. ### Do you have a region in my area? Ankr serves from North America, Europe, and Asia-Pacific today, and adds capacity as demand grows. If you need a specific location — including for data-residency or compliance reasons — [contact us about Enterprise](/rpc-service/enterprise/). --- url: https://www.ankr.com/docs/rpc-service/service-plans/ title: Service plans description: Ankr RPC service plans compared: Public, Freemium, Premium, and Enterprise limits, features, and charging models. source: docs/rpc-service/service-plans.mdx --- # Service plans Ankr provides the top-performing globally-distributed enterprise-grade infrastructure of nodes to empower your Web3 projects with blockchain interaction capabilities. Our solutions work under the following Service Plans: * **Public** — public endpoints for free blockchain interaction provided with Public [features](/rpc-service/service-plans/#feature-list) and [rate limits](/rpc-service/service-plans/#rate-limits). * **Premium** — private endpoints for high-performing blockchain interaction provided with Premium [features](/rpc-service/service-plans/#feature-list) and [rate limits](/rpc-service/service-plans/#rate-limits). * **Freemium** — a service plan to try out premium features before going fully Premium. Provides free 200M API credits monthly for API interactions. You have to sign in on the platform without topping up your account balance to access Premium [features](/rpc-service/service-plans/#feature-list) but under Public [rate limits](/rpc-service/service-plans/#rate-limits). * **Enterprise** — customer-tailored solutions for the most demanding blockchain interaction cases.
Here is the list of solutions we have at your disposal on the [Web3 API](https://www.ankr.com/rpc/) platform under the Service Plan you've selected: * *[Node API](/rpc-service/overview/)* — the endpoints that enable your Web3 projects to start interacting with an extensive list of [supported blockchains](/rpc-service/chains/chains-list/), give access to viewing the usage statistics for the data queried, and provide the means for RPC API methods testing. * *[Advanced API](/advanced-api/overview)* — a ready-to-use indexed collection of endpoints that supports simultaneous querying of multiple blockchains (19 mainnet and 7 testnet chains available) for the most popular Web3 scenarios at near-instant speeds; available via [JavaScript](/advanced-api/javascript-sdk)/[Python](/advanced-api/python-sdk) SDKs and [React Hooks](/advanced-api/react-hooks). Advanced API also gives you access to the usage statistics for the data queried. Here is the list of blockchains supported: [Chains Quickstart](/rpc-service/chains/chains-list/). ## Service plans comparison :::tip Advanced API is available for an [authenticated user](/rpc-service/getting-started/basics-premium/#sign-in) only. ::: The `Node API` and `Advanced API` solutions come with both *Public*, *Freemium*, and *Premium* service plans but differ significantly by the rate limits and other performance features supported depending on the plan selected. ### Feature list | Feature | Public | Freemium | Premium | |-----------------------------------------|-----------------------------|-----------------------------|------------------------------------------------------------| | Chains | 40+ | 65+ | 80+ | | Full and Archive data | ✅ | ✅ | ✅ | | Global node coverage | ✅ | ✅ | ✅ | | Node API: | | | | |             Standard | ✅ | ✅ | ✅ | |             Trace | ❌ | ❌ | ✅ | |             Debug | ❌ | ❌ | ✅ | | Advanced API | ❌ | ✅ | ✅ | | Projects (personal API tokens) | ❌ | ✅ (1) | ✅ (3) | | Multi-project statistics | ❌ | ❌ | ✅ | | Team accounts | ❌ | ✅ | ✅ | | Whitelists (IP, domain, smart contract) | ❌ | ❌ | ✅ | | Support *Polkadot*, *Kusama*, & *HECO* | ❌ | ✅ | ✅ | | Batch requests | ✅ | ✅ | ✅ | | Priority order | Limited during high traffic | Limited during high traffic | Prioritized during high traffic | | Connection | HTTPS | HTTPS | HTTPS and WebSocket | | Support | Community Support (Discord) | Community Support (Discord) | Priority Portal Support | | Terms | No Contract | No Contract | Both Contract and No Contract | | Cost | Free | Free 200M API Credits / monthly | [Pay-as-you-go](/rpc-service/service-plans/#pay-as-you-go)
[Deal](/rpc-service/service-plans/#deal) | ### Rate limits | Service | Public | Freemium | Premium | |------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------| | Node API
(EVM/non-EVM chains) | **Requests across all endpoints:**
`≈1800 reqs/min` — guaranteed;
`>1800 reqs/min` — possible
(depends on the load) | **Requests across all endpoints:**
`≈1800 reqs/min` — guaranteed;
`>1800 reqs/min` — possible
(depends on the load) | **Requests per endpoint:**
Up to `≈1.5k reqs/sec` | | Node API
(Solana) | **Requests across all endpoints:**
`≈1800 reqs/min` — guaranteed;
`>1800 reqs/min` — possible
(depends on the load) | **Requests across all endpoints:**
`≈1800 reqs/min` — guaranteed;
`>1800 reqs/min` — possible
(depends on the load) | **Requests per endpoint:**
Up to `≈4k reqs/sec` | | Advanced API | ❌ | `50 reqs/min` (max `500 reqs / 10 min`) | `1k+ reqs/min` | ### Block range / batch size limits | Comparison item | Public | Freemium | Premium | |-----------------------------------------------------|----------|------------|-----------| | Max. batch size (Node API) | `10` | `100` | `1000` | | Max. batch size (Advanced API) | — | `25` | `25` | | Max. block range | `1000` | `3000` | `10000` | | Polygon max. block range (temporary) | `100` | `1000` | `1000` | | BNB Smart Chain max. block range (temporary) | — | `1000` | — | | Monad max. block range ( for `eth_getLogs` only) | `100` | `100` | `1000` | ## Charging models Our Premium service plan users can choose to query blockchain data under the following charging models: * [Pay-as-you-go](/rpc-service/service-plans/#pay-as-you-go) — pay for each request you make. * [Deal](/rpc-service/service-plans/#deal) — monthly subscription with 20% extra credits added on top for any of the Deal options chosen ($500-3,000). ### Pay-as-you-go *Pay-as-you-go* (PAYG) is a usage-based charging model for the Premium Plan services. PAYG means that you commit to no subscriptions but pay for each request you make. The minimum PAYG deposit to start using the Premium Plan features is `10USD` (or equivalent amount in ANKR tokens). ### Deal *Deal* is a subscription-based charging model for the Premium plan services. It is a recurring `500USD` — `3,000USD` payment that provides `20% extra` API credits compared to the same sum spent on *Pay-as-you-go*. The API Credits are to be spent within a month to call both *Node* and *Advanced APIs* for all the chains we support. Next billing period, the Deal monthly quota refreshes. **Deal in a nutshell**: * `500USD` — `3,000USD` monthly API credits with `20% extra` credits added on top of your payment. * Both *Node* and *Advanced APIs* included. * *All chains* covered. ## PAYG pricing **The price of our API Credits is pegged to USD**. It means that upon using ANKR tokens for PAYG, `ANKR` calculates into `API Credits` at the latest _ANKR/USD_ exchange rate. > **Our PAYG pricing model:** > **0.10 USD = 1M API Credits**
### How we charge? For both our Premium plan's charging models — [Pay-as-you-go (PAYG)](/rpc-service/service-plans/#pay-as-you-go) and [Deal](/rpc-service/service-plans/#deal) — we charge per method used in request. Various methods have different API credit values per request. A method's API credit value calculates based on a method's usage intensity and multiple factors that include using the computational, memory, storage, and network resources. We charge no matter whether a request has been successful or not. In other words, a charge is taken for each request coming to our worker, regardless of a node's response. **PAYG/Deal charging summary**: > `Correct call` — `Incorrect call` — `Correct call + incorrect method` — `Correct call + rate limiting` * **Correct call** (charged) — a request uses a supported method and has a valid JSON-RPC structure. * **Incorrect call** (not charged) — a request has an invalid JSON-RPC structure. We can't parse such a request. * **Correct call + incorrect method** (charged default amount) — a request uses an unsupported method though has a valid JSON-RPC structure. We charge default amount of credits for the infrastructure usage. * **Correct call + rate limiting** (not charged): a request uses a supported method and has a valid JSON-RPC structure but receives a `429` error due to rate limiting. ### Pricing per request: RPC over HTTPS | API Type | Method | API Credits | in USD | |-----------------|-------------|-------------|----------| | EVM-compatible | all methods | 200 | $0.00002 | | Solana | all methods | 500 | $0.00005 | | Beacon Chains | all methods | 700 | $0.00007 | | Other (non-EVM) | all methods | 200 | $0.00002 | | Advanced API | all methods | 700 | $0.00007 | ### Pricing per request: RPC over WSS WebSockets interaction consists of the following actions: * **Subscription**: Establishing WSS connection and subscribing to events. * **Notification**: Receiving notifications from the events you've subscribed to. | Action Type | Chain | API Credits | in USD | |----------------|---------------------|-------------|----------| | Subscription | Solana | 500 | $0.00005 | | | EVM-compatible | 200 | $0.00002 | | Notification | Solana | 500 | $0.00005 | | | Other | 100 | $0.00001 | ### Pricing: gRPC gRPC interaction consists of the following actions: * **Method call**: Establishing gRPC connection using a particular method call. * **Receiving data**: Receiving binary data pertaining to the method you've established connection with. | Action Type | Billing metric | API Credits | in USD | |--------------------------|-------------------|-------------|-----------| | Method call (all chains) | per 1 request | 10 | $0.000001 | | Receiving data | per 1 GB | 5,000,000 | $0.5 | --- url: https://www.ankr.com/docs/rpc-service/sla/ title: SLA & service reliability description: Uptime commitments per Ankr service plan: a 99.9% standard SLA with a 10% service credit, 99.99% available as negotiated Enterprise upside, maintenance policy, and where to watch live service health. source: docs/rpc-service/sla.mdx --- # SLA & service reliability Ankr operates a globally distributed, multi-region RPC infrastructure. The **standard contractual SLA is 99.9% monthly uptime with a 10% service credit**; **99.99% is available as negotiated upside** for qualifying Enterprise deployments. What is contractually committed depends on your service plan. ## Commitments per plan | Plan | Commitment | |---|---| | **Public** | Best-effort. Free public endpoints carry no contractual SLA and are subject to [Public rate limits](/rpc-service/service-plans/#rate-limits). | | **Premium (PAYG)** | Runs on the same multi-region infrastructure with private endpoints and priority routing. No individual SLA contract is attached to self-serve accounts. | | **Enterprise** | **Standard contractual uptime SLA of 99.9%, with a 10% service credit** for missed availability, defined in your agreement. **99.99% is available as negotiated upside** for qualifying deployments. Includes 24/7 support. | ## How uptime is measured - Availability is measured per chain, per endpoint, over a calendar month. - **Scheduled maintenance** is excluded — maintenance windows are announced in advance through the status page. - Force-majeure events are handled per the terms of your agreement. ## Service credits (Enterprise) Enterprise agreements define service credits — a percentage of the monthly fee credited to a future invoice — when measured uptime falls below the committed level in a given month. To claim a credit, contact your account manager or [support](https://ankrnetwork.atlassian.net/servicedesk/customer/portal/10) with the incident dates and any corroborating logs. ## Live service health - [RPC health dashboard](https://www.ankr.com/rpc/health/) — live per-chain health of the public RPC surface, plus incidents and maintenance status. ## Related - [Service plans](/rpc-service/service-plans/) — what each plan includes. - [Charging policy](/rpc-service/charging-policy/) — billing, balance, and what happens when credits run out. - [Trust & compliance](/trust/overview/) — certifications and security posture. --- url: https://www.ankr.com/docs/rpc-service/torpc/ title: TORPC: token-efficient JSON-RPC description: Ask Ankr RPC for decoded, compressed JSON-RPC responses with one header. ABI-decoded logs, decimal numbers, no logsBloom. A measured transaction receipt came back 63% smaller. source: docs/rpc-service/torpc.mdx --- # TORPC: token-efficient JSON-RPC **TORPC is a response-compression layer on top of ordinary JSON-RPC. You ask for it with one request header, and the answer comes back decoded: event logs as named arguments, hex numbers as decimals, and the fields nothing reads dropped.** It is the layer underneath [Agent RPC MCP](/rpc-service/mcp/agent-rpc/), but it is not tied to it. Any HTTP client can use it, including `curl`, so you do not need an MCP server or an AI agent to benefit — you need one header. ## Why it exists A model that reads raw JSON-RPC pays twice: once for hex it cannot interpret, and again for the reasoning it spends turning that hex into meaning. A transfer log arrives as an `address`, three `topics` and a `data` blob, and the model has to know the ABI, know that `topics[0]` is the event signature hash, and do the arithmetic — for every log, on every call. TORPC does that decode once, on the way out. ## Negotiation | | | | --- | --- | | Request header | `Accept-Token-Tier: 0 \| 1 \| 2` | | Response header | `Token-Tier: ` | | Endpoint | `https://rpc.ankr.com//` | | Tier | What you get | | --- | --- | | `0` | passthrough — standard JSON-RPC, unchanged | | `1` | hex converted to decimal, plus field renaming | | `2` | full — ABI decode of functions and events into named arguments, log collapse, `logsBloom` dropped, hex to decimal | **The tier is negotiated per call and is not guaranteed.** The proxy applies what you asked for only while the response stays inside its compression budget. A response above that budget comes back at tier 0, raw and undecoded, whatever the request said. Always read the `Token-Tier` response header before looking for decoded fields — it reports what was actually applied, not what was requested. ## A real request, and a real answer Measured against production. Same transaction receipt, same chain, one header apart. ```bash # Tier 0: ordinary JSON-RPC curl -s https://rpc.ankr.com/eth/$ANKR_API_KEY \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionReceipt","params":["0x3fe1022b421843ffa01e84de3eac55250884632c8bee8223e8046a53cab52dc1"]}' ``` One of its three logs, as it arrives: ```json { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000e0554a476a092703abdb3ef35c80e0d76d32939f", "0x00000000000000000000000051c72848c68a965f66fa7a88855f9f7784502a7f" ], "data": "0x0000000000000000000000000000000000000000000000004a68c830d8576f68", "blockHash": "0xb691f4dfb600f43e585cb859366eda914967b2c59a54fa28789c1420d409825c", "blockNumber": "0x188c3aa", "blockTimestamp": "0x6a7ca35f", "logIndex": "0x0", "removed": false } ``` ```bash # Tier 2: one header added curl -s https://rpc.ankr.com/eth/$ANKR_API_KEY \ -H 'Content-Type: application/json' \ -H 'Accept-Token-Tier: 2' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionReceipt","params":["0x3fe1022b421843ffa01e84de3eac55250884632c8bee8223e8046a53cab52dc1"]}' ``` The same log, decoded: ```json { "event": "Transfer", "contract": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "args": { "from": "0xE0554a476A092703abdB3Ef35c80e0D76d32939F", "to": "0x51C72848c68a965f66FA7a88855F9f7784502a7F", "value": "5361755468498169704" } } ``` The receipt's own fields are renamed and de-hexed the same way — `block`, `block_hash`, `gas_used`, `gas_price`, `tx`, `tx_index` — and `logsBloom`, 514 characters of it, is gone because nothing downstream reads it. **The whole response went from 3,182 bytes to 1,177**, a 63% reduction, and the response carried `Token-Tier: 2`. :::note Amounts are raw base units `"value": "5361755468498169704"` is 5.36 WETH, not 5.36 × 10¹⁸ of anything. TORPC decodes the ABI; it does not apply token decimals, because that needs a second call to the contract. Read `decimals()` before showing a human number. ::: ## Which methods get full tier 2 Full ABI decode applies to the methods that carry logs and transactions: `eth_getTransactionByHash`, `eth_getTransactionReceipt`, `eth_getBlockByHash`, `eth_getBlockByNumber`, `eth_getBlockReceipts`, `eth_getLogs`, `eth_getTransactionByBlockHashAndIndex`, `eth_getTransactionByBlockNumberAndIndex`. Not supported, and passed through unchanged: `eth_call`, `eth_getCode`, `eth_getStorageAt`. These return opaque bytes whose meaning depends on an ABI the proxy has no way to know. Every other method still works — it is ordinary JSON-RPC, and it answers at tier 0. ## Discovery A machine-readable descriptor of all of the above — protocol version, negotiation headers, tier meanings and the method lists — ships as `.well-known/torpc.json` in the server's public repository. It is a file, not a served endpoint: do not fetch it from `rpc.ankr.com` or `mcp.ankr.com`, neither of which serves it. There is also a legacy request-header alias, `Rpc-Compress`, accepted for clients written before the header was renamed. New clients should send `Accept-Token-Tier`. ## Using it from an agent If you are pointing an AI agent at chain data, [Agent RPC MCP](/rpc-service/mcp/agent-rpc/) asks for tier 2 on every read for you, reports the applied tier in each result, and adds paging, display caps and a real token count per response. TORPC is what makes those responses small; the MCP server is what makes them convenient. ## Next * [Agent RPC MCP](/rpc-service/mcp/agent-rpc/) — the hosted MCP server built on this protocol. * [Management MCP](/rpc-service/mcp/management/) — accounts, keys and usage for agents. * [Chains list](/rpc-service/chains/chains-list/) — where to point ``. --- url: https://www.ankr.com/docs/advanced-api/javascript-sdk/ title: Ankr.js SDK description: Ankr.js SDK contains a compact JavaScript library to enable you to interact with Advanced API. 1. Install the latest package stored on npm. 2. Initialize the. source: docs/advanced-api/javascript-sdk.mdx --- # Ankr.js SDK _Ankr.js SDK_ contains a compact JavaScript library to enable you to interact with [Advanced API](/advanced-api/overview/). ## Get started 1. Install the latest package stored on [npm](https://www.npmjs.com/package/@ankr.com/ankr.js). ```shell # with npm npm install @ankr.com/ankr.js # with yarn yarn add @ankr.com/ankr.js ``` 2. Initialize the SDK. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [RPC Service](https://www.ankr.com/rpc/) platform, get your individual endpoint from the [Advanced API](https://www.ankr.com/rpc/advanced-api) pane, and provide it to the `AnkrProvider` constructor. ```javascript import { AnkrProvider } from '@ankr.com/ankr.js'; const provider = new AnkrProvider('YOUR_ENDPOINT'); ``` 3. Use the provider to call either of the supported methods. ```javascript await provider.getNFTsByOwner({ blockchain: 'eth', walletAddress: '0x0E11A192d574b342C51be9e306694C41547185DD', }); ``` ## Chains supported Currently, `ankr.js` supports interaction with the following chains using their aliases: **Mainnet**: * Arbitrum: `arbitrum`. * Avalanche: `avalanche`. * Base: `base`. * BNB Smart Chain: `bsc`. * Ethereum: `eth`. * Fantom: `fantom`. * Flare: `flare`. * Gnosis: `gnosis`. * Linea: `linea`. * Optimism: `optimism`. * Polygon: `polygon`. * Scroll: `scroll`. * Story: `story_mainnet`. * Syscoin: `syscoin`. * Taiko: `taiko`. * Telos: `telos`. * Xai: `xai`. * X Layer: `xlayer` **Testnet**: * Avalanche Fuji: `avalanche_fuji`. * Base Sepolia: `base_sepolia`. * Ethereum Holesky: `eth_holesky`. * Ethereum Sepolia: `eth_sepolia`. * Optimism Testnet: `optimism_testnet`. * Polygon Amoy: `polygon_amoy`. * Story Testnet: `story_aeneid_testnet`. ## Methods supported * [`getLogs`](/advanced-api/javascript-sdk/#getlogs) — retrieves the logs matching the filter indicated. * [`getBlocks`](/advanced-api/javascript-sdk/#getblocks) — retrieves the data on the blocks within the indicated range. * [`getTransactionsByHash`](/advanced-api/javascript-sdk/#gettransactionsbyhash) — retrieves transaction details for a transaction specified by hash. * [`getAccountBalance`](/advanced-api/javascript-sdk/#getaccountbalance) — retrieves the coin and token balances of the wallet specified. * [`getNFTsByOwner`](/advanced-api/javascript-sdk/#getnftsbyowner) — retrieves the data on all the NFTs (collectibles) owned by the indicated wallet. * [`getTokenHolders`](/advanced-api/javascript-sdk/#gettokenholders) — retrieves the list of token holders for a given contract address. * [`getTokenHoldersCount`](/advanced-api/javascript-sdk/#gettokenholderscount) — retrieves current and historical data on the number of token holders for a given contract address. * [`getCurrencies`](/advanced-api/javascript-sdk/#getcurrencies) — retrieves a list of supported currencies for a given blockchain. * [`getTokenPriceHistory`](/advanced-api/javascript-sdk/#gettokenpricehistory) — retrieves the particular token's price history on the chain specified. ### `getLogs` Retrieves the logs matching the filter indicated. ```javascript const logs = async () => { return await provider.getLogs({ blockchain: 'eth', fromBlock: 1181739, toBlock: 1181739, topics: [ [], ['0x000000000000000000000000feb92d30bf01ff9a1901666c5573532bfa07eeec'], ], address: '0x3589d05a1ec4af9f65b0e5554e645707775ee43c', decodeLogs: false, }); }; ``` --- ### `getBlocks` Retrieves the data on the blocks within the indicated range. ```javascript const blocks = async () => { return await provider.getBlocks({ blockchain: 'bsc', fromBlock: 100, toBlock: 200, }); }; ``` --- ### `getTransactionsByHash` Retrieves transaction details for a transaction specified by hash. ```javascript const transactions = async () => { return await provider.getTransactionsByHash({ transactionHash: '0x82c13aaac6f0b6471afb94a3a64ae89d45baa3608ad397621dbb0d847f51196f', decodeTxData: true, }); }; ``` --- ### `getAccountBalance` Retrieves the coin and token balances of the wallet specified. ```javascript const balances = async () => { return await provider.getAccountBalance({ blockchain: 'eth', walletAddress: '0xfa9019df60d3c710d7d583b2d69e18d412257617', }); }; ``` --- ### `getNFTsByOwner` Retrieves the data on all the NFTs (collectibles) owned by the indicated wallet. ```javascript const nfts = async () => { return await provider.getNFTsByOwner({ blockchain: 'eth', walletAddress: '0x0E11A192d574b342C51be9e306694C41547185DD', filter: [ { '0x700b4b9f39bb1faf5d0d16a20488f2733550bff4': [] }, { '0xd8682bfa6918b0174f287b888e765b9a1b4dc9c3': ['8937'] }, ], }); }; ``` --- ### `getTokenHolders` Retrieves the list of token holders for a given contract address. ```javascript const tokenHolders = async () => { return await provider.getTokenHolders({ blockchain: 'eth', contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7', }); }; ``` --- ### `getTokenHoldersCount` Retrieves current and historical data on the number of token holders for a given contract address. ```javascript const tokenHoldersCount = async () => { return await provider.getTokenHoldersCount({ blockchain: 'eth', contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7', }); }; ``` --- ### `getCurrencies` Retrieves a list of supported currencies for a given blockchain. ```javascript const currencies = async () => { return await provider.getCurrencies({ blockchain: 'fantom' }); }; ``` --- ### `getTokenPriceHistory` Retrieves the particular token's price history on the chain specified. Either of the timestamp parameters MUST be provided to build a successful request — indicating both parameters leads to an error: * `fromTimestamp` corresponds to the time range starting from the timestamp specified in seconds (included in the range) and moving forward in time by the number of `interval`s. The number of fetched history prices can't exceed the `limit` specified. * `toTimestamp` corresponds to the time range starting from the timestamp specified in seconds (included in the range) and moving backward in time by the number of `interval`s. The number of fetched history prices can't exceed the `limit` specified. ```javascript const prices = async () => { return await provider.getTokenPriceHistory({ blockchain: "eth", contractAddress: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", fromTimestamp: 1667195581, interval: 86400, // 24h limit: 337 }); }; ``` --- url: https://www.ankr.com/docs/advanced-api/nft-methods/ title: NFT API description: NFT API serves to request NFT-related data (owners, listings for particular wallet addresses, collections, time it's been minted, transaction history, and ot. source: docs/advanced-api/nft-methods.mdx --- # NFT API :::note _NFT API_ is an Advanced API's collection of methods that comes as a unique feature along with other extensive capabilities provided to our [Premium Plan](/rpc-service/service-plans/#service-plans-comparison) users. ::: _NFT API_ serves to request NFT-related data (owners, listings for particular wallet addresses, collections, time it's been minted, transaction history, and other metadata) across multiple EVM-compatible chains. NFT API empowers the Web3 projects integrating NFTs (virtual worlds, decentralized games, galleries, marketplaces) to instantly fetch all the necessary information across multiple blockchains in a single request. NFT API implements the [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification) for interaction. ## NFT API Methods _NFT API_ consists of the following methods to request NFT-related data across multiple chains: * [`ankr_getNFTsByOwner`](/advanced-api/nft-methods/#ankr_getnftsbyowner) — retrieves account-associated NFTs. * [`ankr_getNFTMetadata`](/advanced-api/nft-methods/#ankr_getnftmetadata) — retrieves metadata of a particular NFT. * [`ankr_getNFTHolders`](/advanced-api/nft-methods/#ankr_getnftholders) — retrieves holders of a particular NFT. * [`ankr_getNftTransfers`](/advanced-api/nft-methods/#ankr_getnfttransfers) — retrieves NFT transfers info of a particular address. > Prefer interactive docs? See our [OpenAPI specification](https://www.ankr.com/docs/advanced-api/specification/) for NFT API methods. ## `ankr_getNFTsByOwner` > **Retrieves the account's NFT data.** Retrieves a list of NFTs (ERC721/ERC1155/ENS/POAP) that belong to the particular account specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `walletAddress` (string; required): an account address to query for NFTs; supports the Ethereum Name Service (ENS). * `blockchain` (string): a chain or a combination of chains to query: * Single chain: `arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`. * Chains combination: `[arbitrum, avalanche, base, bsc, eth, fantom, flare, gnosis, linea, optimism, polygon, scroll, story_mainnet, syscoin, taiko, telos, xai, xlayer, avalanche_fuji, base_sepolia, eth_holesky, eth_sepolia, optimism_testnet, polygon_amoy, story_aeneid_testnet]`. * All chains: leave the value empty to query all the chains available. * `pageSize` (int32): a number of page results you'd like to get (default=10, max=50). * `pageToken` (string): a token is provided at the end of the response body and can be referenced in the request to fetch the next page. * `filter` (key-value): Filters your request by either of the following: * Smart contract address (`"0xd8682bfa6918b0174f287b888e765b9a1b4dc9c3": [] `) — retrieves all NFTs from the address. * Smart contract address and NFT ID (`"0xd8682bfa6918b0174f287b888e765b9a1b4dc9c3": ["8937"]`) — retrieves a particular NFT specified. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getNFTsByOwner", "params": { "blockchain": [ "string" ], "filter": [ { "additionalProp1": [ "string" ], "additionalProp2": [ "string" ], "additionalProp3": [ "string" ] } ], "pageSize": 0, "pageToken": "string", "walletAddress": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns all the NFTs that belong to the account address specified by request body parameters. #### Parameters A successful response contains the following parameters: * `id` (int64; required): * `jsonrpc` (string; required): * `result` (object): the data object containing a list of NFT assets and their metadata: * `blockchain` (string; required): one of the supported chains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). * `collectionName` (string): a collection name the NFT asset belongs to. * `contractAddress` (string): an NFT collection's EVM-compatible contract address. * `contractType` (int32): a type of the contract — either ERC721 or ERC1155. * `name` (string): a name of the NFT asset. * `tokenId` (string): an ID of the NFT asset. * `imageUrl` (string): a URL that points to the actual digital file, usually an IPFS link. * `symbol` (string): a symbol of the NFT asset. * `traits` (array): an attribute of the NFT asset. * `trait_type` (string): a trait's descriptive name. * `value` (string): a value description. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getNFTsByOwner", "params": { "blockchain": ["eth"], "walletAddress": "0x0E11A192d574b342C51be9e306694C41547185DD", "pageSize": 2, "pageToken": "", "filter": [ { "0x700b4b9f39bb1faf5d0d16a20488f2733550bff4": [] }, { "0xd8682bfa6918b0174f287b888e765b9a1b4dc9c3": ["8937"] } ] }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "assets": [ { "blockchain": "string", "collectionName": "string", "contractAddress": "string", "contractType": 0, "imageUrl": "string", "name": "string", "quantity": "string", "symbol": "string", "tokenId": "string", "tokenUrl": "string", "traits": [ { "bunny_id": "string", "count": 0, "display_type": "string", "frequency": "string", "mp_score": "string", "rarity": "string", "trait_type": "string", "value": "string" } ] } ], "nextPageToken": "string", "owner": "string" } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "owner": "0x0e11a192d574b342c51be9e306694c41547185dd", "assets": [ { "blockchain": "eth", "name": "Happy Bunny #555", "tokenId": "555", "imageUrl": "https://ipfs.io/ipfs/QmSRkmEDKWUeHi5FiNpQUBAcCq7rKinhf5Pbu8ZPZNkP8r/555", "collectionName": "Happy Bunnies", "symbol": "BUNNY", "contractType": "ERC721", "contractAddress": "0x700b4b9f39bb1faf5d0d16a20488f2733550bff4", "traits": [ { "trait_type": "Background", "value": "Green Background" }, { "trait_type": "Body", "value": "Black Pearl Necklace" }, { "trait_type": "Eyes", "value": "Sad Eyes" }, { "trait_type": "Face", "value": "Right Ear Band" }, { "trait_type": "Mouth", "value": "Small Smile" }, { "trait_type": "Skin", "value": "Pink" } ] }, { "blockchain": "eth", "name": "Happy Bunny #6907", "tokenId": "6907", "imageUrl": "https://ipfs.io/ipfs/QmSRkmEDKWUeHi5FiNpQUBAcCq7rKinhf5Pbu8ZPZNkP8r/6907", "collectionName": "Happy Bunnies", "symbol": "BUNNY", "contractType": "ERC721", "contractAddress": "0x700b4b9f39bb1faf5d0d16a20488f2733550bff4", "traits": [ { "trait_type": "Background", "value": "Light Blue Background" }, { "trait_type": "Body", "value": "Pirate Tanktop" }, { "trait_type": "Eyes", "value": "Small Point Eyes" }, { "trait_type": "Face", "value": "Light Blue Cap" }, { "trait_type": "Mouth", "value": "Annoyed Mouth" }, { "trait_type": "Skin", "value": "Yellow" } ] }, { "blockchain": "eth", "name": "Moon Boyz #8937", "tokenId": "8937", "imageUrl": "https://moon-boyz-api-do.com/metadata/8937", "collectionName": "The Moon Boyz", "symbol": "MOONBOYZ", "contractType": "ERC721", "contractAddress": "0xd8682bfa6918b0174f287b888e765b9a1b4dc9c3", "traits": [ { "trait_type": "Background", "value": "Graphic Moon" }, { "trait_type": "Suits", "value": "Body Suit Iridescent Purple" }, { "trait_type": "Lines", "value": "Lines Suit Blue" }, { "trait_type": "Pocket", "value": "Pocket Silver" }, { "trait_type": "Helmet Close", "value": "Rare Irdiescent Dark Blue" }, { "trait_type": "Ear", "value": "Lightning Red" }, { "trait_type": "Visor", "value": "Black" }, { "trait_type": "Hologram", "value": "Original Heart" } ] } ], "nextPageToken": "BjxaEQyvWry96Z7VXNrffspsVkXZ8PXkMEc8epttW3Jn8JvEx2mF25WLU2cndjitQE4iDiECmMpVBwfPQ8b9hVabmBXipuN6y3gqzgWUbCCWAR2Lv99dF4QgbcANVeaqs7hGDAo" } } ``` --- ## `ankr_getNFTMetadata` > **Retrieves the NFT's metadata.** Retrieves the metadata that belongs to a particular NFT (ERC721/ERC1155/ENS/POAP). ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters. * `blockchain` (string; required): either of the supported chains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). * `contractAddress` (string): an address of the NFT contract the metadata belongs to; supports the Ethereum Name Service (ENS). * `forceFetch` (boolean): source of NFT metadata — `true` the contract, `false` the database. * `skipSyncCheck` (boolean): if set to `true`, the info will be returned regardless of indexer health. * `tokenId` (integer): a token ID of the NFT the metadata belongs to. Created by the contract when minting the NFT. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getNFTMetadata", "params": { "contractAddress": "0x8d01c8ee82e581e55c02117a676b5bbd4734fabb", "forceFetch": true, "skipSyncCheck": true, "tokenId": "23240", "blockchain": "avalanche" }, } ``` ```shell Content-Type: application/json ``` ### Response A successful request returns, along with the general parameters, the `result` object containing metadata info on the NFT specified by request parameters. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `result` (object): the data object containing the NFT metadata and NFT attributes: * `metadata` (object): the data object containing the NFT metadata: * `blockchain` (string; required): one of the supported chains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). * `contractAddress` (string): a contract address of the NFT Collection; supports the Ethereum Name Service (ENS). * `contractType` (string): a contract type of the NFT the metadata belongs to (example: ERC721, ERC1155). * `tokenId` (string): a token ID of the NFT the metadata belongs to (example: 7822). * `attributes`: an object containing additional information on the NFT: * `contractType` (string): a contract type of the NFT the metadata belongs to (example: ERC721, ERC1155). * `tokenUrl` (string): a URL that points to the place storing an NFT's metadata (example: [https://live---metadata-5covpqijaa-uc.a.run.app/metadata/7822](https://live---metadata-5covpqijaa-uc.a.run.app/metadata/7822)) * `imageUrl` (string): a URL that points to the actual digital file, usually an IPFS link (example: [https://live---metadata-5covpqijaa-uc.a.run.app/images/7822](https://live---metadata-5covpqijaa-uc.a.run.app/images/7822)) * `name` (string): a name of the token (example: Rock 23240). * `description` (string): a description of the NFT (example: A very angry NFT bird). * `traits`: an array of pre-defined NFT traits: * `trait_type` (string): a specific type of traits (example: Eyes). * `value` (string): a specific value of traits (example: Angry). ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getNFTMetadata", "params": { "blockchain": "avalanche", "contractAddress": "0x8d01c8ee82e581e55c02117a676b5bbd4734fabb", "tokenId": "23240" }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "attributes": { "contractType": 0, "description": "string", "imageUrl": "string", "name": "string", "tokenUrl": "string", "traits": [ { "bunny_id": "string", "count": 0, "display_type": "string", "frequency": "string", "mp_score": "string", "rarity": "string", "trait_type": "string", "value": "string" } ] }, "metadata": { "blockchain": "string", "collectionName": "string", "collectionSymbol": "string", "contractAddress": "string", "contractType": 0, "tokenId": "string" } } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "metadata": { "blockchain": "avalanche", "contractAddress": "0x8d01c8ee82e581e55c02117a676b5bbd4734fabb", "tokenId": "23240", "contractType": "ERC721" }, "attributes": { "tokenUrl": "https://ipfs.io/ipfs/QmYen4cGUc3gF9UQnCycq2AADYLYzoM6mvVzoajAXTr7vH/rock23240.json", "imageUrl": "https://ipfs.io/ipfs/QmPktcEDiRD9qNwc497mwQkJ3zYFQtHwFooPLkgDdRqU4R/23240.png", "name": "Rock 23240", "description": "Rock #23240, can be used to play Rock Game", "traits": [ { "trait_type": "face", "value": "Brown" }, { "trait_type": "nose", "value": "Regular Nose" }, { "trait_type": "mouth", "value": "Chinstrap" }, { "trait_type": "eyes", "value": "Big Shades" }, { "trait_type": "hair", "value": "Stringy Hair" }, { "trait_type": "accessories", "value": "Earring" } ], "contractType": "ERC721" } } } ``` --- ## `ankr_getNFTHolders` > **Retrieves the NFT's holders data.** Retrieves a list of holders (wallet addresses) of the NFT specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters. * `blockchain` (string; required): either of the supported blockchains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). * `contractAddress` (string): a contract address of the NFT collection; supports the Ethereum Name Service (ENS). * `pageSize` (integer): a number of results you'd like to get (max: `10000`, default: `1000`). * `pageToken` (string): a current page token provided at the end of the response body; can be referenced in the request to fetch the next page. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getNFTHolders", "params": { "blockchain": "string", "contractAddress": "string", "pageSize": 0, "pageToken": "string" } } ``` ```shell Content-Type: application/json ``` ### Response A successful request returns a list of holders for the NFT specified. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `result` (object): the data object containing a holder of the NFT specified by request parameters: * `holder` (string): a list of holders. * `nextPageToken` (string): a token is provided at the end of the response body and can be referenced in the request to fetch the next page. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getNFTHolders", "params": { "blockchain": "arbitrum", "contractAddress": "0xc36442b4a4522e871399cd717abdd847ab11fe88", "pageSize": 10, "pageToken": "" }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "holders": [ "string" ], "nextPageToken": "string" } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "holders": [ "0x000000000000000000000000000000000000dEaD", "0x00000000000a29A0800f6F557ddbbe8249397dE7", "0x00000000005dbcB0d0513FcDa746382Fe8a53468", "0x0000000000F485A774ee60343AD3aC6D05d95Fba", "0x0000000813B34008A225De08a6a61835508C71f9", "0x00000010cfed5b9e642901Be70FE7f5C8104411e", "0x0000006D14cE3CF81449c3BA1f26108DF0A4de8b", "0x00000744009F1240f4218D6Ad4112AD257A28888", "0x00002B503a75998C97508916A74Fdb41934Fa030", "0x00005A06017eB8931b7FDAe82Bce8EB6852282b3" ], "nextPageToken": "CA9QXqcwG5vQJxibSKdvTFikDeCznM8nzB5PCHNdGjaG1cajS9XdDh2nGALCfcyNqTspvpqPPEtVV4s" } } ``` --- ## `ankr_getNftTransfers` > **Retrieves info on NFT transfers.** Retrieves info on NFT transfers for an address specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters. * `address` (array of strings; required): an address (or list of addresses) to search for transactions. * `blockchain` (array of strings): either of the supported blockchains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). * `descOrder` (boolean): choose data order, either descending (if `true`) or ascending (if `false`). * `fromBlock` (integer): narrow your search indicating the block number to start from (inclusive; `>= 0`). * `toBlock` (integer): narrow your search indicating the block number to end with (inclusive; `>= 0`). * `fromTimestamp` (integer): narrow your search indicating the timestamp to start from (inclusive; `>= 0`). * `toTimestamp` (integer): narrow your search indicating the timestamp to end with (inclusive; `>=0`). * `pageSize` (integer): a number of result pages you'd like to get (max: `10000`, default: `100`). * `pageToken` (string): a current page token provided at the end of the response body; can be referenced in the request to fetch the next page. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getNftTransfers", "params": { "address": "string", "blockchain": ["string"], "fromTimestamp": 0, "pageSize": 0, "toTimestamp": 0 } } ``` ```shell Content-Type: application/json ``` ### Response A successful request returns information on transfers for an address specified. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "id": 1, "jsonrpc": "2.0", "method": "ankr_getNftTransfers", "params": { "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "blockchain": [ "bsc" ], "fromTimestamp": 1655197483, "pageSize": 2, "toTimestamp": 1671974699 } }' ``` #### Response Code: 200 OK ```json { "id": 1, "jsonrpc": "2.0", "result": { "transfers": [ { "blockHeight": 19116577, "blockchain": "bsc", "collectionName": "", "collectionSymbol": "", "contractAddress": "0x36f8f51f65fe200311f709b797baf4e193dd0b0d", "fromAddress": "0x186ea56f0a40c5593a697b3e804968b8c5920ff3", "imageUrl": "", "name": "", "timestamp": 1656519782, "toAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "tokenId": "12", "transactionHash": "0x95ae64003124fe4c3e8702364136d25c3d0f2fdbbf953bd815785f06d5cb6025", "type": "ERC1155", "value": "1" }, { "blockHeight": 19357744, "blockchain": "bsc", "collectionName": "CheersBio Capsule", "collectionSymbol": "CBC", "contractAddress": "0x999017cb5652caf5f324a8e44f813903ba3c46eb", "fromAddress": "0x0000000000000000000000000000000000000000", "imageUrl": "https://ipfs.io/ipfs/QmZCS7HtmQZtUPLTR1LaLhCwW5W22c1jCociw7Pvi3Autg", "name": "RSS3 Chain Friends #36957", "timestamp": 1657244377, "toAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "tokenId": "36957", "transactionHash": "0xac2d856630eb80270a3b75538977832ac6d7c19100f41b804d3c100958bcb3ab", "type": "ERC721", "value": "1" } ] } } ``` --- url: https://www.ankr.com/docs/advanced-api/overview/ title: Overview description: Start using Advanced API on the Web3 API platform. Advanced API is a specifically-tailored collection of JSON-RPC API endpoints built to support the most p. source: docs/advanced-api/overview.mdx --- # Overview :::tip Available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: > Start using Advanced API on the [Web3 API platform](https://www.ankr.com/rpc/advanced-api/). > Need standard per-chain JSON-RPC (`eth_call`, `eth_getLogs`, …)? That's the [Chain RPC API](/rpc-service/chains/chains-list/). The full [API Reference](/api-reference/) covers both. *Advanced API* is a specifically-tailored collection of JSON-RPC API endpoints built to support the most popular Web3 scenarios on multiple chains at almost instant speeds. We believe it to become a single point of reference for the multi-chain requests.
Advanced API optimizes, indexes, caches, and stores blockchain data to make it access-ready for you. To make things even better, our Advanced API supports querying across multiple mainnet and testnet chains in a single request. ## Chains Supported :::tip Before making calls, verify the required method's supported chains in its documentation. ::: Currently, Advanced API supports querying the following chains using their aliases: **Mainnet**: * Arbitrum: `arbitrum`. * Avalanche: `avalanche`. * Base: `base`. * BNB Smart Chain: `bsc`. * Ethereum: `eth`. * Fantom: `fantom`. * Flare: `flare`. * Gnosis: `gnosis`. * Linea: `linea`. * Optimism: `optimism`. * Polygon: `polygon`. * Scroll: `scroll`. * Story: `story_mainnet`. * Syscoin: `syscoin`. * Taiko: `taiko`. * Telos: `telos` * Xai: `xai`. * X Layer: `xlayer` **Testnet**: * Avalanche Fuji: `avalanche_fuji`. * Base Sepolia: `base_sepolia` * Ethereum Holesky: `eth_holesky`. * Ethereum Sepolia: `eth_sepolia`. * Optimism Testnet: `optimism_testnet`. * Polygon Amoy: `polygon_amoy`. * Story Testnet: `story_aeneid_testnet`. :::note **Stellar** is served through a separate `stellar_*` namespace (`stellar_getTokenPrice`, `stellar_getAccountBalance`, `stellar_getEvents`) with its own address format (Strkey `G…` / `C…`) and token model (`SAC`) — it is **not** a `blockchain` value on the `ankr_*` methods below. In these methods the `blockchain` parameter value is `stellar_soroban`. See the [Stellar (Soroban) API reference](/api-reference/aapi/stellar-soroban-api/). ::: ## AAPI Methods Supported ### NFT API [_NFT API Methods_](/advanced-api/nft-methods/) serve to request NFT-related data across multiple chains: * [`ankr_getNFTsByOwner`](/advanced-api/nft-methods/#ankr_getnftsbyowner) — retrieves an account-associated NFTs. * [`ankr_getNFTMetadata`](/advanced-api/nft-methods/#ankr_getnftmetadata) — retrieves metadata of a particular NFT. * [`ankr_getNFTHolders`](/advanced-api/nft-methods/#ankr_getnftholders) — retrieves holders of a particular NFT. * [`ankr_getNftTransfers`](/advanced-api/nft-methods/#ankr_getnfttransfers) — retrieves NFT transfers info of a particular address. > Prefer interactive docs? See our [interactive API Reference](/api-reference/aapi/nft-api/) for NFT API methods. ### Query API [_Query API Methods_](/advanced-api/query-methods/) serve to request info on the ranges of blocks (max range is 100) for a full list of block metadata: * [`ankr_getBlockchainStats`](/advanced-api/query-methods/#ankr_getblockchainstats) — retrieves blockchain statistics. * [`ankr_getBlocks`](/advanced-api/query-methods/#ankr_getblocks) — retrieves full info of a particular block. * [`ankr_getLogs`](/advanced-api/query-methods/#ankr_getlogs) — retrieves history data of a particular block range. * [`ankr_getTransactionsByHash`](/advanced-api/query-methods/#ankr_gettransactionsbyhash) — retrieves the details of a transaction specified by hash. * [`ankr_getTransactionsByAddress`](/advanced-api/query-methods/#ankr_gettransactionsbyaddress) — retrieves the details of a transaction specified by wallet address. * [`ankr_getInteractions`](/advanced-api/query-methods/#ankr_getinteractions) — retrieves blockchains interacted with a particular wallet. > Prefer interactive docs? See our [interactive API Reference](/api-reference/aapi/query-api/) for Query API methods. ### Token API [_Token API Methods_](/advanced-api/token-methods/) serve to request token-related data across multiple chains: * [`ankr_getAccountBalance`](/advanced-api/token-methods/#ankr_getaccountbalance) — retrieves the balance of a particular account. * [`ankr_getCurrencies`](/advanced-api/token-methods/#ankr_getcurrencies) — retrieves a list of currencies used on a particular blockchain. * [`ankr_getTokenPrice`](/advanced-api/token-methods/#ankr_gettokenprice) — retrieves the price of a particular token. * [`ankr_getTokenHolders`](/advanced-api/token-methods/#ankr_gettokenholders) — retrieves info on holders of a particular token. * [`ankr_getTokenHoldersCount`](/advanced-api/token-methods/#ankr_gettokenholderscount) — retrieves the number of token holders. * [`ankr_getTokenTransfers`](/advanced-api/token-methods/#ankr_gettokentransfers) — retrieves token transfers info. * [`ankr_getTokenPriceHistory`](/advanced-api/token-methods/#ankr_gettokenpricehistory) — retrieves the historical price of the token specified. > Prefer interactive docs? See our [interactive API Reference](/api-reference/aapi/token-api/) for Token API methods. ## Advanced API PAYG Pricing The price of our API Credits is pegged to USD. It means that upon using ANKR tokens for PAYG, `ANKR` calculates into `API Credits` at the latest _ANKR/USD_ exchange rate. > Our PAYG pricing model: > 0.10 USD = 1M API Credits | API Collection | Method | API Credits | USD/request | |----------------|---------------------------------------------|-------------|-------------| | NFT API | `ankr_getNFTsByOwner` | 700 | $0.00007 | | | `ankr_getNFTMetadata` | 700 | $0.00007 | | | `ankr_getNFTHolders` | 700 | $0.00007 | | | `ankr_getNftTransfers` | 700 | $0.00007 | | Query API | `ankr_getBlockchainStats` | 700 | $0.00007 | | | `ankr_getBlocks` | 700 | $0.00007 | | | `ankr_getLogs` | 700 | $0.00007 | | | `ankr_getTransactionsByHash` | 700 | $0.00007 | | | `ankr_getTransactionsByAddress` | 700 | $0.00007 | | | `ankr_getInteractions` | 700 | $0.00007 | | Token API | `ankr_getAccountBalance` | 700 | $0.00007 | | | `ankr_getCurrencies` | 700 | $0.00007 | | | `ankr_getTokenPrice` | 700 | $0.00007 | | | `ankr_getTokenHolders` | 700 | $0.00007 | | | `ankr_getTokenHoldersCount` | 700 | $0.00007 | | | `ankr_getTokenTransfers ` | 700 | $0.00007 | | | `ankr_getTokenPriceHistory` | 700 | $0.00007 | ## Support and Developer Community
[Start Building with Advanced API](/advanced-api/quickstart/overview/)↗
Our goal is to provide developers with the best user experience possible and supercharge Web3 projects with our Advanced API. Also, we strongly believe that community feedback fills our sails. So, let's team up — join our [Discord community](https://discord.ankr.com/) to get support from our team, engage with like-minded developers, and propose new features that we can add in our Roadmap. --- url: https://www.ankr.com/docs/advanced-api/pricing/ title: Pricing description: Advanced API requests measure in API Credits and are paid for under the Pay-as-you-go (PAYG) model — paying for each request. A method's credit value calcula. source: docs/advanced-api/pricing.mdx --- # Pricing :::note Advanced API is a unique feature available for [Freemium and Premium](/rpc-service/service-plans/#service-plans-comparison) users. ::: Advanced API requests measure in *API Credits* and are paid for under the Pay-as-you-go (PAYG) model — paying for each request. A method's credit value calculates based on a method's usage intensity and multiple factors that include using the computational, memory, storage, and network resources.
## Current prices **The price of our API Credits is pegged to USD**. It means that upon using ANKR tokens for PAYG, `ANKR` calculates into `API Credits` at the latest _ANKR/USD_ exchange rate. > **Our PAYG pricing model:** > **0.10 USD = 1M API Credits** ### NFT API Methods | Method | API Credits | USD/request | |:-----------------------|-------------|-------------| | `ankr_getNFTsByOwner` | 700 | $0.00007 | | `ankr_getNFTMetadata` | 700 | $0.00007 | | `ankr_getNFTHolders` | 700 | $0.00007 | | `ankr_getNftTransfers` | 700 | $0.00007 | ### Query API Methods | Method | API Credits | USD/request | |:---------------------------------------------|-------------|-------------| | `ankr_getBlockchainStats` | 700 | $0.00007 | | `ankr_getBlocks` | 700 | $0.00007 | | `ankr_getLogs` | 700 | $0.00007 | | `ankr_getTransactionsByHash` | 700 | $0.00007 | | `ankr_getInteractions` | 700 | $0.00007 | | `ankr_getTransactionsByAddress` | 700 | $0.00007 | ### Token API Methods | Method | API Credits | USD/request | |:----------------------------|-------------|-------------| | `ankr_getAccountBalance` | 700 | $0.00007 | | `ankr_getCurrencies` | 700 | $0.00007 | | `ankr_getTokenPrice` | 700 | $0.00007 | | `ankr_getTokenHolders` | 700 | $0.00007 | | `ankr_getTokenHoldersCount` | 700 | $0.00007 | | `ankr_getTokenTransfers` | 700 | $0.00007 | | `ankr_getTokenPriceHistory` | 700 | $0.00007 | --- url: https://www.ankr.com/docs/advanced-api/python-sdk/ title: Ankr.py SDK description: Ankr.py SDK is a compact Python library that enables interaction with Advanced API. 1. Install the latest package stored on PyPi. 2. Initialize the SDK. source: docs/advanced-api/python-sdk.mdx --- # Ankr.py SDK _Ankr.py SDK_ is a compact Python library that enables interaction with [Advanced API](/advanced-api/overview/). ## Get started 1. Install the latest package stored on [PyPi](https://pypi.org/project/ankr-sdk/). ```shell pip install ankr-sdk ``` 2. Initialize the SDK. [Sign in](/rpc-service/getting-started/basics-premium/#sign-in) to the [RPC Service](https://www.ankr.com/rpc/) platform, get your individual endpoint from the [Advanced API](https://www.ankr.com/rpc/advanced-api) pane, and provide it to the `AnkrWeb3` class. ```python from ankr import AnkrWeb3 ankr_w3 = AnkrWeb3("YOUR_ENDPOINT") ``` 3. Use the SDK to call the methods supported: * Node API ```python eth_block = ankr_w3.eth.get_block("latest") bsc_block = ankr_w3.bsc.get_block("latest") polygon_block = ankr_w3.polygon.get_block("latest") ``` * NFT API ```python from ankr.types import Blockchain nfts = ankr_w3.nft.get_nfts( blockchain=[Blockchain.ETH, Blockchain.BSC], wallet_address="0x0E11A192d574b342C51be9e306694C41547185DD", filter=[ {"0x700b4b9f39bb1faf5d0d16a20488f2733550bff4": []}, {"0xd8682bfa6918b0174f287b888e765b9a1b4dc9c3": ["8937"]}, ], ) ``` * Token API ```python assets = ankr_w3.token.get_account_balance( wallet_address="0x77A859A53D4de24bBC0CC80dD93Fbe391Df45527" ) ``` * Query API ```python logs = ankr_w3.query.get_logs( blockchain="eth", from_block="0xdaf6b1", to_block=14350010, address=["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"], topics=[ [], ["0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff"], ], decode_logs=True, ) ``` ## Chains supported Currently, `ankr.py` supports interaction with the following chains using their aliases: **Mainnet**: * Arbitrum: `arbitrum`. * Avalanche: `avalanche`. * Base: `base`. * BNB Smart Chain: `bsc`. * Ethereum: `eth`. * Fantom: `fantom`. * Flare: `flare`. * Gnosis: `gnosis`. * Linea: `linea`. * Optimism: `optimism`. * Polygon: `polygon`. * Scroll: `scroll`. * Story: `story_mainnet`. * Syscoin: `syscoin`. * Taiko: `taiko`. * Telos: `telos`. * Xai: `xai`. * X Layer: `xlayer` **Testnet**: * Avalanche Fuji: `avalanche_fuji`. * Base Sepolia: `base_sepolia`. * Ethereum Holesky: `eth_holesky`. * Ethereum Sepolia: `eth_sepolia`. * Optimism Testnet: `optimism_testnet`. * Polygon Amoy: `polygon_amoy`. * Story Testnet: `story_aeneid_testnet`. ## Methods supported * [`nft.get_nfts`](/advanced-api/python-sdk/#get_nfts) — retrieves data on all the NFTs (collectibles) owned by a wallet. * [`nft.get_nft_metadata`](/advanced-api/python-sdk/#get_nft_metadata) — retrieves metadata of a particular NFT. * [`token.get_token_holders`](/advanced-api/python-sdk/#get_token_holders) — retrieves holders of a particular NFT. * [`token.get_token_holders_count_history`](/advanced-api/python-sdk/#get_token_holders_count_history) — retrieves the number of token holders for the particular period of time. * [`token.get_token_holders_count`](/advanced-api/python-sdk/#get_token_holders_count) — retrieves the number of token holders for the latest block. * [`token.get_account_balance`](/advanced-api/python-sdk/#get_account_balance) — retrieves the balance of a particular account. * [`query.get_logs`](/advanced-api/python-sdk/#get_logs) — retrieves history data of a particular block range. * [`query.get_blocks`](/advanced-api/python-sdk/#get_blocks) — retrieves full info of a particular block. * [`query.get_transaction`](/advanced-api/python-sdk/#get_transaction) — retrieves the details of a transaction specified by hash. ### `get_nfts` Retrieves data on all the NFTs (collectibles) owned by a wallet. ```python nfts = ankr_w3.nft.get_nfts( blockchain="eth", wallet_address="0x0E11A192d574b342C51be9e306694C41547185DD", filter=[ {"0x700b4b9f39bb1faf5d0d16a20488f2733550bff4": []}, {"0xd8682bfa6918b0174f287b888e765b9a1b4dc9c3": ["8937"]}, ], ) ``` ### `get_nft_metadata` Retrieves metadata of a particular NFT. ```python nfts = ankr_w3.nft.get_nft_metadata( blockchain="eth", contract_address="0x4100670ee2f8aef6c47a4ed13c7f246e621228ec", token_id="4", ) ``` --- ### `get_token_holders` Retrieves holders of a particular NFT. ```python holders = ankr_w3.token.get_token_holders( blockchain="bsc", contract_address="0xf307910A4c7bbc79691fD374889b36d8531B08e3", limit=10, ) ``` --- ### `get_token_holders_count_history` Retrieves the number of token holders for the particular period of time. ```python daily_holders_history = ankr_w3.token.get_token_holders_count_history( blockchain="bsc", contract_address="0xf307910A4c7bbc79691fD374889b36d8531B08e3", limit=10, # last 10 days history ) ``` --- ### `get_token_holders_count` Retrieves the number of token holders on the latest block. ```python holders_count = ankr_w3.token.get_token_holders_count( blockchain="bsc", contract_address="0xf307910A4c7bbc79691fD374889b36d8531B08e3", ) ``` --- ### `get_account_balance` Retrieves the balance of a particular account. ```python assets = ankr_w3.token.get_account_balance( wallet_address="0x77A859A53D4de24bBC0CC80dD93Fbe391Df45527", blockchain=["eth", "bsc"], ) ``` --- ### `get_logs` Retrieves history data of a particular block range. ```python logs = ankr_w3.query.get_logs( blockchain="eth", from_block="0xdaf6b1", to_block=14350010, address=["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"], topics=[ [], ["0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff"], ], decode_logs=True, ) ``` --- ### `get_blocks` Retrieves full info of a particular block. ```python blocks = ankr_w3.query.get_blocks( blockchain="eth", from_block=14500001, to_block=14500001, desc_order=True, include_logs=True, include_txs=True, decode_logs=True, ) ``` --- ### `get_transaction` Retrieves the details of a transaction specified by hash. ```python tx = ankr_w3.query.get_transaction( transaction_hash="0x82c13aaac6f0b6471afb94a3a64ae89d45baa3608ad397621dbb0d847f51196f", include_logs=True, decode_logs=True, decode_tx_data=True, ) ``` --- url: https://www.ankr.com/docs/advanced-api/query-methods/ title: Query API description: Query API is an access-ready solution that enables your projects to interact with multiple blockchains in a single request. By indexing blockchain data on al. source: docs/advanced-api/query-methods.mdx --- # Query API :::note _Query API_ is an Advanced API's collection of methods that comes as a unique feature along with other extensive capabilities provided to our [Premium Plan](/rpc-service/service-plans/#service-plans-comparison) users. ::: _Query API_ is an access-ready solution that enables your projects to interact with multiple blockchains in a single request. By indexing blockchain data on all supported chains, searching through large amounts of data is easier and faster than ever before. Query API can boast almost instantaneous processing speeds (due to the key-value filtering supported) for the searches that might ordinarily take hours to process. Query API serves to request info on the ranges of blocks (max range is 100) for a full list of block metadata. Query API implements the [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification) for interaction. ## Query API Methods _Query API_ consists of the following methods to request info on the ranges of blocks (max range is 100) for a full list of block metadata: * [`ankr_getBlockchainStats`](/advanced-api/query-methods/#ankr_getblockchainstats) — retrieves blockchain statistics. * [`ankr_getBlocks`](/advanced-api/query-methods/#ankr_getblocks) — retrieves full info of a particular block. * [`ankr_getLogs`](/advanced-api/query-methods/#ankr_getlogs) — retrieves historical data for the specified range of blocks. * [`ankr_getTransactionsByHash`](/advanced-api/query-methods/#ankr_gettransactionsbyhash) — retrieves the details of a transaction specified by hash. * [`ankr_getTransactionsByAddress`](/advanced-api/query-methods/#ankr_gettransactionsbyaddress) — retrieves the details of a transaction specified by address. * [`ankr_getInteractions`](/advanced-api/query-methods/#ankr_getinteractions) — retrieves blockchains interacted with a particular wallet. > Prefer interactive docs? See our [OpenAPI specification](https://www.ankr.com/docs/advanced-api/specification/#tag/Query-API) for Query API methods. ## `ankr_getBlockchainStats` > **Retrieves blockchain statistics.** ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `blockchain` (string): a chain or a combination of chains to query: * Single chain: `arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`. * Chains combination: `[arbitrum, avalanche, base, bsc, eth, fantom, flare, gnosis, linea, optimism, polygon, scroll, story_mainnet, syscoin, taiko, telos, xai, xlayer, avalanche_fuji, base_sepolia, eth_holelsky, eth_sepolia, polygon_amoy, story_aeneid_testnet]`. * All chains: leave the value empty to query all the chains available. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getBlockchainStats", "params": { "blockchain": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns statistics for the blockchains specified. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getBlockchainStats", "params": {}, "id": 1 }' ``` #### Response ```json { "jsonrpc": "2.0", "id": 1, "result": { "stats": [ { "blockchain": "eth", "totalTransactionsCount": 2064546464, "totalEventsCount": 3026535069, "latestBlockNumber": 17927196, "blockTimeMs": 12000, "nativeCoinUsdPrice": "1822.653417893923688098" }, { "blockchain": "bsc", "totalTransactionsCount": 4623925358, "totalEventsCount": 14415335315, "latestBlockNumber": 30902238, "blockTimeMs": 3000, "nativeCoinUsdPrice": "234.460486572761055868" } ] } } ``` --- ## `ankr_getBlocks` > **Retrieves the blocks' data.** Retrieves the details for the block range specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `blockchain` (string; required): either of the supported chains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). * `decodeLogs` (boolean): set to `true` to decode logs, or to `false` if you don't need this kind of info. * `decodeTxData` (boolean): set to `true` to decode transaction data, or to `false` if not interested in it. * `descOrder` (boolean): choose data order, either descending (if `true`) or ascending (if `false`). * `fromBlock` (uint64; quantity|tag): the first block of the range. Supported value formats: hex, decimal, "earliest", "latest". * `toBlock` (uint64; quantity|tag): the last block of the range. Supported value formats: hex, decimal, "earliest", "latest". * `includeLogs` (boolean): set to `true` to include logs, or to `false` to exclude them. Note that logs are stored inside transactions, so make sure the `includeTxs` parameter is also set to `true` if you'd like to include logs. * `includeTxs` (boolean): set to `true` to include transactions, or to `false` to exclude them. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getBlocks", "params": { "blockchain": "string", "decodeLogs": true, "decodeTxData": true, "descOrder": true, "fromBlock": 0, "includeLogs": true, "includeTxs": true, "toBlock": 0 } } ``` ```shell Content-Type: application/json ``` ### Response Returns complete information for the block specified by request parameters. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getBlocks", "params": { "blockchain": "eth", "fromBlock": 14500000, "toBlock": 14500000, "decodeLogs": false, "decodeTxData": true, "includeLogs": true, "includeTxs": true }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "blocks": [ { "blockHash": "string", "blockHeight": "string", "blockchainLogo": "string", "blockchainName": "string", "details": { "ethBlock": { "difficulty": "string", "extraData": "string", "gasLimit": 0, "gasUsed": 0, "miner": "string", "nonce": "string", "sha3Uncles": "string", "size": "string", "stateRoot": "string", "totalDifficulty": "string" } }, "parentHash": "string", "timestamp": "string", "transactionsCount": 0 } ] } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "blocks": [ { "blockchain": "eth", "number": "0xdd40a0", "hash": "0xfeed3e175e482268db83d4fd87a43c708f40983343f4b039e582c6f6a95e0e78", "parentHash": "0xe311161a7462068919abe2ac2cd42e5806898b3f42ec597699ce764c067c416a", "nonce": "0xc5f9ce09d63baf71", "mixHash": "0xbd7063d27079586ab3fdae7de0472f93f96f81a0f6c5b3abe903a9c6f62cab06", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "stateRoot": "0xbbf4fe65498447568abe945ea8f926791e491873a367c82ae847aeadf0c7e17f", "miner": "0xea674fdde714fd979de3edf0f56aa9716b898ec8", "difficulty": "0x2e032d1caff8d9", "extraData": "0x617369612d65617374312d34", "size": "0x219", "gasLimit": "0x1ca35d2", "gasUsed": "0x0", "timestamp": "0x6246dd9c", "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "totalDifficulty": "0x994af3a04b379bb8b42", "transactions": [], "uncles": [] } ] } } ``` --- ## `ankr_getLogs` > **Retrieves historical data for the specified range of blocks.** ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `address` (array of strings): a contract address or a list of addresses from which the logs originate. Supported value formats: hex or array of hexes. * `blockchain` (string): a chain or a combination of chains to query: * Single chain: `arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`. * Chains combination: `[arbitrum, avalanche, base, bsc, eth, fantom, flare, gnosis, linea, optimism, polygon, scroll, story_mainnet, syscoin, taiko, telos, xai, xlayer, avalanche_fuji, base_sepolia, eth_holelsky, eth_sepolia, polygon_amoy, story_aeneid_testnet]`. * All chains: leave the value empty to query all the chains available. * `decodeLogs` (boolean): set to `true` to decode logs, or to `false` if you don't need this kind of info. * `descOrder` (boolean): choose data order, either descending (if `true`) or ascending (if `false`). * `fromBlock` (string): the first block of the range. Supported value formats: hex, decimal, "earliest", "latest". * `fromTimestamp` (uint64): the first timestamp of the range. * `pageSize` (string): a number of result pages you'd like to get. * `pageToken` (string): a current page token provided at the end of the response body; can be referenced in the request to fetch the next page. * `toBlock` (string): the last block included in the range. Supported value formats: hex, decimal, "earliest", "latest". * `toTimestamp` (uint64): the last timestamp of the range. * `topics` (uint8): the data the log contains. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getLogs", "params": { "address": [ [ 0 ] ], "blockchain": [ "string" ], "decodeLogs": true, "descOrder": true, "fromBlock": 0, "fromTimestamp": 0, "pageSize": 0, "pageToken": "string", "toBlock": 0, "toTimestamp": 0, "topics": [ [ [ 0 ] ] ] } } ``` ```shell Content-Type: application/json ``` ### Response Returns history data for the blocks specified by request body parameters. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getLogs", "params": { "blockchain": "eth", "fromBlock": "0xdaf6b1", // hex, decimal, "earliest", "latest" are supported "toBlock": 14350010, // hex, decimal, "earliest", "latest" are supported "address": ["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"], // hex or array of hexes are supported "topics": [ [], [ "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" ] ] }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "logs": [ { "address": "string", "blockHash": "string", "blockNumber": "string", "data": "string", "event": { "anonymous": true, "id": "string", "inputs": [ { "indexed": true, "name": "string", "size": 0, "type": "string", "valueDecoded": "string" } ], "name": "string", "signature": "string", "string": "string", "verified": true }, "logIndex": "string", "removed": true, "topics": [ "string" ], "transactionHash": "string", "transactionIndex": "string" } ], "nextPageToken": "string" } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "logs": [ { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" ], "data": "0x00000000000000000000000000000000000000000000000006ce16d63d3e98d5", "blockNumber": "0xdaf6b1", "transactionHash": "0xa00481485db1092529a3502bd8027e0a85a7eff1ecc17d4adae5b38a2ba33ba1", "transactionIndex": "0x1", "blockHash": "0xdd6a92a8d1436f97e6d3c33154805156b92b59f2cfef3f3fa390ba49643f09e8", "logIndex": "0x0", "removed": false }, { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", "0x00000000000000000000000092f0b57e3814e4bd74ef6a6fd6d825db522ccfe2" ], "data": "0x00000000000000000000000000000000000000000000000006ce16d63d3e98d5", "blockNumber": "0xdaf6b1", "transactionHash": "0xa00481485db1092529a3502bd8027e0a85a7eff1ecc17d4adae5b38a2ba33ba1", "transactionIndex": "0x1", "blockHash": "0xdd6a92a8d1436f97e6d3c33154805156b92b59f2cfef3f3fa390ba49643f09e8", "logIndex": "0x2", "removed": false }, { "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", "0x000000000000000000000000d42bd36302f33d77cbb080ad7e0434f6bedc9a44" ], "data": "0x000000000000000000000000000000000000000000000000081e9d8d247e8a1d", "blockNumber": "0xdaf6b3", "transactionHash": "0x9b196e7b81c1aeed1c2bbe3d65c411a6eaecc21ddf5bd7c34141e88577384d4d", "transactionIndex": "0x3", "blockHash": "0xa48f22823710329ad512e3ffc0378a2cc15abda153af23dd6361d58ab190cdb1", "logIndex": "0x22", "removed": false } ] } } ``` --- ## `ankr_getTransactionsByHash` > **Retrieves data for the hash-specified transaction.** Retrieves the details for a transaction specified by hash. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `blockchain` (string): a chain or a combination of chains to query: * Single chain: `arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`. * Chains combination: `[arbitrum, avalanche, base, bsc, eth, fantom, flare, gnosis, linea, optimism, polygon, scroll, story_mainnet, syscoin, taiko, telos, xai, xlayer, avalanche_fuji, base_sepolia, eth_holelsky, eth_sepolia, polygon_amoy, story_aeneid_testnet]`. * All chains: leave the value empty to query all the chains available. * `transactionHash` (string): a hash of the transactions you'd like to request the details for. * `decodeLogs` (boolean): set to `true` to decode logs, or to `false` if you don't need this kind of info. * `decodeTxData` (boolean): set to `true` to decode transaction data, or to `false` if not interested in it. * `includeLogs` (boolean): set to `true` to include logs, or to `false` to exclude them. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getTransactionsByHash", "params": { "blockchain": [ "string" ], "decodeLogs": true, "decodeTxData": true, "includeLogs": true, "transactionHash": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns all transactions' metadata for the hash specified in request body parameters. ### Code Examples #### Request ```shell curl --location -g --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getTransactionsByHash", "params": { "transactionHash": "0x82c13aaac6f0b6471afb94a3a64ae89d45baa3608ad397621dbb0d847f51196f", "decodeLogs": true, "decodeTxData": true }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "transactions": [ { "blockHash": "string", "blockNumber": "string", "blockchain": "string", "contractAddress": "string", "cumulativeGasUsed": "string", "from": "string", "gas": "string", "gasPrice": "string", "gasUsed": "string", "hash": "string", "input": "string", "logs": [ { "address": "string", "blockHash": "string", "blockNumber": "string", "data": "string", "event": { "anonymous": true, "id": "string", "inputs": [ { "indexed": true, "name": "string", "size": 0, "type": "string", "valueDecoded": "string" } ], "name": "string", "signature": "string", "string": "string", "verified": true }, "logIndex": "string", "removed": true, "topics": [ "string" ], "transactionHash": "string", "transactionIndex": "string" } ], "logsBloom": "string", "method": { "id": "string", "inputs": [ { "name": "string", "size": 0, "type": "string", "valueDecoded": "string" } ], "name": "string", "signature": "string", "string": "string", "verified": true }, "nonce": "string", "r": "string", "s": "string", "status": "string", "timestamp": "string", "to": "string", "transactionHash": "string", "transactionIndex": "string", "type": "string", "v": "string", "value": "string" } ] } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "transactions": [ { "v": "0x94", "r": "0xc3adcd90cbf2ef2870c0b7b5497e3c8a5757aadcc152ec1156804082c3269451", "s": "0x1c12681bee4a75a7514f4251bcb4a0243bfc70de998f5c77d87aedc56bce85fc", "nonce": "0x1615d", "from": "0x64aa6f93e0e1f49ff4958990c40d4bf17dafc0eb", "gas": "0x5cc60", "gasPrice": "0x1c3802ec80", "input": "0x1d3ec0d600000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000052b2e13cc84f2c000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000052b7ce5e6080a4eaee3fd000000000000000000000000000000000000000000052aed9671d3df9df54b80000000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000002043c3f900000000000000000000000000000000000000000000000000000000310ff2d6", "blockNumber": "0xd02cf7", "to": "0x98767abab06e45a181ab73ae4cd0fecd0fbd0cd0", "transactionIndex": "0x0", "blockHash": "0x7c4b9b19b521795a0a99c925d4a03079aca26f14cb7bc1400d0183a5adf56ac1", "value": "0x0", "type": "0x0", "contractAddress": null, "cumulativeGasUsed": "0x176b2", "gasUsed": "0x176b2", "logs": [ { "address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000098767abab06e45a181ab73ae4cd0fecd0fbd0cd0", "0x00000000000000000000000058f876857a02d6762e0101bb5c46a8c1ed44dc16" ], "data": "0x0000000000000000000000000000000000000000000000047e678c2df911bc30", "blockNumber": "0xd02cf7", "transactionHash": "0x82c13aaac6f0b6471afb94a3a64ae89d45baa3608ad397621dbb0d847f51196f", "transactionIndex": "0x0", "blockHash": "0x7c4b9b19b521795a0a99c925d4a03079aca26f14cb7bc1400d0183a5adf56ac1", "logIndex": "0x0", "removed": false, "event": { "name": "Transfer", "inputs": [ { "name": "_from", "type": "address", "indexed": true, "size": 20, "valueDecoded": "0x98767abab06e45a181Ab73AE4cD0FeCd0FBD0cD0" }, { "name": "_to", "type": "address", "indexed": true, "size": 20, "valueDecoded": "0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16" }, { "name": "_value", "type": "uint256", "indexed": false, "size": 256, "valueDecoded": "82895379195298430000" } ], "anonymous": false, "string": "event Transfer(address indexed _from, address indexed _to, uint256 _value)", "signature": "Transfer(address,address,uint256)", "id": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "verified": false } }, { "address": "0xe9e7cea3dedca5984780bafc599bd69add087d56", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000058f876857a02d6762e0101bb5c46a8c1ed44dc16", "0x00000000000000000000000098767abab06e45a181ab73ae4cd0fecd0fbd0cd0" ], "data": "0x0000000000000000000000000000000000000000000008fc40ca5d0026461ddc", "blockNumber": "0xd02cf7", "transactionHash": "0x82c13aaac6f0b6471afb94a3a64ae89d45baa3608ad397621dbb0d847f51196f", "transactionIndex": "0x0", "blockHash": "0x7c4b9b19b521795a0a99c925d4a03079aca26f14cb7bc1400d0183a5adf56ac1", "logIndex": "0x1", "removed": false, "event": { "name": "Transfer", "inputs": [ { "name": "_from", "type": "address", "indexed": true, "size": 20, "valueDecoded": "0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16" }, { "name": "_to", "type": "address", "indexed": true, "size": 20, "valueDecoded": "0x98767abab06e45a181Ab73AE4cD0FeCd0FBD0cD0" }, { "name": "_value", "type": "uint256", "indexed": false, "size": 256, "valueDecoded": "42432180015750915169756" } ], "anonymous": false, "string": "event Transfer(address indexed _from, address indexed _to, uint256 _value)", "signature": "Transfer(address,address,uint256)", "id": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "verified": false } }, { "address": "0x58f876857a02d6762e0101bb5c46a8c1ed44dc16", "topics": [ "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" ], "data": "0x000000000000000000000000000000000000000000005f4272d9c342f8340191000000000000000000000000000000000000000000beea5069c8a189501d6059", "blockNumber": "0xd02cf7", "transactionHash": "0x82c13aaac6f0b6471afb94a3a64ae89d45baa3608ad397621dbb0d847f51196f", "transactionIndex": "0x0", "blockHash": "0x7c4b9b19b521795a0a99c925d4a03079aca26f14cb7bc1400d0183a5adf56ac1", "logIndex": "0x2", "removed": false, "event": { "name": "", "inputs": [], "anonymous": false, "string": "", "signature": "", "id": "", "verified": false } }, { "address": "0x58f876857a02d6762e0101bb5c46a8c1ed44dc16", "topics": [ "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", "0x00000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e", "0x00000000000000000000000098767abab06e45a181ab73ae4cd0fecd0fbd0cd0" ], "data": "0x0000000000000000000000000000000000000000000000047e678c2df911bc30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008fc40ca5d0026461ddc", "blockNumber": "0xd02cf7", "transactionHash": "0x82c13aaac6f0b6471afb94a3a64ae89d45baa3608ad397621dbb0d847f51196f", "transactionIndex": "0x0", "blockHash": "0x7c4b9b19b521795a0a99c925d4a03079aca26f14cb7bc1400d0183a5adf56ac1", "logIndex": "0x3", "removed": false, "event": { "name": "", "inputs": [], "anonymous": false, "string": "", "signature": "", "id": "", "verified": false } }, { "address": "0x0000000000004946c0e9f43f4dee607b0ef1fa1c", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000098767abab06e45a181ab73ae4cd0fecd0fbd0cd0", "0x0000000000000000000000000000000000000000000000000000000000000000" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000003", "blockNumber": "0xd02cf7", "transactionHash": "0x82c13aaac6f0b6471afb94a3a64ae89d45baa3608ad397621dbb0d847f51196f", "transactionIndex": "0x0", "blockHash": "0x7c4b9b19b521795a0a99c925d4a03079aca26f14cb7bc1400d0183a5adf56ac1", "logIndex": "0x4", "removed": false, "event": { "name": "Transfer", "inputs": [ { "name": "_from", "type": "address", "indexed": true, "size": 20, "valueDecoded": "0x98767abab06e45a181Ab73AE4cD0FeCd0FBD0cD0" }, { "name": "_to", "type": "address", "indexed": true, "size": 20, "valueDecoded": "0x0000000000000000000000000000000000000000" }, { "name": "_value", "type": "uint256", "indexed": false, "size": 256, "valueDecoded": "3" } ], "anonymous": false, "string": "event Transfer(address indexed _from, address indexed _to, uint256 _value)", "signature": "Transfer(address,address,uint256)", "id": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "verified": false } } ], "logsBloom": "0x0", "transactionHash": "0x82c13aaac6f0b6471afb94a3a64ae89d45baa3608ad397621dbb0d847f51196f", "hash": "0x82c13aaac6f0b6471afb94a3a64ae89d45baa3608ad397621dbb0d847f51196f", "status": "0x1", "blockchain": "bsc", "timestamp": "0x61c09887", "method": { "name": "", "inputs": [], "string": "", "signature": "", "id": "", "verified": false } } ] } } ``` --- ## `ankr_getTransactionsByAddress` > **Retrieves transactions by address.** Retrieves the details of transactions specified by address. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `address` (string; required): an address to search for transactions. * `blockchain` (string): a chain or a combination of chains to query: * Single chain: `arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`. * Chains combination: `[arbitrum, avalanche, base, bsc, eth, fantom, flare, gnosis, linea, optimism, polygon, scroll, story_mainnet, syscoin, taiko, telos, xai, xlayer, avalanche_fuji, base_sepolia, eth_holelsky, eth_sepolia, polygon_amoy, story_aeneid_testnet]`. * All chains: leave the value empty to query all the chains available. * `fromBlock` (integer): narrow your search indicating the block number to start from (inclusive; `>= 0`). Supported value formats: hex, decimal, "earliest", "latest". * `toBlock` (integer): narrow your search indicating the block number to end with (inclusive; `>= 0`). Supported value formats: hex, decimal, "earliest", "latest". * `fromTimestamp` (integer): narrow your search indicating the timestamp to start from (inclusive; `>= 0`). * `toTimestamp` (integer): narrow your search indicating the timestamp to end with (inclusive; `>=0`). * `includeLogs` (boolean): set to `true` to include logs, or to `false` to exclude them. * `descOrder` (boolean): choose data order, either descending (if `true`) or ascending (if `false`). * `pageSize` (int32): a number of result pages you'd like to get. * `pageToken` (string): a current page token provided at the end of the response body; can be referenced in the request to fetch the next page. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getTransactionsByAddress", "params": { "blockchain": "string", "includeLogs": true, "descOrder": true, "pageSize": 0, "pageToken": "string", "toTimestamp": 0, "address": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns the transactions specified by address. ### Code Examples #### Request ```shell curl --location -g --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "id": 1, "jsonrpc": "2.0", "method": "ankr_getTransactionsByAddress", "params": { "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" } }' ``` #### Response Code: 200 OK ```json { "id": 1, "jsonrpc": "2.0", "result": { "transactions": [ { "blockHash": "string", "blockNumber": "string", "blockchain": "string", "cumulativeGasUsed": "string", "from": "string", "gas": "string", "gasPrice": "string", "gasUsed": "string", "hash": "string", "input": "string", "nonce": "string", "r": "string", "s": "string", "status": "string", "timestamp": "string", "to": "string", "transactionIndex": "string", "type": "string", "v": "string", "value": "string" } ] } } ``` ```json { "id": 1, "jsonrpc": "2.0", "result": { "transactions": [ { "blockHash": "0x8ffa5d490184c95c830bb4fb47b76e1fd69eb35d100f93d36d7db131837c938f", "blockNumber": "0xf823ad", "blockchain": "eth", "cumulativeGasUsed": "0x68f589", "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "gas": "0xbe98", "gasPrice": "0x2babee650", "gasUsed": "0xbd8d", "hash": "0x9a70ccd1f8e0d5ddf8e78f68b477d4d5c15ddd17c66f05f820b4c67f5eb6f85a", "input": "0xa9059cbb000000000000000000000000fe97e32a873aa2f926fbfc560abeef01f753c1280000000000000000000000000000000000000000000000000000002e90edd000", "nonce": "0x3c4", "r": "0xe5c2731e3a85d048b4adb0cf9c06cb51013728627525ce80e96c4f1317007104", "s": "0x3a22f49130b59d832a6c9db79880b313e9ca2536a3fd5f10b8080e2e1c3bda97", "status": "0x1", "timestamp": "0x63a85033", "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "transactionIndex": "0x3c", "type": "0x2", "v": "0x0", "value": "0x0" } ] } } ``` --- ## `ankr_getInteractions` > **Retrieves blockchains interacted with a particular address.** Retrieves a list of blockchains on which interactions (tokens, NFTs, transactions) were registered for the address specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `address` (string): an address of the wallet or contract created the logs. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getInteractions", "params": { "address": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns the list of blockchains interacted with the address specified in request body parameters. ### Code Examples #### Request ```shell curl --location -g --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getInteractions", "params": { "address":"0xF977814e90dA44bFA03b6295A0616a897441aceC" }, "id": "1" } ' ``` #### Response Code: 200 OK ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "blockchains": [ "string" ] } } ``` ```json { "jsonrpc": "2.0", "id": "1", "result": { "blockchains": [ "bsc", "fantom", "polygon", "arbitrum", "optimism", "avalanche", "eth" ] } } ``` --- url: https://www.ankr.com/docs/advanced-api/quickstart/aapi-on-nodejs/ title: Query Advanced APIs on NodeJS Server using Ankr.js SDK description: Ankr.js is a JavaScript library that lets you interact with Advanced APIs. In this guide, you'll learn how to create a Node.js script that logs out a list of. source: docs/advanced-api/quickstart/aapi-on-nodejs.mdx --- # Query Advanced APIs on NodeJS Server using Ankr.js SDK [Ankr.js](https://github.com/ankr-network/ankr.js) is a JavaScript library that lets you interact with [Advanced APIs](https://www.ankr.com/advanced-api/). In this guide, you'll learn how to create a Node.js script that logs out a list of all the NFTs owned by an account and a given account's ERC20 token balances. - [Node.js](https://nodejs.org/en/) as our script runner - Ankr.js SDK to interact with Advanced APIs - Advanced APIs as the data source **Prerequisites:** To successfully finish this guide, you'll need [Node.js](https://nodejs.org/en/)↗ and [Yarn](https://yarnpkg.com/)↗ installed on your machine. ## Step 1: Setting Up Your Node.js Project Navigate into a directory of your choice and run the following commands in your terminal to set up a new Node.js project: ```bash mkdir ankrjs-node-followalong && cd ankrjs-node-followalong; # create and cd into our project directory mkdir src; # where our source code will live yarn init -y; # generates our package.json and yarn.lock files git init; echo "node_modules\\n.env\\nbuild\\n*.log" > .gitignore; yarn add -D typescript ts-node @types/node; yarn add prompts; # library to help us accept inputs from the terminal ./node_modules/.bin/tsc --init; # generates our tsconfig.json file ``` Now, create a new file named `app.ts` inside of your src folder. **File:** `./src/app.ts` ```javascript const main = async () => { // this function contains the code that be executed when you run your script console.log('Hello world!'); }; main(); ``` Next, go into your `package.json` file and add a dev script that will let you run your code. **File:** `./package.json` ```javascript { "name": "ankrjs-node-tutorial", "version": "1.0.0", "main": "index.js", "author": "Author", "license": "MIT", "dependencies": { "prompts": "^2.4.2" }, "devDependencies": { "@types/node": "^18.0.3", "ts-node": "^10.8.2", "typescript": "^4.7.4" }, "scripts": { "dev": "ts-node src/app.ts" } } ``` You can now run your script from the root of your project: ``` yarn dev ```

API ## Step 2: Installing And Setting Up Ankr.js Next, you will install and set up Ankr.js so that you can use it to fetch all the NFTs and tokens for a given wallet address later on. Start by installing the `ankr.js` package from npm: ``` # /ankrjs-node-followalong yarn add @ankr.com/ankr.js ``` API Next, create a new file named `utils.ts` inside the `src` directory. You will initialize Ankr.js in this file. **File:** `./src/utils.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; const provider = new AnkrProvider(''); ``` Your `provider` instance will be your interface to the Ankr Advanced APIs whenever you want to fetch some data from them. ## Step 3: Creating the `getNFTs` Function In this step, you will create a `getNFTs` function that accepts a `walletAddress` and returns a list of NFTs owned by that address. You can utilize the `getNFTsByOwner` function provided by Ankr.js for this. **File:** `./src/utils.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; const provider = new AnkrProvider(''); export const getNFTs = async (walletAddress: string) => { return provider.getNFTsByOwner({ walletAddress, }); }; ``` Just to see if things are working, let's call this function from our main script i.e. `./src/app.ts` and log out the output. **File:** `./src/app.ts` ```javascript import { getNFTs } from './utils'; const main = async () => { // this function contains the code that be executed when you run your script console.log('NFTS ================='); const nfts = await getNFTs('0x0ED6Cec17F860fb54E21D154b49DAEFd9Ca04106'); console.log(nfts); }; main(); ``` You can now re-run your script using `yarn dev` and see a list of NFTs being logged out. ``` # /ankrjs-node-followalong yarn dev ``` API ## Step 4: Accepting the Address as Input At the moment, we are passing in a hard-coded address to the `getNFTs` function. You will now let the user pass in any address from their keyboard instead. To achieve this, you can make use of the `prompts` package. **File:** `./src/app.ts` ```javascript import { getNFTs } from './utils'; const prompts = require('prompts'); const main = async () => { // this function contains the code that be executed when you run your script const addressToQueryNFTsFor = await prompts({ type: 'text', name: 'address', message: 'Enter an address to query NFTs for', }); console.log('NFTS ================='); const nfts = await getNFTs(addressToQueryNFTsFor.address); console.log(nfts); }; main(); ``` Re-run your script by running `yarn dev`. You should now be able to type in any address of your choice and see all the NFTs owned by that address being logged out. ``` # /ankrjs-node-followalong yarn dev ``` API ## Step 5: Creating the `getAccountBalance` Function In this step, you will create a `getAccountBalance` function that accepts a `walletAddress` and returns a list of ERC20 tokens owned by that address and their balances. You can use the `getNFTsByOwner` function provided by Ankr.js for this. **File:** `./src/utils.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; const provider = new AnkrProvider(''); export const getNFTs = async (walletAddress: string) => { return provider.getNFTsByOwner({ walletAddress, }); }; export const getAccountBalance = async (walletAddress: string) => { return provider.getAccountBalance({ walletAddress, blockchain: ['eth'], // you can fetch ERC20 tokens on other chains by passing in more chain names to this array eg. ['eth', 'polygon'] }); }; ``` ## Step 6: Using `getAccountBalance` in Script In this step, you will accept an address as input and pass it into `getAccountBalance` to display results for the given address just like you did with `getNFTs`. **File:** `./src/app.ts` ```javascript import { getAccountBalance, getNFTs } from './utils'; const prompts = require('prompts'); const main = async () => { // this function contains the code that be executed when you run your script const addressToQueryNFTsFor = await prompts({ type: 'text', name: 'address', message: 'Enter an address to query NFTs for', }); console.log('NFTS ================='); const nfts = await getNFTs(addressToQueryNFTsFor.address); console.log(nfts); const addressToQueryBalancesFor = await prompts({ type: 'text', name: 'address', message: 'Enter an address to query token balances for', }); console.log('TOKEN BALANCES ================='); const balances = await getAccountBalance(addressToQueryBalancesFor.address); console.log(balances); }; main(); ``` Run your script again and everything should work as expected! ``` # /ankrjs-node-followalong yarn dev ``` API --- url: https://www.ankr.com/docs/advanced-api/quickstart/aapi-react-app/ title: Empower React App with Advanced APIs using Ankr.js SDK description: Ankr.js is a JavaScript library that lets you interact with Advanced APIs. In this guide, you'll learn how to create an NFT viewer app using the following te. source: docs/advanced-api/quickstart/aapi-react-app.mdx --- # Empower React App with Advanced APIs using Ankr.js SDK [Ankr.js](https://github.com/ankr-network/ankr.js) is a JavaScript library that lets you interact with [Advanced APIs](https://www.ankr.com/advanced-api/). In this guide, you'll learn how to create an NFT viewer app using the following technologies: - Next.js as the React/frontend framework - TailwindCSS as the CSS framework - AnkAnkr.jsr SDK to interact with Advanced APIs - Advanced APIs as the data source API **Prerequisite:** To successfully finish this guide, you'll need [Node.js](https://nodejs.org/en/)↗ and [Yarn](https://yarnpkg.com/)↗ installed on your machine. ## Step 1: Setting Up Your Next.js Starter Project Navigate into a directory of your choice and run the following command in your terminal to set up a new Next.js project: ``` yarn create next-app --ts ankrjs-tutorial ``` You can now navigate into the directory and launch the app: ``` cd ankrjs-tutorial && yarn dev ``` Here's what it looks like at the moment: API The app currently only contains the boilerplate code provided by Next.js. Over the course of the next few sections, you'll set up Ankr.js and use it to create a gallery of NFTs for any given wallet address. Before we proceed to step 2, feel free to set up TailwindCSS by following their official guide for Next.js: [Tailwind Docs](https://tailwindcss.com/docs/guides/nextjs). ## Step 2: Installing And Setting Up Ankr.js Next, you will install and set up Ankr.js so that you can use it to fetch all the NFTs for a given wallet address later on. Start by installing the ankr.js package from npm: ``` # ./ankrjs-tutorial yarn add @ankr.com/ankr.js ``` Next, create a new file named utils.ts at the root of your project directory. You will initialize Ankr.js in this file. **File:** `./utils.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; const provider = new AnkrProvider(''); ``` Your provider instance will be your interface to the Ankr Advanced APIs whenever you want to fetch some data from them. ## Step 3: Creating NFT Retrieval Function In this step, you will create a getNfts function that accepts a walletAddress and returns a list of NFTs owned by that address. You can utilize the `getNFTsByOwner` function provided by Ankr.js for this. **File:** `./utils.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; const provider = new AnkrProvider(''); export const getNfts = async (address: string) => { const { assets } = await provider.getNFTsByOwner({ walletAddress: address, blockchain: 'eth', }); return { nfts: assets, }; }; ``` Just to see if things are working, let's call this function on our page i.e. `./pages/index.tsx` and log out the output. **File:** `./pages/index.tsx` ```javascript import type { NextPage } from 'next'; import { useEffect } from 'react'; import { getNfts } from '../utils'; const Home: NextPage = () => { useEffect(() => { (async () => { const { nfts } = await getNfts( '0xB2Ebc9b3a788aFB1E942eD65B59E9E49A1eE500D' ); console.log({ nfts }); })(); }, []); return (

NFT viewer

); }; export default Home; ``` You should see a list of nfts being logged out in your browser's console.

API ## Step 4: Creating Wallet Address Input You will now add an input to the UI that lets the user input any wallet address they want and pass it to the `getNfts` function. You can keep track of the wallet address input in a state variable named `walletAddress`, hook it up to the input element in the UI, and then pass `walletAddress` to the `getNfts` function. **File:** `./pages/index.tsx` ```javascript /* eslint-disable @next/next/no-img-element */ import type { NextPage } from 'next'; import Link from 'next/link'; import { useState } from 'react'; import { useNfts } from '../hooks'; const Home: NextPage = () => { const [walletAddress, setWalletAddress] = useState( '0xB2Ebc9b3a788aFB1E942eD65B59E9E49A1eE500D' ); useEffect(() => { (async () => { const { nfts } = await getNfts(walletAddress); console.log({ nfts }); })(); }, [walletAddress]); return (

NFT viewer

setWalletAddress(e.target.value)} className='rounded p-2 w-[400px] border' placeholder='Enter a wallet address here' />
); }; export default Home; ``` You should see a different list of nfts being logged out in the console when you change the wallet address in the input now. Congrats! You are now able to fetch the list of NFTs owned by any given address. API ## Step 5: Displaying NFTs In Your UI You can start off by storing the list of NFTs you fetch in a state variable named nfts. You can then loop through nfts and display all the NFTs in a grid. **File:** `./pages/index.tsx` ```javascript /* eslint-disable @next/next/no-img-element */ import type { NextPage } from 'next'; import Link from 'next/link'; import { useState } from 'react'; import { useNfts } from '../hooks'; const Home: NextPage = () => { const [walletAddress, setWalletAddress] = useState( '0xB2Ebc9b3a788aFB1E942eD65B59E9E49A1eE500D' ); const [nfts, setNfts] = useState([]); useEffect(() => { (async () => { const { nfts } = await getNfts(walletAddress); console.log({ nfts }); setNfts(nfts); })(); }, [walletAddress]); return (
...
{nfts.map((nft) => { return (
{nft.name} {nft.name} {nft.collectionName}
); })}
); }; export default Home; ``` You should now see a gallery of all the NFTs owned by the given wallet address of your choice. LFG! API --- url: https://www.ankr.com/docs/advanced-api/quickstart/account-balance-ankrjs/ title: Query Account Balance across Multiple Blockchains using Ankr.js description: Fetch account balance across multiple blockchains: - Ethereum - Polygon. source: docs/advanced-api/quickstart/account-balance-ankrjs.mdx --- # Query Account Balance across Multiple Blockchains using Ankr.js Fetch account balance across multiple blockchains: - Ethereum - Polygon - BNB Smart Chain - Fantom - Avalanche - Arbitrum - Syscoin - Optimism. In this tutorial, we’ll be fetching the account balances from multiple blockchains such as Ethereum, Polygon, and Fantom, to name a few, using [Advanced APIs](https://www.ankr.com/advanced-api/)↗. ## Getting Started **Prerequisite:** To successfully finish this guide, you'll need [Node.js](https://nodejs.org/en/)↗ and [Yarn](https://yarnpkg.com/)↗ installed on your machine. ### Step 1: Setting Up Next.js Starter Application First up, navigate into the directory of your choice where you want to initiate this project and run the following command in your terminal to set up a new Next.js starter page: ``` yarn create next-app --ts ankrjs-account-balance ``` You'll be able to see a couple of files and folders being created for you. Let's dive into the newly created directory and start the development server on localhost:3000. ``` cd ankrjs-account-balance ``` ``` yarn dev ``` Visit localhost:3000 to view the starter application and it will resemble the screen attached below:

API ### Step 2: Installing and Setting Up Ankr.js In this section, we will install and set up Ankr.js for querying account balances across multichains. We will start by installing the ankr.js package from npm: ``` yarn add @ankr.com/ankr.js ``` Now that we have installed the Ankr.js library, let's set up Ankr.js by **creating a new file** named `apis.ts` at the root of your project directory. We will initialize Ankr.js in this file. **File:** `./apis.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; import type { Blockchain } from '@ankr.com/ankr.js/dist/types'; const provider = new AnkrProvider(''); ``` To interact with Ankr's Advanced APIs, we have created a provider instance that will serve as an interface to the APIs required to fetch data. ### Step 3: Creating Function to Fetch Total Balance In this step, we will first create a `getAccountBalance` function in the `./apis.ts` file, which will accept a `walletAddress`, and return the coin and the respective token balance. Here we are going to utilize the [getAccountBalance](https://documenter.getpostman.com/view/19024547/UVsEVUGQ#74b5cc68-fba2-415c-a53b-28c08818f970)↗ method provided by Ankr.js. File: `./apis.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; import type { Blockchain } from '@ankr.com/ankr.js/dist/types'; const provider = new AnkrProvider(''); //defining the list of supported blockchains const listOfChains: Blockchain[] = ['eth', 'arbitrum', 'avalanche', 'bsc', 'fantom', 'polygon', ]; //key-value pair mapping of chains to their native symbols export const chainsToNativeSymbols: { [key in Blockchain]: string } = { eth: 'ETH', arbitrum: 'ETH', avalanche: 'AVAX', bsc: 'BNB', fantom: 'FTM', polygon: 'POL', }; //getAccountBalance function to fetch coins and their respective token balances export const getAccountBalance = async (walletAddress: string) => { return provider.getAccountBalance({ walletAddress, }); }; ``` Let's call this function on our page i.e. `./pages/index.tsx` to check the account balances. To do so, clear the code from the **index.tsx** file and replace it with the one given below: **File:** `./pages/index.tsx` ```javascript import { useEffect } from 'react'; import { getAccountBalance, } from '../apis'; function App() { useEffect(() => { (async () => { const total = await getAccountBalance( "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", ); console.log({ total }); })(); }, []); return (

Account Balance

); } export default App; ``` Now, let's see the Account Balances of an inputted wallet address in the developer console of a browser. - Head over to your localhost and use `Option + ⌘ + J` (on macOS), or `Shift + CTRL + J` (on Windows/Linux). You should be able to see the list of chains with their respective tokens and account balances.

API ## [Optional]: Calculating the Net Worth To calculate the sum of balances (net worth) across the chains we will create a new function in the `apis.ts` file and let's call it **getTotalMultichainBalance**. File: `./apis.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; import type { Blockchain } from '@ankr.com/ankr.js/dist/types'; const provider = new AnkrProvider(''); //defining the list of supported blockchains const listOfChains: Blockchain[] = ['eth', 'arbitrum', 'avalanche', 'bsc', 'fantom', 'polygon', ]; //key-value pair mapping of chains to their native symbols export const chainsToNativeSymbols: { [key in Blockchain]: string } = { eth: 'ETH', arbitrum: 'ETH', avalanche: 'AVAX', bsc: 'BNB', fantom: 'FTM', polygon: 'POL', }; //getAccountBalance function to fetch coins and their respective token balances export const getAccountBalance = async ( walletAddress: string, blockchain: Blockchain ) => { return provider.getAccountBalance({ walletAddress, blockchain, }); }; //use getAccountBalance to sum total balance across chains export const getTotalMultichainBalance = async (walletAddress: string) => { let total = 0; for await (const chain of listOfChains) { const { totalBalanceUsd, assets } = await getAccountBalance( walletAddress, chain ); total += +totalBalanceUsd; } return total; }; ``` Let's call this function on our page to check the total account balance. **File:** `./pages/index.tsx` ```javascript import { useEffect } from 'react'; import { getTotalMultichainBalance, } from '../apis'; function App() { useEffect(() => { (async () => { const total = await getTotalMultichainBalance( "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" ); console.log({ total }); })(); }, []); return (

Net Worth

); } export default App; ``` Let's see the net worth of an inputted wallet address in the developer console of a browser. Head over to your localhost and use Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux). You should be able to see the net worth.

API --- url: https://www.ankr.com/docs/advanced-api/quickstart/defi-dashboard-ankrjs/ title: DeFi-Dashboard dApp using Advanced APIs description: In this tutorial, we’ll be building a "What's in Your Wallet?" dApp where users can check their net worth, credits in native balance by chain, and NFTs they. source: docs/advanced-api/quickstart/defi-dashboard-ankrjs.mdx --- # DeFi-Dashboard dApp using Advanced APIs In this tutorial, we’ll be building a "What's in Your Wallet?" dApp where users can check their net worth, credits in native balance by chain, and NFTs they hold on multiple blockchains such as Ethereum, Polygon and Fantom (to name a few) using [Advanced APIs](https://www.ankr.com/advanced-api/)↗. ## Advanced APIs Advanced APIs is the collection of RPC methods created to simplify querying blockchain data. These APIs does all the heavy lifting for us so that we can query on-chain data in a matter of seconds. Currently, it supports eight EVM compatible chains: - Ethereum - Polygon - BNB Smart Chain - Fantom - Avalanche - Arbitrum - Syscoin - and Optimism, with more EVM and non-EVM chains coming soon. To interact with Advanced APIs, we are going to use a JavaScript library named [Ankr.js](https://www.npmjs.com/package/@ankr.com/ankr.js)↗. Here's the tech stack for this guide: - Vite.js - [TailwindCSS](https://tailwindcss.com/docs/guides/vite)↗ as CSS framework (follow their official guide to set it up) - Advanced APIs for querying blockchain data Here's what you'll be able to build by the end of this tutorial:

API Now that we have a basic understanding of what we are building and the tools we will be using to achieve the outcome, we can start building our dApp! _______________________ ## Getting Started **Prerequisite**: To successfully finish this guide, you'll only need [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/) installed on your machine. We will begin the project by forking this Vite + Tailwind CSS + RainbowKit 🌈 [starter repository](https://github.com/kaymomin/StarterKit-DefiDashboard)↗. We can do so by clicking the 'fork' button at the top-right of the linked GitHub page. It has some basic configurations and setup to get us started with our dApp. > Note in the code block below, make sure you paste the repo URL of your own cloned repository. Once the repository has been forked, we will clone it locally to get building on top of it by following the steps below: - Navigate into a directory of your choice and run the following command in your terminal to set up a local clone of the starter-kit ``` git clone https://github.com/kaymomin/StarterKit-DefiDashboard ``` - Now, let's navigate into the cloned directory and install the dependencies in the following section ``` cd starterkit-defidashboard ``` ``` yarn ``` ## Installing Ankr.js In this section, we will install and set up Ankr.js for querying NFTs and Tokens related data from the blockchain for a given wallet address. We will start by installing the `ankr.js` package from npm: ``` yarn add @ankr.com/ankr.js ``` Now that we have installed the Ankr.js library, let's head to the VSCode and open the `starterkit-defidashboard` folder in our code editor. To launch the starter kit, run the following command in the VSCode terminal: ``` yarn dev ``` and you will be able to see the start-kit webpage. Here's the [live demo](https://defidashboard-starterkit.vercel.app/)↗ of what the site will look like at this point. API ## Setting Up Ankr.js - Now to set up Ankr.js, create a new file named `api.ts` under the `src` directory. We will initialize Ankr.js in this file. **File:** `src/api.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; import type { Blockchain } from '@ankr.com/ankr.js/dist/types'; const provider = new AnkrProvider(''); ``` To interact with Ankr's Advanced APIs, we have created a provider instance which will serve as an interface to the APIs required to fetch data. ## Creating Function to Fetch Total Balance In this step, we will first create a `getAccountBalance` function in the `src/api.ts` file, which will accept a `walletAddress`, and return the coin and the respective token balances. Here we are going to utilize the [getAccountBalance](/advanced-api/javascript-sdk/#getaccountbalance)↗ method provided by Ankr.js to calculate the sum of balance (net worth) across the chains in the `getTotalMultichainBalance` function. **File: **`src/api.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; import type { Blockchain } from '@ankr.com/ankr.js/dist/types'; const provider = new AnkrProvider(''); //defining the list of supported blockchains const listOfChains: Blockchain[] = ['eth', 'arbitrum', 'avalanche', 'bsc', 'fantom', 'polygon', ]; //key-value pair mapping of chains to their native symbols export const chainsToNativeSymbols: { [key in Blockchain]: string } = { eth: 'ETH', arbitrum: 'ETH', avalanche: 'AVAX', bsc: 'BNB', fantom: 'FTM', polygon: 'POL', }; //getAccountBalance function to fetch coins and their respective token balances export const getAccountBalance = async ( walletAddress: string, blockchain: Blockchain ) => { return provider.getAccountBalance({ walletAddress, blockchain, }); }; //use getAccountBalance to sum total balance across chains export const getTotalMultichainBalance = async (walletAddress: string) => { let total = 0; for await (const chain of listOfChains) { const { totalBalanceUsd, assets } = await getAccountBalance( walletAddress, chain ); total += +totalBalanceUsd; } return total; }; ``` Just to see if things are working, let's call this function on our app i.e. `./src/App.tsx` and log out the output. ```javascript import { ConnectButton } from "@rainbow-me/rainbowkit"; import { useEffect} from 'react'; import { getTotalMultichainBalance, } from './api'; function App() { useEffect(() => { (async () => { const total = await getTotalMultichainBalance( //add your wallet address '0xdC4EfDac43475F434482e61805E0df96D2dC1DF4' ); console.log({ total }); })(); }, []); return (

DefiDashboard 🪙 What's in your Wallet?

); } export default App; ``` You should be able to see the net-worth or total balance in your browser's console.

API You can now revert back the changes we made in the `App.tsx` file as we will work on it once we create all our functions in `api.ts` file. ### Creating More Functions Now that we have created a function to get total balance, in this section we will write three more functions as follows: - **getNativeCurrencyBalance:** This function will fetch account balance for a particular chain. - **getAllNativeCurrencyBalances:** This function will serve as a loop to get all the native currency balance from the list of blockchains we declared in the above section. - **getNfts:** Will returns the list of NFTs owned by the particular address. **File: **`src/api.ts` ```javascript export const getNativeCurrencyBalance = async ( walletAddress: string, chain: Blockchain ) => { const { assets } = await getAccountBalance(walletAddress, chain); const nativeCurrencySymbol = chainsToNativeSymbols[chain]; const nativeCurrencyBalance = assets.find( (asset) => asset.tokenSymbol === nativeCurrencySymbol ); return nativeCurrencyBalance ? +nativeCurrencyBalance.balance : 0; }; export const getAllNativeCurrencyBalances = async (walletAddress: string) => { const balances: { [key in Blockchain]?: number } = {}; for await (const chain of listOfChains) { const nativeCurrencyBalance = await getNativeCurrencyBalance( walletAddress, chain ); balances[chain] = nativeCurrencyBalance; } return balances; }; export const getNfts = async (walletAddress: string) => { const { assets } = await provider.getNFTsByOwner({ walletAddress, // blockchain: 'eth', }); return assets; }; ``` And with that, we have our `api.ts` file all ready where we created methods for getting account balance, calculation net worth, fetching balances by native tokens and getting NFTs by owner. You can also find the complete code for this file below: ```javascript import AnkrProvider from '@ankr.com/ankr.js'; import type { Blockchain } from '@ankr.com/ankr.js/dist/types'; const provider = new AnkrProvider(''); //defining the list of supported blockchains const listOfChains: Blockchain[] = ['eth', 'arbitrum', 'avalanche', 'bsc', 'fantom', 'polygon', ]; //key-value pair mapping of chains to their native symbols export const chainsToNativeSymbols: { [key in Blockchain]: string } = { eth: 'ETH', arbitrum: 'ETH', avalanche: 'AVAX', bsc: 'BNB', fantom: 'FTM', polygon: 'POL', }; //getAccountBalance function to fetch coins and their respective token balances export const getAccountBalance = async ( walletAddress: string, blockchain: Blockchain ) => { return provider.getAccountBalance({ walletAddress, blockchain, }); }; //use getAccountBalance to sum total balance across chains export const getTotalMultichainBalance = async (walletAddress: string) => { let total = 0; for await (const chain of listOfChains) { const { totalBalanceUsd, assets } = await getAccountBalance( walletAddress, chain ); total += +totalBalanceUsd; } return total; }; export const getNativeCurrencyBalance = async ( walletAddress: string, chain: Blockchain ) => { const { assets } = await getAccountBalance(walletAddress, chain); const nativeCurrencySymbol = chainsToNativeSymbols[chain]; const nativeCurrencyBalance = assets.find( (asset) => asset.tokenSymbol === nativeCurrencySymbol ); return nativeCurrencyBalance ? +nativeCurrencyBalance.balance : 0; }; export const getAllNativeCurrencyBalances = async (walletAddress: string) => { const balances: { [key in Blockchain]?: number } = {}; for await (const chain of listOfChains) { const nativeCurrencyBalance = await getNativeCurrencyBalance( walletAddress, chain ); balances[chain] = nativeCurrencyBalance; } return balances; }; export const getNfts = async (walletAddress: string) => { const { assets } = await provider.getNFTsByOwner({ walletAddress, // blockchain: 'eth', }); return assets; }; ``` ## Creating Components and Frontend In this section, we will work on `App.tsx` file where we will create some components that will interact with our functions in `api.ts` file and build frontend to display the results on our webpage. Here's the code for the `App.tsx` file: **File:** `src/App.tsx` ```javascript import { ConnectButton } from "@rainbow-me/rainbowkit"; import type { Blockchain, Nft } from '@ankr.com/ankr.js/dist/types'; import { useEffect, useMemo, useState } from 'react'; import { useAccount } from 'wagmi'; import { chainsToNativeSymbols, getAllNativeCurrencyBalances, getNfts, getTotalMultichainBalance, } from './api'; function App() { const [totalBalance, setTotalBalance] = useState(); const [allNativeBalances, setAllNativeBalances] = useState<{ [key in Blockchain]?: number; }>({}); const [nfts, setNfts] = useState([]); const nativeBalancesSorted = useMemo(() => { // sort allNativeBalances by value, descending and convert it back to an object const res = Object.entries(allNativeBalances).sort(([, a], [, b]) => b - a); return res; }, [allNativeBalances]); const { address } = useAccount(); const [loading, setLoading] = useState(false); useEffect(() => { (async () => { setLoading(true); if (!address) { return; } const totalBal = await getTotalMultichainBalance(address); const nativeBalances = await getAllNativeCurrencyBalances(address); const nfts = await getNfts(address); setAllNativeBalances(nativeBalances); setTotalBalance(Math.round(totalBal)); setNfts(nfts); setLoading(false); })(); }, [address]); return (

DefiDashboard 🪙 What's in your Wallet?

{/* Net worth */} {totalBalance && (

Net Worth

${totalBalance}
)} {/* Native currency balances */} {nativeBalancesSorted.length > 0 && (

Wallet

    {nativeBalancesSorted.map(([chain, bal], idx) => (
  • {chain} {/* @ts-expect-error */} {bal.toFixed(2)} {chainsToNativeSymbols[chain]}
  • ))}
)}
{/* NFTs section */} {nfts.length > 0 && (

NFTs

{nfts.map((nft) => { const id = `${nft.contractAddress}/${nft.tokenId}`; return (

{nft.name}

); })}
)}
); } export default App; ``` Woah, that's a lot of code that we wrote! Now comes the crunch as we run our dApp in the local dev environment. ``` yarn dev ``` You should now be able to view your net-worth, balances by chain and their native token and ofc the NFTs!!

API --- url: https://www.ankr.com/docs/advanced-api/quickstart/fetch-nfts-ankrjs/ title: Fetch Particular Owner's NFTs with Ankr.js description: In this tutorial, we’ll be fetching all the NFTs owned by a particular wallet or owner across multiple blockchains such as Ethereum, Polygon, and Fantom, to. source: docs/advanced-api/quickstart/fetch-nfts-ankrjs.mdx --- # Fetch Particular Owner's NFTs with Ankr.js In this tutorial, we’ll be fetching all the NFTs owned by a particular wallet or owner across multiple blockchains such as Ethereum, Polygon, and Fantom, to name a few, using [Advanced APIs](https://www.ankr.com/advanced-api/)↗. ### Advanced APIs Ankr's Advanced Multichain APIs are the collection of RPC methods created to simplify querying blockchain data. These APIs do all the heavy lifting for us so that we can query on-chain data in a matter of seconds. Currently, it supports eight EVM compatible chains: Ethereum, Fantom, Binance Smart Chain, Polygon, Avalanche, Arbitrum, Syscoin and Optimism with more EVM and non-EVM chains coming soon. To interact with Ankr's Advanced APIs, we are going to use a JavaScript library named [Ankr.js](https://www.npmjs.com/package/@ankr.com/ankr.js)↗. ## Getting Started **Prerequisite:** To successfully finish this guide, you'll need [Node.js](https://nodejs.org/en/)↗ and [Yarn](https://yarnpkg.com/)↗ installed on your machine. ### Step 1: Set Up Next.js Starter Application First up, navigate into the directory of your choice where you want to initiate this project and run the following command in your terminal to set up a new Next.js starter page: ``` yarn create next-app --ts ankrjs-fetch-nfts ``` You'll be able to see a couple of files and folders being created for you. Let's dive into the newly created directory and start the development server on localhost:3000. ``` cd ankrjs-fetch-nfts ``` ``` yarn dev ``` Visit localhost:3000 to view the starter application and it will resemble the screen attached below:

API ______________________________________ ### Step 2: Install and Set Up Ankr.js In this section, we will install and set up Ankr.js for querying NFT data from the blockchain for a given wallet address. We will start by installing the ankr.js package from npm: ``` yarn add @ankr.com/ankr.js ``` Now that we have installed the Ankr.js library, let's set up Ankr.js by **creating a new file** named `apis.ts` at the root of your project directory. We will initialize Ankr.js in this file. **File:** `./apis.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; import type { Blockchain } from '@ankr.com/ankr.js/dist/types'; const provider = new AnkrProvider(''); ``` To interact with Ankr's Advanced APIs, we have created a provider instance that will serve as an interface to the APIs required to fetch data. ___________________________________ ### Step 3: Create getNFTs Function In this step, you will create a `getNfts` function that accepts a `walletAddress` and returns a list of NFTs owned by that address. Here, we are going to utilize the `getNFTsByOwner` function provided by Ankr.js for this. File: `./apis.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; import type { Blockchain } from '@ankr.com/ankr.js/dist/types'; const provider = new AnkrProvider(''); export const getNfts = async (address: string) => { const { assets } = await provider.getNFTsByOwner({ walletAddress: address, blockchain: 'eth', }); return { nfts: assets, }; }; ``` And that's it. Let's call this function on our page i.e. `./pages/index.tsx` to see the fetched NFTs by the owner's wallet address and log the output. To do so, clear the code from the **index.tsx** file and replace it with the one given below: **File:** `./pages/index.tsx` ```javascript import type { NextPage } from 'next'; import { useEffect } from 'react'; import { getNfts } from '../apis'; const Home: NextPage = () => { useEffect(() => { (async () => { const { nfts } = await getNfts( '0xd8da6bf26964af9d7eed9e03e53415d37aa96045' ); console.log({ nfts }); })(); }, []); return (

NFTs

); }; export default Home; ``` Now, let's see the NFT logs of an inputted wallet address in the developer console of a browser. - Head over to your localhost and use `Option + ⌘ + J` (on macOS), or `Shift + CTRL + J` (on Windows/Linux). You should be able to see the list of NFTs owned by a particular address.

API

You can also extend the toggle to dive into the details of the NFTs held by the owner. Details include: `blockchain``collectionName`, `contractAddress`, `contractType`, `imageUrl`, `name`, `symbol`, `tokenId` and `tokenUrl`.

API --- url: https://www.ankr.com/docs/advanced-api/quickstart/overview/ title: Build with Advanced APIs description: Kickstart your dApp with Advanced APIs to go from idea to building and shipping cool stuff. Learn how to query data from blockchain instantly:. source: docs/advanced-api/quickstart/overview.mdx --- # Build with Advanced APIs Kickstart your dApp with Advanced APIs to go from idea to building and shipping cool stuff. ## Code Snippets Learn how to query data from blockchain instantly:
[How to fetch all NFTs owned by a particular wallet address using Ankr.js SDK](/advanced-api/quickstart/fetch-nfts-ankrjs/)↗
[How to check your account balance across multiple blockchains using Ankr.js SDK](/advanced-api/quickstart/account-balance-ankrjs/)↗
## Quickstart Guides Learn how to query data from blockchain, build prototypes, dApps, projects and more:
[Query Advanced APIs on NodeJS server using Ankr.js SDK](/advanced-api/quickstart/aapi-on-nodejs/)↗
[Ankr.js quickstart guide with React](/advanced-api/quickstart/aapi-react-app/)↗
## Tutorials Learn how to build fullstack projects and dApps with Advanced APIs:
[Build basic DeFi-dashboard dApp with Vite.js, Ankr.js, and Tailwind CSS](/advanced-api/quickstart/defi-dashboard-ankrjs/)↗
--- url: https://www.ankr.com/docs/advanced-api/react-hooks/ title: Ankr React Hooks description: This section contains info on using React hooks to fetch data from Advanced API. 1. Install the package. 2. Wrap your app with the component. source: docs/advanced-api/react-hooks.mdx --- # Ankr React Hooks This section contains info on using React hooks to fetch data from [Advanced API](/advanced-api/overview/). ## Get started 1. Install the package. ```shell # with npm npm install ankr-react # with yarn yarn add ankr-react ``` 2. Wrap your app with the `` component. ```javascript import { Provider } from 'ankr-react'; function MyApp({ Component, pageProps }) { return ( ); } export default MyApp; ``` 3. Use React Hooks. ```javascript import { useNFTsByOwner } from 'ankr-react'; const Page = () => { const {data, error, isLoading} = useNFTsByOwner({ walletAddress: '0x0ED6Cec17F860fb54E21D154b49DAEFd9Ca04106', blockchain: ['eth', 'polygon'], }) return ( ... ) } ``` ## Chains supported **Mainnet**: * Arbitrum: `arbitrum`. * Avalanche: `avalanche`. * Base: `base`. * BNB Smart Chain: `bsc`. * Ethereum: `eth`. * Fantom: `fantom`. * Flare: `flare`. * Gnosis: `gnosis`. * Linea: `linea`. * Optimism: `optimism`. * Polygon: `polygon`. * Scroll: `scroll`. * Story: `story_mainnet`. * Syscoin: `syscoin`. * Taiko: `taiko`. * Telos: `telos`. * Xai: `xai`. * X Layer: `xlayer` **Testnet**: * Avalanche Fuji: `avalanche_fuji`. * Base Sepolia: `base_sepolia`. * Ethereum Holesky: `eth_holesky`. * Ethereum Sepolia: `eth_sepolia`. * Optimism Testnet: `optimism_testnet`. * Polygon Amoy: `polygon_amoy`. * Story Testnet: `story_aeneid_testnet`. ## Hooks supported * [`useAccountBalance`](/advanced-api/react-hooks/#useaccountbalance) — retrieves account balance. * [`useBlocks`](/advanced-api/react-hooks/#useblocks) — retrieves the block's data. * [`useCurrencies`](/advanced-api/react-hooks/#usecurrencies) — retrieves the blockchain's currencies. * [`useLogs`](/advanced-api/react-hooks/#uselogs) — retrieves the block's history data. * [`useNFTMetadata`](/advanced-api/react-hooks/#usenftmetadata) — retrieves the NFTs metadata. * [`useNFTsByOwner`](/advanced-api/react-hooks/#usenftsbyowner) — retrieves the account's NFT data. * [`useTokenHolders`](/advanced-api/react-hooks/#usetokenholders) — retrieves data on token holders. * [`useTokenHoldersCount`](/advanced-api/react-hooks/#usetokenholderscount) — retrieves the number of token holders. * [`useTransactionsByHash`](/advanced-api/react-hooks/#usetransactionsbyhash) — retrieves data for the hash-specified transaction. ### `useAccountBalance` > Retrieves all the balance data of the account specified. #### Parameters Schema Parameters to pass with the request: ```typescript { blockchain?: Blockchain | (Blockchain)[]; walletAddress: string; pageToken?: string; pageSize?: number; } ``` #### Parameters Description * `walletAddress` (string; required): an account address to query for balance; supports the Ethereum Name Service (ENS). * `blockchain` (string): A chain or a combination of chains to query: * Single chain: `eth`, `bsc`, `fantom`, `avalanche`, `polygon`, `arbitrum`, `syscoin`, `optimism`. * Chains combination: `[eth, polygon, bsc]`. * All chains: leave the value empty to query all the chains available. * `pageToken` (string): a token provided at the end of the response body to reference in the request to fetch the next page. * `pageSize` (number): a number of result pages you'd like to get. --- ### `useBlocks` > Retrieves full information for the block specified. #### Parameters Schema Parameters to pass with the request: ```typescript { blockchain: Blockchain; fromBlock?: number | "latest" | "earliest"; toBlock?: number | "latest" | "earliest"; descOrder?: boolean; includeLogs?: boolean; includeTxs?: boolean; decodeLogs?: boolean; decodeTxData?: boolean; } ``` #### Parameters Description * `blockchain` (string; required): A chain to query (`eth`, `bsc`, `fantom`, `avalanche`, `polygon`, `arbitrum`, `syscoin`, `optimism`). * `fromBlock`(string): the first block of the range. Supported value formats: hex, decimal, "earliest", "latest". * `toBlock` (string): the last block included in the range. Supported value formats: hex, decimal, "earliest", "latest". * `descOrder` (boolean): choose data order, either descending (if `true`) or ascending (if `false`). * `includeLogs` (boolean): set to `true` to include logs, or to `false` to exclude them. * `includeTxs` (boolean): set to `true` to include transactions, or to `false` to exclude them. * `decodeLogs` (boolean): set to `true` to decode logs, or to `false` if you don't need this kind of info. --- ### `useCurrencies` > Retrieves a list of supported currencies for a given blockchain. #### Parameters Schema Parameters to pass with the request: ```typescript { blockchain: Blockchain; } ``` #### Parameters Description * `blockchain` (string; required): A chain to query (`eth`, `bsc`, `fantom`, `avalanche`, `polygon`, `arbitrum`, `syscoin`, `optimism`). --- ### `useLogs` > Retrieves history data for the blocks specified. #### Parameters Schema Parameters to pass with the request: ```typescript { blockchain: Blockchain | (Blockchain)[]; fromBlock?: number | "latest" | "earliest"; toBlock?: number | "latest" | "earliest"; fromTimestamp?: number | "latest" | "earliest"; toTimestamp?: number | "latest" | "earliest"; address?: string | string[]; topics?: (string | string[])[]; pageToken?: string; pageSize?: number; descOrder?: boolean; decodeLogs?: boolean; } ``` #### Parameters Description * `blockchain` (string; required): a chain to query (`eth`, `bsc`, `fantom`, `avalanche`, `polygon`, `arbitrum`, `syscoin`, `optimism`). * `fromBlock`(string): the first block of the range. Supported value formats: hex, decimal, "earliest", "latest". * `toBlock` (string): the last block included in the range. Supported value formats: hex, decimal, "earliest", "latest". * `fromTimestamp` (uint64): the first timestamp of the range. * `toTimestamp` (uint64): the last timestamp of the range. * `address` (string): an address of the contract created the logs. Supported value formats: string or array of strings. * `topics` (string): the data the log contains. * `pageToken` (string): a token provided at the end of the response body to reference in the request to fetch the next page. * `pageSize` (number): a number of result pages you'd like to get. * `descOrder` (boolean): choose data order, either descending (if `true`) or ascending (if `false`). * `decodeLogs` (boolean): set to `true` to decode logs, or to `false` if you don't need this kind of info. --- ### `useNFTMetadata` > Retrieves the metadata that belongs to a particular NFT. #### Parameters Schema Parameters to pass with the request: ```typescript { blockchain: Blockchain; contractAddress: string; tokenId: string; } ``` #### Parameters Description * `blockchain` (string; required): a chain to query (`eth`, `bsc`, `fantom`, `avalanche`, `polygon`, `arbitrum`, `syscoin`, `optimism`). * `contractAddress` (string; required): a contract address of the NFT the metadata belongs to; supports the Ethereum Name Service (ENS). * `tokenId` (string; required): a token ID of the NFT the metadata belongs to. --- ### `useNFTsByOwner` > Retrieves a list of NFTs (ERC721/ERC1155/ENS/POAP) that belong to a particular account specified. #### Parameters Schema Parameters to pass with the request: ```typescript { blockchain?: Blockchain | (Blockchain)[]; filter?: {[key: string]: string[]}[]; walletAddress: string; pageToken?: string; pageSize?: number; } ``` #### Parameters Description * `walletAddress` (string; required): an account address to query for NFTs; supports the Ethereum Name Service (ENS). * `blockchain` (string): a chain or a combination of chains to query: * Single chain: `eth`, `bsc`, `fantom`, `avalanche`, `polygon`, `arbitrum`, `syscoin`, `optimism`. * Chains combination: `[eth, polygon, bsc]`. * All chains: leave the value empty to query all the chains available. * `pageToken` (sting): a token provided at the end of the response body to reference in the request to fetch the next page. * `pageSize` (int32): a number of page results you'd like to get. * `filter` (key-value): Filters your request by either of the following: * Smart contract address (`"0xd8682bfa6918b0174f287b888e765b9a1b4dc9c3": [] `) — retrieves all NFTs from the address. * Smart contract address and NFT ID (`"0xd8682bfa6918b0174f287b888e765b9a1b4dc9c3": ["8937"]`) — retrieves a particular NFT specified. --- ### `useTokenHolders` > Retrieves holders and the associated metadata for the tokens specified. #### Parameters Schema Parameters to pass with the request: ```typescript { blockchain: Blockchain; contractAddress: string; pageToken?: string; pageSize?: number; } ``` #### Parameters Description * `blockchain` (string; required): a chain to query (`eth`, `bsc`, `fantom`, `avalanche`, `polygon`, `arbitrum`, `syscoin`, `optimism`). * `contractAddress` (string; required): a contract address of the tokens collection; supports the Ethereum Name Service (ENS). * `pageToken` (string): a token provided at the end of the response body to reference in the request to fetch the next page. * `pageSize` (int32): a number of page results you'd like to get. --- ### `useTokenHoldersCount` > Retrieves the number of holders for the tokens specified. #### Parameters Schema Parameters to pass with the request: ```typescript { blockchain: Blockchain; contractAddress: string; pageToken?: string; pageSize?: number; } ``` #### Parameters Description * `blockchain` (string; required): a chain to query (`eth`, `bsc`, `fantom`, `avalanche`, `polygon`, `arbitrum`, `syscoin`, `optimism`). * `contractAddress` (string; required): a contract address of the tokens collection; supports the Ethereum Name Service (ENS). * `pageToken` (string): a token provided at the end of the response body to reference in the request to fetch the next page. * `pageSize` (int32): a number of page results you'd like to get. --- ### `useTransactionsByHash` > Retrieves the details for a transaction specified by hash. #### Parameters Schema Parameters to pass with the request: ```typescript { blockchain?: Blockchain | (Blockchain)[]; transactionHash: string; includeLogs?: boolean; decodeLogs?: boolean; decodeTxData?: boolean; } ``` #### Parameters Description * `blockchain` (string): a chain or a combination of chains to query: * Single chain: `eth`, `bsc`, `fantom`, `avalanche`, `polygon`, `arbitrum`, `syscoin`, `optimism`. * Chains combination: `[eth, polygon, bsc]`. * All chains: leave the value empty to query all the chains available. * `transactionHash` (string; required): a hash of the transactions you'd like to request the details for. * `includeLogs` (boolean): set to `true` to include logs, or to `false` to exclude them. * `decodeLogs` (boolean): set to `true` to decode logs, or to `false` if you don't need this kind of info. * `decodeTxData` (boolean): set to `true` to decode transaction data, or to `false` if not interested in it. --- url: https://www.ankr.com/docs/advanced-api/token-methods/ title: Token API description: Token API serves to request token-related data (account balance, supported currencies, token holders, token price, etc.) across multiple EVM-compatible chain. source: docs/advanced-api/token-methods.mdx --- # Token API :::note _Token API_ is an Advanced API's collection of methods that comes as a unique feature along with other extensive capabilities provided to our [Premium Plan](/rpc-service/service-plans/#service-plans-comparison) users. ::: _Token API_ serves to request token-related data (account balance, supported currencies, token holders, token price, etc.) across multiple EVM-compatible chains. Token API uses only official on-chain data, leaving third parties behind. Ankr constantly scans for the on-chain transactions coming from DEXs, flagging transactions and aggregating data into accurate real-time token price feeds. This solution is crucial for the Web3 projects like marketplaces and exchanges looking for efficient ways to query accurate on-chain data for tokenized assets. Token API implements the [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification) for interaction. ## Token API Methods _Token API_ consists of the following methods to request token-related data across multiple chains: * [`ankr_getAccountBalance`](/advanced-api/token-methods/#ankr_getaccountbalance) — retrieves the balance of a particular account. * [`ankr_getCurrencies`](/advanced-api/token-methods/#ankr_getcurrencies) — retrieves info on currencies available for a particular blockchain. * [`ankr_getTokenPrice`](/advanced-api/token-methods/#ankr_gettokenprice) — retrieves the price of a particular token. * [`ankr_getTokenHolders`](/advanced-api/token-methods/#ankr_gettokenholders) — retrieves info on holders of a particular token. * [`ankr_getTokenHoldersCount`](/advanced-api/token-methods/#ankr_gettokenholderscount) — retrieves the number of token holders. * [`ankr_getTokenTransfers`](/advanced-api/token-methods/#ankr_gettokentransfers) — retrieves token transfers info. * [`ankr_getTokenPriceHistory`](/advanced-api/token-methods/#ankr_gettokenpricehistory) — retrieves the historical price of the token specified. > Prefer interactive docs? See our [OpenAPI specification](https://www.ankr.com/docs/advanced-api/specification/#tag/Token-API) for Token API methods. ## `ankr_getAccountBalance` > **Retrieves account balance.** Retrieves the balance of the account specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `blockchain` (string): a chain or a combination of chains to query: * Single chain: `arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`. * Chains combination: `[arbitrum, avalanche, base, bsc, eth, fantom, flare, gnosis, linea, optimism, polygon, scroll, story_mainnet, syscoin, taiko, telos, xai, xlayer, avalanche_fuji, base_sepolia, eth_holesky, eth_sepolia, optimism_testnet, polygon_amoy, story_aeneid_testnet]`. * All chains: leave the value empty to query all the chains available. * `nativeFirst` (boolean): sorting order. Native network token first (true) or not (false). * `onlyWhitelisted` (boolean; default: `true`): only show tokens listed on CoinGekko (`true`) or all the tokens (`false`). Default — `true`. * `pageSize` (int32): a number of results you'd like to get (max: all; default: all). * `pageToken` (string): a current page token provided at the end of the response body; can be referenced in the request to fetch the next page. * `walletAddress` (string): an account address to query for balance; supports the Ethereum Name Service (ENS). ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getAccountBalance", "params": { "blockchain": [ "string" ], "onlyWhitelisted": true, "pageSize": 0, "pageToken": "string", "walletAddress": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns a complete set of balance data for the account specified in request body parameters. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getAccountBalance", "params": { "blockchain": "eth", "walletAddress": "0xfa9019df60d3c710d7d583b2d69e18d412257617" }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "assets": [ { "balance": "string", "balanceRawInteger": "string", "balanceUsd": "string", "blockchain": "string", "contractAddress": "string", "holderAddress": "string", "thumbnail": "string", "tokenDecimals": 0, "tokenName": "string", "tokenPrice": "string", "tokenSymbol": "string", "tokenType": "string" } ], "nextPageToken": "string", "totalBalanceUsd": "string" } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "totalBalanceUsd": "4915134435857.581297310767673907", "assets": [ { "blockchain": "eth", "tokenName": "Amber Token", "tokenSymbol": "AMB", "tokenDecimals": 18, "tokenType": "ERC20", "contractAddress": "0x4dc3643dbc642b72c158e7f3d2ff232df61cb6ce", "holderAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "balance": "0.0009", "balanceRawInteger": "900000000000000", "balanceUsd": "4915133942196.190757578196621746", "tokenPrice": "5461259935773545.286197996246384112", "thumbnail": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x4DC3643DbC642b72C158E7F3d2ff232df61cb6CE/logo.png" }, { "blockchain": "eth", "tokenName": "Tether USD", "tokenSymbol": "USDT", "tokenDecimals": 6, "tokenType": "ERC20", "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "holderAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "balance": "181812.058733", "balanceRawInteger": "181812058733", "balanceUsd": "181812.058733", "tokenPrice": "1", "thumbnail": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png" }, { "blockchain": "bsc", "tokenName": "Tether USD", "tokenSymbol": "USDT", "tokenDecimals": 18, "tokenType": "ERC20", "contractAddress": "0x55d398326f99059ff775485246999027b3197955", "holderAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "balance": "169752.555225093619558572", "balanceRawInteger": "169752555225093619558572", "balanceUsd": "169752.555225093619558572", "tokenPrice": "1", "thumbnail": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x55d398326f99059fF775485246999027B3197955/logo.png" }, { "blockchain": "bsc", "tokenName": "Space Protocol", "tokenSymbol": "SPL", "tokenDecimals": 18, "tokenType": "ERC20", "contractAddress": "0xfec6832ab7bea7d3db02472b64cb59cfc6f2c107", "holderAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "balance": "500", "balanceRawInteger": "500000000000000000000", "balanceUsd": "0", "tokenPrice": "0", "thumbnail": "" } ] } } ``` --- ## `ankr_getCurrencies` > **Retrieves the blockchain's currencies.** Retrieves a list of all the currencies used in transactions on a blockchain specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `blockchain` (string; required): either of the supported chains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getCurrencies", "params": { "blockchain": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns the currencies and their metadata for the blockchain specified by request body parameters. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getCurrencies", "params": { "blockchain": "eth" }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "currencies": [ { "address": "string", "blockchain": "string", "decimals": 0, "name": "string", "symbol": "string", "thumbnail": "string" } ] } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "currencies": [ { "blockchain": "eth", "address": "0xf32122561d51e891b823dec2b42f644884c1cd91", "name": "DeFido", "decimals": 9, "symbol": "DEFIDO", "thumbnail": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x199F788DDb566B7eBB59bf35B36914F2aCdb33DE/logo.png" }, { "blockchain": "eth", "address": "0x903d78ca7d892e4518586d0b64f418bd4ca9a82d", "name": "FK Coin", "decimals": 18, "symbol": "FK", "thumbnail": "https://assets.coingecko.com/coins/images/9801/large/logo.e944e891.png?1571918228" }, { "blockchain": "eth", "address": "0xb1cd6e4153b2a390cf00a6556b0fc1458c4a5533", "name": "BNT Smart Token Relay", "decimals": 18, "symbol": "ETHBNT", "thumbnail": "https://assets.coingecko.com/coins/images/10664/large/ETHBNT_Relay.png?1581486882" }, { "blockchain": "eth", "address": "0xd0c4bc1b89bbd105eecb7eba3f13e7648c0de38f", "name": "METAVERSE", "decimals": 9, "symbol": "META", "thumbnail": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0xd0c4BC1B89BbD105EeCb7EBa3f13E7648c0De38F/logo.png" }, { "blockchain": "eth", "address": "0x16b0a1a87ae8af5c792fabc429c4fe248834842b", "name": "Algory", "decimals": 18, "symbol": "ALG", "thumbnail": "https://assets.coingecko.com/coins/images/12231/large/logo-2.png?1605256312" }, { "blockchain": "eth", "address": "0x26946ada5ecb57f3a1f91605050ce45c482c9eb1", "name": "BitcoinSoV", "decimals": 8, "symbol": "BSOV", "thumbnail": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x26946adA5eCb57f3A1F91605050Ce45c482C9Eb1/logo.png" }, { "blockchain": "eth", "address": "0x5f236f062f16a9b19819c535127398df9a01d762", "name": "IPUX Token", "decimals": 18, "symbol": "IPUX", "thumbnail": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x5F236F062f16A9B19819c535127398dF9a01D762/logo.png" }, { "blockchain": "eth", "address": "0xea7aa1edd21735a5ab05ee3e90869016191e274e", "name": "junca cash", "decimals": 18, "symbol": "JCC", "thumbnail": "https://assets.coingecko.com/coins/images/12889/large/junca.jpg?1603279160" }, { "blockchain": "eth", "address": "0x13b02c8de71680e71f0820c996e4be43c2f57d15", "name": "Wrapped Mirror QQQ Token", "decimals": 18, "symbol": "mQQQ", "thumbnail": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x13B02c8dE71680e71F0820c996E4bE43c2F57d15/logo.png" } ] } } ``` --- ## `ankr_getTokenPrice` > **Retrieves token price.** Retrieves a USD price of the token specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `blockchain` (string; required): either of the supported chains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). * `contractAddress` (string): an address of the token contract; supports the Ethereum Name Service (ENS). If not provided, returns the native coin price of the blockchain specified. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getTokenPrice", "params": { "blockchain": "string", "contractAddress": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns a USD price of the token specified by request body parameters. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getTokenPrice", "params": { "blockchain": "eth", "contractAddress": "0x8290333cef9e6d528dd5618fb97a76f268f3edd4" }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "blockchain": "string", "contractAddress": "string", "usdPrice": "string" } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "usdPrice": "0.031240514621682378", "blockchain": "eth", "contractAddress": "0x8290333cef9e6d528dd5618fb97a76f268f3edd4" } } ``` --- ## `ankr_getTokenHolders` > **Retrieves data on token holders.** Retrieves holders (wallet addresses) and the associated metadata of the tokens specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `blockchain` (string; required): either of the supported chains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). * `contractAddress` (string): an address of the token contract; supports the Ethereum Name Service (ENS). * `pageSize` (int32): a number of results you'd like to get (max: `10000`; default: `10000`). * `pageToken` (string): a current page token provided at the end of the response body; can be referenced in the request to fetch the next page. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getTokenHolders", "params": { "blockchain": "string", "contractAddress": "string", "pageSize": 0, "pageToken": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns holders, holders number, and holders metadata of the tokens specified by request body parameters. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getTokenHolders", "params": { "blockchain": "bsc", "contractAddress": "0xf307910A4c7bbc79691fD374889b36d8531B08e3", "pageSize": 3, "pageToken": "4jQWQp56mXWuw2qPBV3PNcHc187va4ip31eF58pFGmXzRuz5nMM1KjV7Ykcr7fM5yJVQB8rgjp9cJXfwrX" }, "id": 1 }' ``` #### Response ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "blockchain": "string", "contractAddress": "string", "holders": [ { "balance": "string", "balanceRawInteger": "string", "holderAddress": "string" } ], "holdersCount": 0, "nextPageToken": "string", "tokenDecimals": 0 } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockchain": "bsc", "contractAddress": "0xf307910a4c7bbc79691fd374889b36d8531b08e3", "tokenDecimals": 18, "holders": [ { "holderAddress": "0x000000000081105ffd4392520dd13c4c70d95d19", "balance": "1.905460638097497318", "balanceRawInteger": "1905460638097497318" }, { "holderAddress": "0x00000000008bef34003b59bed4c4c0f6f1543928", "balance": "0.000000000000000001", "balanceRawInteger": "1" }, { "holderAddress": "0x0000000000a56e8a4c7fe801704809098b36f825", "balance": "0.000000000000000001", "balanceRawInteger": "1" } ], "holdersCount": 30370, "nextPageToken": "4jQWQp56mXWuw2qPBV3PNcHc187va4ip31eF58pFGmXzRuz5nMM1KjV7YkdWZPVsubrETfAhkQbZD84gco" } } ``` --- ## `ankr_getTokenHoldersCount` > **Retrieves the number of token holders.** Retrieves the number of holders for the tokens specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `blockchain` (string; required): either of the supported chains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). * `contractAddress` (string): an address of the token contract; supports the Ethereum Name Service (ENS). * `pageSize` (string): a number of results you'd like to get (max: `10000`; default: `10000`). * `pageToken` (string): a current page token provided at the end of the response body; can be referenced in the request to fetch the next page. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getTokenHoldersCount", "params": { "blockchain": "string", "contractAddress": "string", "pageSize": 0, "pageToken": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns the number of holders for the tokens specified by request body parameters. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getTokenHoldersCount", "params": { "blockchain": "eth", "contractAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7", "pageSize": 10, "pageToken": "" }, "id": 1 }' ``` #### Response ```json { "error": {}, "id": 1, "jsonrpc": "2.0", "result": { "blockchain": "string", "contractAddress": "string", "holderCountHistory": [ { "holderCount": 0, "lastUpdatedAt": "string", "totalAmount": "string", "totalAmountRawInteger": "string" } ], "nextPageToken": "string", "tokenDecimals": 0 } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "blockchain": "eth", "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "tokenDecimals": 6, "holderCountHistory": [ { "holderCount": 4498953, "totalAmount": "36819785005.419766", "totalAmountRawInteger": "36819785005419766", "lastUpdatedAt": "2022-07-29T05:41:21Z" }, { "holderCount": 4499645, "totalAmount": "36816222245.175462", "totalAmountRawInteger": "36816222245175462", "lastUpdatedAt": "2022-07-28T05:22:56Z" }, { "holderCount": 4511556, "totalAmount": "36760965103.328572", "totalAmountRawInteger": "36760965103328572", "lastUpdatedAt": "2022-07-27T05:22:39Z" }, { "holderCount": 4564306, "totalAmount": "36817771914.224166", "totalAmountRawInteger": "36817771914224166", "lastUpdatedAt": "2022-07-26T05:22:03Z" }, { "holderCount": 4560820, "totalAmount": "36815806116.708002", "totalAmountRawInteger": "36815806116708002", "lastUpdatedAt": "2022-07-25T05:22:45Z" }, { "holderCount": 4560328, "totalAmount": "36814914728.545481", "totalAmountRawInteger": "36814914728545481", "lastUpdatedAt": "2022-07-24T05:21:31Z" }, { "holderCount": 4561735, "totalAmount": "36814752262.427647", "totalAmountRawInteger": "36814752262427647", "lastUpdatedAt": "2022-07-23T05:19:24Z" }, { "holderCount": 4565903, "totalAmount": "36815223206.771204", "totalAmountRawInteger": "36815223206771204", "lastUpdatedAt": "2022-07-22T05:27:27Z" }, { "holderCount": 4565069, "totalAmount": "36815746244.132796", "totalAmountRawInteger": "36815746244132796", "lastUpdatedAt": "2022-07-21T05:29:37Z" }, { "holderCount": 4565261, "totalAmount": "36815212704.878653", "totalAmountRawInteger": "36815212704878653", "lastUpdatedAt": "2022-07-20T05:29:47Z" } ], "nextPageToken": "EmDs3EqSha2txDLQwnEiLNmpbpuiAuosQFtyMhPZS9rqnNzFp9Y5C" } } ``` --- ## `ankr_getTokenTransfers` > **Retrieves info on token transfers for the wallet address specified.** ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `address` (array of strings; required): an address or a list of addresses to search for token transfers. * `blockchain` (string): a chain or a combination of chains to query: * Single chain: `arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`. * Chains combination: `[arbitrum, avalanche, base, bsc, eth, fantom, flare, gnosis, linea, optimism, polygon, scroll, story_mainnet, syscoin, taiko, telos, xai, xlayer, avalanche_fuji, base_sepolia, eth_holesky, eth_sepolia, optimism_testnet, polygon_amoy, story_aeneid_testnet]`. * All chains: leave the value empty to query all the chains available. * `descOrder` (boolean): choose data order, either descending (if `true`) or ascending (if `false`). * `fromBlock` (integer): narrow your search indicating the block number to start from (inclusive; `>= 0`). Supported value formats: hex, decimal, "earliest", "latest". * `toBlock` (integer): narrow your search indicating the block number to end with (inclusive; `>= 0`). Supported value formats: hex, decimal, "earliest", "latest". * `fromTimestamp` (integer): narrow your search indicating the UNIX timestamp to start from (inclusive; `>= 0`). * `toTimestamp` (integer): narrow your search indicating the UNIX timestamp to end with (inclusive; `>=0`). * `pageSize` (integer): a number of result pages you'd like to get (max: `10000`; default: `10000`). * `pageToken` (string): a current page token provided in the response; can be referenced in the request to fetch the next page. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getTokenTransfers", "params": { "address": "string", "blockchain": [ "string", "string" ], "fromTimestamp": 0, "toTimestamp": 0 } } ``` ```shell Content-Type: application/json ``` ### Response Returns info on transfers of the tokens specified by request body parameters. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getTokenTransfers", "params": { "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "blockchain": [ "eth", "bsc" ], "fromTimestamp": 1655197483, "toTimestamp": 1671974699 }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "id": 1, "jsonrpc": "2.0", "result": { "transfers": [ { "blockHeight": 4593859, "blockchain": "eth", "contractAddress": "0xdd974d5c2e2928dea5f71b9825b8b646686bd200", "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "thumbnail": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdd974D5C2e2928deA5F71b9825b8b646686BD200/logo.png", "timestamp": 1511258315, "toAddress": "0x0cfb686e114d478b055ce8614621f8bb62f70360", "tokenDecimals": 18, "tokenName": "Kyber Network Crystal", "tokenSymbol": "KNC", "transactionHash": "0xfc2192e9716490dbe46c3d59c7c99f81d3b685118b01e2812872a6aae7049c4b", "value": "3420332", "valueRawInteger": "" }, { "blockHeight": 10762240, "blockchain": "bsc", "contractAddress": "0xc33fc11b55465045b3f1684bde4c0aa5c5f40124", "fromAddress": "0xc33fc11b55465045b3f1684bde4c0aa5c5f40124", "thumbnail": "", "timestamp": 1631185820, "toAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "tokenDecimals": 9, "tokenName": "BNBw.io", "tokenSymbol": "BNBw", "transactionHash": "0x74aa1d7c858bd8d9bb1daf5311ec5f6cdb16df165e6f242127f6502775993570", "value": "21131181", "valueRawInteger": "" } ] } } ``` --- ## `ankr_getTokenPriceHistory` > Retrieves the historical price of the token specified. ### Request Build your request using the parameters below. #### Parameters * `id` (int64; required): a request ID (example: 1). * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). * `method` (string; required): a method used for the request. * `params` (object): the data object containing request body parameters: * `blockchain` (string; required): either of the supported chains (`arbitrum`, `avalanche`, `base`, `bsc`, `eth`, `fantom`, `flare`, `gnosis`, `linea`, `optimism`, `polygon`, `scroll`, `story_mainnet`, `syscoin`, `taiko`, `telos`, `xai`, `xlayer`, `avalanche_fuji`, `base_sepolia`, `eth_holesky`, `eth_sepolia`, `optimism_testnet`, `polygon_amoy`, `story_aeneid_testnet`). * `contractAddress` (string): an address of the token contract; supports the Ethereum Name Service (ENS). If not provided, returns the native coin price of the blockchain specified. * `fromTimestamp` (integer): narrow your search indicating the UNIX timestamp to start from (inclusive; `>= 0`). * `toTimestamp` (integer): narrow your search indicating the UNIX timestamp to end with (inclusive; `>=0`). * `interval` (integer): time interval for updating the token price. UNIX timestamp (inclusive; `>=0`). * `limit` (integer): amount of records to be returned (inclusive; `>=0`). * `syncCheck` (boolean): if `false`, the data is returned regardless of indexer health; if `true`, the data is returned only when the indexer health check is positive. ```json { "id": 1, "jsonrpc": "2.0", "method": "ankr_getTokenPriceHistory", "params": { "blockchain": "string", "contractAddress": "string" } } ``` ```shell Content-Type: application/json ``` ### Response Returns the latest USD price data for the requested token, including historical quote entries and the node’s synchronization status. ### Code Examples #### Request ```shell curl --location --request POST 'https://rpc.ankr.com/multichain/{your_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc": "2.0", "method": "ankr_getTokenPriceHistory", "params": { "blockchain": "eth", "contractAddress": "0x8290333cef9e6d528dd5618fb97a76f268f3edd4" }, "id": 1 }' ``` #### Response Code: 200 OK ```json { "jsonrpc": "2.0", "id": integer, "result": { "quotes": [ { "timestamp": integer, "blockHeight": integer, "usdPrice": "string" } ], "syncStatus": { "timestamp": integer, "lag": "string", "status": "string" } } } ``` ```json { "jsonrpc": "2.0", "id": 1, "result": { "quotes": [ { "timestamp": 1753625651, "blockHeight": 23011008, "usdPrice": "0.01771388896807847" } ], "syncStatus": { "timestamp": 1762179251, "lag": "-4s", "status": "synced" } } } ``` --- url: https://www.ankr.com/docs/automation/create-compatible-contracts/ title: Create compatible contracts description: Contract that are compatible with the IAutomateCompatible Ankr interface allow you to create custom logic tasks and automate contract function execution base. source: docs/automation/create-compatible-contracts.mdx --- # Create compatible contracts Contract that are compatible with the `IAutomateCompatible` Ankr interface allow you to create custom logic tasks and automate contract function execution based on that logic. A compatible contract contains: 1. A checker, that repeatedly checks on an event. 2. A follow-up executor, that contains the custom logic and executes it when the checker returns `true`. ## `IAutomateCompatible` interface The interface contains a checker `checkTask()` and an executor with the custom logic `performTask()`. ``` // SPDX-License-Identifier: MIT pragma solidity ^0.8.15; interface IAutomateCompatible { /** * @notice method that is simulated by the automators to see if any work actually * needs to be performed. This method does does not actually need to be * executable, and since it is only ever simulated it can consume lots of gas. * @dev To ensure that it is never called, you may want to add the * cannotExecute modifier from AutomateBase to your implementation of this * method. * @param checkData specified in the task registration so it is always the * same for a registered task. This can easily be broken down into specific * arguments using `abi.decode`, so multiple tasks can be registered on the * same contract and easily differentiated by the contract. * @return taskNeeded boolean to indicate whether the automator should call * performtask or not. * @return performData bytes that the automator should call performtask with, if * task is needed. If you would like to encode data to decode later, try * `abi.encode`. */ function checkTask(bytes calldata checkData) external returns (bool taskNeeded, bytes memory performData); /** * @notice method that is actually executed by the automators, via the registry. * The data returned by the checkTask simulation will be passed into * this method to actually be executed. * @dev The input to this method should not be trusted, and the caller of the * method should not even be restricted to any single registry. Anyone should * be able call it, and the input should be validated, there is no guarantee * that the data passed in is the performData returned from checkTask. This * could happen due to malicious automators, racing automators, or simply a state * change while the performTask transaction is waiting for confirmation. * Always validate the data passed in. * @param performData is the data which was passed back from the checkData * simulation. If it is encoded, it can easily be decoded into other types by * calling `abi.decode`. This data should not be trusted, and should be * validated against the contract's current state. */ function performTask(bytes calldata performData) external; } ``` ## Example contract To use the custom logic option in Ankr Automation, your contract must meet the following requirements: * Inherit the `IAutomateCompatible` interface. * Use the `IAutomateCompatible` interface in the way that is compatible with Ankr Automation. * Implement the function `checkTask()` that will be executed off-chain to see if the logic in `performTask()` needs to be executed. * Implement the `performTask()` that will be executed on-chain when `checkTask()` returns `true`. Following these requirements, our example contract will increase a counter after every `interval` seconds. If you register this contract as a Task in Ankr Automation, the Automation simulates `checkTask` off-chain during every block to determine if the `interval` seconds have passed since the `lastTimeStamp`. When `checkTask` returns `true`, the Automation calls `performTask()` on-chain and increments the counter. This cycle repeats until the Task is cancelled or runs out of funding. ``` // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; // AutomationCompatible.sol imports the functions from both ./AutomationBase.sol and // ./interfaces/AutomationCompatibleInterface.sol interface IAutomateCompatible { /** * @notice method that is simulated by the automators to see if any work actually * needs to be performed. This method does does not actually need to be * executable, and since it is only ever simulated it can consume lots of gas. * @dev To ensure that it is never called, you may want to add the * cannotExecute modifier from AutomateBase to your implementation of this * method. * @param checkData specified in the task registration so it is always the * same for a registered task. This can easily be broken down into specific * arguments using `abi.decode`, so multiple tasks can be registered on the * same contract and easily differentiated by the contract. * @return taskNeeded boolean to indicate whether the automator should call * performtask or not. * @return performData bytes that the automator should call performtask with, if * task is needed. If you would like to encode data to decode later, try * `abi.encode`. */ function checkTask(bytes calldata checkData) external returns (bool taskNeeded, bytes memory performData); /** * @notice method that is actually executed by the automators, via the registry. * The data returned by the checkTask simulation will be passed into * this method to actually be executed. * @dev The input to this method should not be trusted, and the caller of the * method should not even be restricted to any single registry. Anyone should * be able call it, and the input should be validated, there is no guarantee * that the data passed in is the performData returned from checkTask. This * could happen due to malicious automators, racing automators, or simply a state * change while the performTask transaction is waiting for confirmation. * Always validate the data passed in. * @param performData is the data which was passed back from the checkData * simulation. If it is encoded, it can easily be decoded into other types by * calling `abi.decode`. This data should not be trusted, and should be * validated against the contract's current state. */ function performTask(bytes calldata performData) external; } /** * THIS IS AN EXAMPLE CONTRACT THAT USES HARDCODED VALUES FOR CLARITY. * THIS IS AN EXAMPLE CONTRACT THAT USES UN-AUDITED CODE. * DO NOT USE THIS CODE IN PRODUCTION. */ contract SampleCompatible is IAutomateCompatible { /** * Public counter variable */ uint public counter; address public owner; /** * Use an interval in seconds and a timestamp to slow execution of Task */ uint public interval; uint public lastTimeStamp; constructor() { interval = 3600; lastTimeStamp = block.timestamp; owner = msg.sender; counter = 0; } function checkTask( bytes calldata /* checkData */ ) external view override returns (bool taskNeeded, bytes memory /* performData */) { taskNeeded = (block.timestamp - lastTimeStamp) > interval; // We don't use the checkData in this example. The checkData is defined when the Task was registered. } function performTask(bytes calldata /* performData */) external override { //We highly recommend revalidating the task in the performTask() function if ((block.timestamp - lastTimeStamp) > interval) { lastTimeStamp = block.timestamp; counter = counter + 1; } // We don't use the performData in this example. The performData is generated by the Automation Node's call to your checkTask() function } function setInterval(uint256 _interval) external { require(msg.sender == owner); interval = _interval; } } ``` ### Test it in Remix [**Try out this example contract in Remix**](https://remix.ethereum.org/?#code=Ly8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVApwcmFnbWEgc29saWRpdHkgXjAuOC43OwoKLy8gQXV0b21hdGlvbkNvbXBhdGlibGUuc29sIGltcG9ydHMgdGhlIGZ1bmN0aW9ucyBmcm9tIGJvdGggLi9BdXRvbWF0aW9uQmFzZS5zb2wgYW5kCi8vIC4vaW50ZXJmYWNlcy9BdXRvbWF0aW9uQ29tcGF0aWJsZUludGVyZmFjZS5zb2wKCmludGVyZmFjZSBJQXV0b21hdGVDb21wYXRpYmxlIHsKICAvKioKICAgKiBAbm90aWNlIG1ldGhvZCB0aGF0IGlzIHNpbXVsYXRlZCBieSB0aGUgYXV0b21hdG9ycyB0byBzZWUgaWYgYW55IHdvcmsgYWN0dWFsbHkKICAgKiBuZWVkcyB0byBiZSBwZXJmb3JtZWQuIFRoaXMgbWV0aG9kIGRvZXMgZG9lcyBub3QgYWN0dWFsbHkgbmVlZCB0byBiZQogICAqIGV4ZWN1dGFibGUsIGFuZCBzaW5jZSBpdCBpcyBvbmx5IGV2ZXIgc2ltdWxhdGVkIGl0IGNhbiBjb25zdW1lIGxvdHMgb2YgZ2FzLgogICAqIEBkZXYgVG8gZW5zdXJlIHRoYXQgaXQgaXMgbmV2ZXIgY2FsbGVkLCB5b3UgbWF5IHdhbnQgdG8gYWRkIHRoZQogICAqIGNhbm5vdEV4ZWN1dGUgbW9kaWZpZXIgZnJvbSBBdXRvbWF0ZUJhc2UgdG8geW91ciBpbXBsZW1lbnRhdGlvbiBvZiB0aGlzCiAgICogbWV0aG9kLgogICAqIEBwYXJhbSBjaGVja0RhdGEgc3BlY2lmaWVkIGluIHRoZSB0YXNrIHJlZ2lzdHJhdGlvbiBzbyBpdCBpcyBhbHdheXMgdGhlCiAgICogc2FtZSBmb3IgYSByZWdpc3RlcmVkIHRhc2suIFRoaXMgY2FuIGVhc2lseSBiZSBicm9rZW4gZG93biBpbnRvIHNwZWNpZmljCiAgICogYXJndW1lbnRzIHVzaW5nIGBhYmkuZGVjb2RlYCwgc28gbXVsdGlwbGUgdGFza3MgY2FuIGJlIHJlZ2lzdGVyZWQgb24gdGhlCiAgICogc2FtZSBjb250cmFjdCBhbmQgZWFzaWx5IGRpZmZlcmVudGlhdGVkIGJ5IHRoZSBjb250cmFjdC4KICAgKiBAcmV0dXJuIHRhc2tOZWVkZWQgYm9vbGVhbiB0byBpbmRpY2F0ZSB3aGV0aGVyIHRoZSBhdXRvbWF0b3Igc2hvdWxkIGNhbGwKICAgKiBwZXJmb3JtdGFzayBvciBub3QuCiAgICogQHJldHVybiBwZXJmb3JtRGF0YSBieXRlcyB0aGF0IHRoZSBhdXRvbWF0b3Igc2hvdWxkIGNhbGwgcGVyZm9ybXRhc2sgd2l0aCwgaWYKICAgKiB0YXNrIGlzIG5lZWRlZC4gSWYgeW91IHdvdWxkIGxpa2UgdG8gZW5jb2RlIGRhdGEgdG8gZGVjb2RlIGxhdGVyLCB0cnkKICAgKiBgYWJpLmVuY29kZWAuCiAgICovCiAgZnVuY3Rpb24gY2hlY2tUYXNrKGJ5dGVzIGNhbGxkYXRhIGNoZWNrRGF0YSkgZXh0ZXJuYWwgcmV0dXJucyAoYm9vbCB0YXNrTmVlZGVkLCBieXRlcyBtZW1vcnkgcGVyZm9ybURhdGEpOwoKICAvKioKICAgKiBAbm90aWNlIG1ldGhvZCB0aGF0IGlzIGFjdHVhbGx5IGV4ZWN1dGVkIGJ5IHRoZSBhdXRvbWF0b3JzLCB2aWEgdGhlIHJlZ2lzdHJ5LgogICAqIFRoZSBkYXRhIHJldHVybmVkIGJ5IHRoZSBjaGVja1Rhc2sgc2ltdWxhdGlvbiB3aWxsIGJlIHBhc3NlZCBpbnRvCiAgICogdGhpcyBtZXRob2QgdG8gYWN0dWFsbHkgYmUgZXhlY3V0ZWQuCiAgICogQGRldiBUaGUgaW5wdXQgdG8gdGhpcyBtZXRob2Qgc2hvdWxkIG5vdCBiZSB0cnVzdGVkLCBhbmQgdGhlIGNhbGxlciBvZiB0aGUKICAgKiBtZXRob2Qgc2hvdWxkIG5vdCBldmVuIGJlIHJlc3RyaWN0ZWQgdG8gYW55IHNpbmdsZSByZWdpc3RyeS4gQW55b25lIHNob3VsZAogICAqIGJlIGFibGUgY2FsbCBpdCwgYW5kIHRoZSBpbnB1dCBzaG91bGQgYmUgdmFsaWRhdGVkLCB0aGVyZSBpcyBubyBndWFyYW50ZWUKICAgKiB0aGF0IHRoZSBkYXRhIHBhc3NlZCBpbiBpcyB0aGUgcGVyZm9ybURhdGEgcmV0dXJuZWQgZnJvbSBjaGVja1Rhc2suIFRoaXMKICAgKiBjb3VsZCBoYXBwZW4gZHVlIHRvIG1hbGljaW91cyBhdXRvbWF0b3JzLCByYWNpbmcgYXV0b21hdG9ycywgb3Igc2ltcGx5IGEgc3RhdGUKICAgKiBjaGFuZ2Ugd2hpbGUgdGhlIHBlcmZvcm1UYXNrIHRyYW5zYWN0aW9uIGlzIHdhaXRpbmcgZm9yIGNvbmZpcm1hdGlvbi4KICAgKiBBbHdheXMgdmFsaWRhdGUgdGhlIGRhdGEgcGFzc2VkIGluLgogICAqIEBwYXJhbSBwZXJmb3JtRGF0YSBpcyB0aGUgZGF0YSB3aGljaCB3YXMgcGFzc2VkIGJhY2sgZnJvbSB0aGUgY2hlY2tEYXRhCiAgICogc2ltdWxhdGlvbi4gSWYgaXQgaXMgZW5jb2RlZCwgaXQgY2FuIGVhc2lseSBiZSBkZWNvZGVkIGludG8gb3RoZXIgdHlwZXMgYnkKICAgKiBjYWxsaW5nIGBhYmkuZGVjb2RlYC4gVGhpcyBkYXRhIHNob3VsZCBub3QgYmUgdHJ1c3RlZCwgYW5kIHNob3VsZCBiZQogICAqIHZhbGlkYXRlZCBhZ2FpbnN0IHRoZSBjb250cmFjdCdzIGN1cnJlbnQgc3RhdGUuCiAgICovCiAgZnVuY3Rpb24gcGVyZm9ybVRhc2soYnl0ZXMgY2FsbGRhdGEgcGVyZm9ybURhdGEpIGV4dGVybmFsOwp9CgovKioKICogVEhJUyBJUyBBTiBFWEFNUExFIENPTlRSQUNUIFRIQVQgVVNFUyBIQVJEQ09ERUQgVkFMVUVTIEZPUiBDTEFSSVRZLgogKiBUSElTIElTIEFOIEVYQU1QTEUgQ09OVFJBQ1QgVEhBVCBVU0VTIFVOLUFVRElURUQgQ09ERS4KICogRE8gTk9UIFVTRSBUSElTIENPREUgSU4gUFJPRFVDVElPTi4KICovCgpjb250cmFjdCBTYW1wbGVDb21wYXRpYmxlIGlzIElBdXRvbWF0ZUNvbXBhdGlibGUgewogICAgLyoqCiAgICAgKiBQdWJsaWMgY291bnRlciB2YXJpYWJsZQogICAgICovCiAgICB1aW50IHB1YmxpYyBjb3VudGVyOwogICAgYWRkcmVzcyBwdWJsaWMgb3duZXI7CgogICAgLyoqCiAgICAgKiBVc2UgYW4gaW50ZXJ2YWwgaW4gc2Vjb25kcyBhbmQgYSB0aW1lc3RhbXAgdG8gc2xvdyBleGVjdXRpb24gb2YgVGFzawogICAgICovCiAgICB1aW50IHB1YmxpYyBpbnRlcnZhbDsKICAgIHVpbnQgcHVibGljIGxhc3RUaW1lU3RhbXA7CgogICAgY29uc3RydWN0b3IoKSB7CiAgICAgICAgaW50ZXJ2YWwgPSAzNjAwOwogICAgICAgIGxhc3RUaW1lU3RhbXAgPSBibG9jay50aW1lc3RhbXA7CiAgICAgICAgb3duZXIgPSBtc2cuc2VuZGVyOwoKICAgICAgICBjb3VudGVyID0gMDsKICAgIH0KCiAgICBmdW5jdGlvbiBjaGVja1Rhc2soCiAgICAgICAgYnl0ZXMgY2FsbGRhdGEgLyogY2hlY2tEYXRhICovCiAgICApCiAgICAgICAgZXh0ZXJuYWwKICAgICAgICB2aWV3CiAgICAgICAgb3ZlcnJpZGUKICAgICAgICByZXR1cm5zIChib29sIHRhc2tOZWVkZWQsIGJ5dGVzIG1lbW9yeSAvKiBwZXJmb3JtRGF0YSAqLykKICAgIHsKICAgICAgICB0YXNrTmVlZGVkID0gKGJsb2NrLnRpbWVzdGFtcCAtIGxhc3RUaW1lU3RhbXApID4gaW50ZXJ2YWw7CiAgICAgICAgLy8gV2UgZG9uJ3QgdXNlIHRoZSBjaGVja0RhdGEgaW4gdGhpcyBleGFtcGxlLiBUaGUgY2hlY2tEYXRhIGlzIGRlZmluZWQgd2hlbiB0aGUgVGFzayB3YXMgcmVnaXN0ZXJlZC4KICAgIH0KCiAgICBmdW5jdGlvbiBwZXJmb3JtVGFzayhieXRlcyBjYWxsZGF0YSAvKiBwZXJmb3JtRGF0YSAqLykgZXh0ZXJuYWwgb3ZlcnJpZGUgewogICAgICAgIC8vV2UgaGlnaGx5IHJlY29tbWVuZCByZXZhbGlkYXRpbmcgdGhlIHRhc2sgaW4gdGhlIHBlcmZvcm1UYXNrKCkgZnVuY3Rpb24KICAgICAgICBpZiAoKGJsb2NrLnRpbWVzdGFtcCAtIGxhc3RUaW1lU3RhbXApID4gaW50ZXJ2YWwpIHsKICAgICAgICAgICAgbGFzdFRpbWVTdGFtcCA9IGJsb2NrLnRpbWVzdGFtcDsKICAgICAgICAgICAgY291bnRlciA9IGNvdW50ZXIgKyAxOwogICAgICAgIH0KICAgICAgICAvLyBXZSBkb24ndCB1c2UgdGhlIHBlcmZvcm1EYXRhIGluIHRoaXMgZXhhbXBsZS4gVGhlIHBlcmZvcm1EYXRhIGlzIGdlbmVyYXRlZCBieSB0aGUgQXV0b21hdGlvbiBOb2RlJ3MgY2FsbCB0byB5b3VyIGNoZWNrVGFzaygpIGZ1bmN0aW9uCiAgICB9CgogICAgZnVuY3Rpb24gc2V0SW50ZXJ2YWwodWludDI1NiBfaW50ZXJ2YWwpIGV4dGVybmFsIHsKICAgICAgICByZXF1aXJlKG1zZy5zZW5kZXIgPT0gb3duZXIpOwogICAgICAgIGludGVydmFsID0gX2ludGVydmFsOwogICAgfQp9) Compile and deploy your own Automation Counter onto a supported Testnet (currently, BNB Smart Chain). 1. In the Remix example, select the **Compile** tab on the left and press the **Compile** button. Make sure the compilation goes without errors; warnings in this example are acceptable and will not block the deployment. 2. Select the **Deploy** tab, set the **environment** to **Injected Provider — MetaMask**, confirm connecting to MetaMask, and **deploy** the AutomatedCounter.sol smart contract to Binance Smart Chain Testnet. When deploying the contract, specify the interval value; use a short value, e.g., 3s. This is the interval at which the `performTask()` function will be called. 3. After deployment is complete, copy the address of the deployed contract and use it to create and register a Task. Let's now look closer at the functions of the contract. ### Functions There are two main functions, which are inherited from the `IAutomateCompatible` interface: * `checkTask(bytes calldata checkData)` that `returns (bool taskNeeded, bytes memory performData)`; * `performTask(bytes calldata performData)`; #### `checkTask()` Repeatedly checks if the `performTask()` should be executed. `checkTask()` executes off-chain. ##### Parameters * `checkData` (bytes) — information passed at the Task registration phase to execute different code paths. For example, to check the balance of a specific address, set the `checkData` to abi encode of the address. `checkData` can be empty (0x). ##### Returns * `taskNeeded` (bool) — triggers an on-chain `performTask()` call when `true`. * `performData` (bytes) — passed to the `performTask()` function as `performData`, which allows you to perform complex and gas intensive calculations as a simulation off-chain and only pass the needed data on-chain. Use `abi.encode` for encoding/decoding. You can create a highly flexible off-chain computation infrastructure that can perform logic on-chain by using `checkData` and `performData`. Both computations are entirely programmable. #### `performTask()` When `checkTask()` returns `taskNeeded == true`, the Automation broadcasts a transaction to the blockchain to execute your `performTask()` function on-chain with `performData` as an input. :::info During the Task registration, you have to specify the max gas limit for the contract. You can learn the best gas value for your Task by simulating the `performTask()` function and adding enough overhead to take into account increases that might happen due to changes in `performData` or on-chain data. The limit you set cannot exceed the `callGasLimit` in the configuration of the Ankr Automation registry. ::: ##### Parameters * `performData` (bytes) — passed by `checkTask()` to the `performTask()` function. Use `abi.encode` for encoding/decoding. The data should always be validated against the current state of your deployed contract. Before using `performData` on-chain in `performTask()` and paying gas fees, use it off-chain in `checkTask()` to run extensive computations such as a high number of addresses that you are validating for conditions or identifying the subset of states that must be updated. ## Best practices ### Revalidate performTask() We recommend that you revalidate the conditions and data in performTask() before work is performed. By default, performTask() is external and thus any party can call it, so revalidation is recommended. If you send data from your checkTask() to your performTask() and this data drives a critical function, please ensure you put adequate checks in place. ### Perform only when conditions are met Some actions must be performed only when specific conditions are met. Check all of the preconditions within performTask() to ensure that state change occurs only when necessary. In this pattern, it is undesirable for the state change to occur until the next time the Task is checked by the network and the conditions are met. It is a best practice to stop any state change or effects by performing the same checks or similar checks that you use in checkTask(). These checks validate the conditions before doing the work. For example, if you have a contract where you create a timer in checkTask() that is designed to start a game at a specific time, validate the condition to ensure third-party calls to your performTask() function do not start the game at a different time. ### Perform only when data is verified Some actions must be performed using data you intend to use. Revalidate that the performData is allowed before execution. For example, if you have a performTask() that funds a wallet and the address of the wallet is received via the performData parameter, ensure you have a list of permissible addresses to compare against to prevent third-party calling your function to send money to their address. ### When performing is not harmful Sometimes actions must be performed when conditions are met, but performing actions when conditions are not met is still acceptable. Condition checks within performTask() might not be required, but it can still be a good practice to short circuit expensive and unnecessary on-chain processing when it is not required. It might be desirable to call performTask() when the checkTask() conditions haven’t yet been tested by Ankr Automation, so any specific checks that you perform are entirely use case specific. ### Test your contract As with all smart contract testing, it is important to test the boundaries of your smart contract in order to ensure it operates as intended. Similarly, it is important to make sure the compatible contract operates within the parameters of the TaskRegistry. Test all of your mission-critical contracts, and stress-test the contract to confirm the performance and correct operation of your use case under load and adversarial conditions. The Ankr Automation Network will continue to operate under stress, but so should your contract. ## Next read * [Automation overview](/automation/overview/) * [Time-based automation](/automation/time-based-automation/) * [Custom logic automation](/automation/custom-logic-automation/) * [Manage automation tasks](/automation/manage-tasks) --- url: https://www.ankr.com/docs/automation/custom-logic-automation/ title: Custom logic automation description: Custom logic automation Tasks allow you to automate calling a contract function on an event of your choice. For example, when a certain function in another c. source: docs/automation/custom-logic-automation.mdx --- # Custom logic automation Custom logic automation Tasks allow you to automate calling a contract function on an event of your choice. For example, when a certain function in another contract has been executed. To create a custom logic automation task, you need to: 1. Connect a wallet. 2. Create a custom logic Task and specify a contract and a function to execute. 3. Add custom logic. ## Connect a wallet :::info We recommend MetaMask as the most adopted and tested-out wallet and use it throughout our documentation. ::: To connect a wallet: 1. Visit [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). 2. Click **Connect wallet**. Click the connect wallet button 3. Choose a wallet. Choose a wallet 4. Connect the wallet. Connect the wallet 5. Successful wallet connection is indicated in the top-right corner, on the dashboard. Successful wallet connection ## Create a custom logic Task :::info Before creating a task, make sure your wallet address has some BNB to deposit. Your automation will need BNB to pay the gas fees. ::: To create a time-based Task: 1. Visit [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). 2. Click **Create Task**. Click Create Task 3. Enter Task details: a name, address of a [compatible contract](/automation/create-compatible-contracts/#example-contract), [**custom data**](/automation/create-compatible-contracts/#parameters), and gas limit. When done, click **Continue**.
Enter task details 4. Read the information message about the function check and click **Continue**. Set up the schedule 5. Top up your Ankr Automation account: click **Deposit** and add some BNB for the gas fees, then click **Continue**. Enter task details 6. Click **Create Task** to finish the process. Finish creating the Task 7. Confirm in MetMask deployment of your automation to the Ankr Automation registrar. You may be also asked to confirm a CRON wrapping transaction, so that makes up 2 txs in total. Confirm deployment of automation 8. You'll be redirected to [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/) to view and manage created Tasks. Check created task on Ankr Automation Dashboard ## Next read * [Automation overview](/automation/overview/) * [Time-based automation](/automation/time-based-automation/) * [Manage automation tasks](/automation/manage-tasks) * [Create compatible contracts](/automation/create-compatible-contracts/) --- url: https://www.ankr.com/docs/automation/manage-tasks/ title: Manage your automation Tasks description: To add funds: 1. Visit Ankr Automation Dashboard. 2. Click Funds in the top horizontal menu. source: docs/automation/manage-tasks.mdx --- # Manage your automation Tasks ## Fund Tasks :::tip Don't forget to fund your Ankr Automation account so your Tasks can keep running. Remember that actions that write to blockchain and not only read information from needing a gas fee to execute. ::: To add funds: 1. Visit [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). 2. Click **Funds** in the top horizontal menu. Click Funds 3. Enter an amount in the deposit field and click **Deposit**. Click Deposit 4. Confirm the deposit transaction in MetaMask. ## Pause or activate Tasks Each task can be paused for a time and activated. To do so: 1. Visit [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). 2. Choose a Task and click on it. Check created task on Ankr Automation Dashboard 3. Toggle the switch to pause or activate the Task accordingly. Toggle the switch to pause or activate the Task ## Withdraw funds If you choose to withdraw funds from your Ankr Automation account: 1. Visit [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). 2. Click **Funds** in the top horizontal menu. Click Funds 3. Enter an amount in the **Withdraw** field and click **Withdraw**. Click Withdraw 4. Confirm the withdrawal transaction in MetaMask. ## Next read * [Automation overview](/automation/overview/) * [Time-based automation](/automation/time-based-automation/) * [Custom logic automation](/automation/custom-logic-automation/) * [Create compatible contracts](/automation/create-compatible-contracts/) --- url: https://www.ankr.com/docs/automation/overview/ title: Contract automation description: Ankr Automation enables you to execute your contract functions based on various triggers. It is an automation platform that uses the same decentralized node. source: docs/automation/overview.mdx --- # Contract automation Ankr Automation enables you to execute your contract functions based on various triggers. It is an automation platform that uses the same decentralized node infrastructure that made Ankr so well-known and popular in crypto. Building with Ankr Automation will help you get to market faster and save you time and money on setup, maintenance, and risk costs.
## Available triggers Ankr Automation will execute smart contract functions based on various triggers. * Time-based triggers, allowing you to execute a contract function on a schedule of your choice. Your contract doesn't need to be compatible with `AutomationInterface`. * Custom logic triggers, allowing you to execute a contract function on a certain event. Your contract needs to be compatible with `AutomationInterface`. ### Time-based trigger Use it when you need to execute a contract function at a certain time. You can set date and time via conventional drop-down lists or write a CRON expression. First, deploy the contract you want to automate. Your contract doesn't need to be compatible with `AutomationInterface`. If your contract isn't verified, you will need the ABI for it. 1. Open [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). 2. Connect your wallet and switch to a supported network. 3. **Create Task** and select **Time-based trigger**. Set a name, provide the address of your deployed contract, provide the ABI if the contract isn't verified, and choose a function to execute. 4. Set the schedule via the drop-down list or a CRON expression. 5. Complete the remaining details. 6. Top up your account to meet the gas fee costs. You can manage created Tasks from [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). ### Custom logic trigger Use it when you need to execute a contract function on a certain event. First, deploy the contract you want to automate. Your contract needs to be compatible with `IAutomateCompatible`. 1. Open [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). 2. Connect your wallet and switch to a supported network. 3. **Create Task** and select **Custom logic trigger**. Set a name, provide the address of your deployed contract, choose a function to execute and provide the custom logic on when to execute that function. 5. Complete the remaining details. 6. Top up your account to meet the gas fee costs. You can manage created Tasks from [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). ## Supported networks Ankr Automation supports BNB Smart Chain. Support for other networks is coming soon. ## Next read * [Time-based automation](/automation/time-based-automation/) * [Custom logic automation](/automation/custom-logic-automation/) * [Manage automation tasks](/automation/manage-tasks) * [Create compatible contracts](/automation/create-compatible-contracts/) --- url: https://www.ankr.com/docs/automation/time-based-automation/ title: Time-based automation description: Time-based automation Tasks allow you to automate calling a contract function on a schedule of your choice. To create a time-based automation task, you need. source: docs/automation/time-based-automation.mdx --- # Time-based automation Time-based automation Tasks allow you to automate calling a contract function on a schedule of your choice. To create a time-based automation task, you need to: 1. Connect a wallet. 2. Create a time-based Task and specify a contract and a function to execute. 3. Specify a time schedule. ## Connect a wallet :::info We recommend MetaMask as the most adopted and tested-out wallet and use it throughout our documentation. ::: To connect a wallet: 1. Visit [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). 2. Click **Connect wallet**. Click the connect wallet button 3. Choose a wallet. Choose a wallet 4. Connect the wallet. Connect the wallet 5. Successful wallet connection is indicated in the top-right corner, on the dashboard. Successful wallet connection ## Create a time-based Task :::info Before creating a task, make sure your wallet address has some BNB to deposit. Your automation will need BNB to pay the gas fees. ::: To create a time-based Task: 1. Visit [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/). 2. Click **Create Task**. Click Create Task 3. Enter Task details: a name, contract address, contract function to be executed, and gas limit. When done, click **Continue**.
Your contract doesn't have to be compatible with the Ankr Automation interface.
If your contract hasn't been verified, it will need the ABI. If no ABI is fetched from the contract, click **Switch to custom ABI** and copy&paste the ABI code into the corresponding text box. Enter task details 4. Choose days and a time interval to execute the function: use a built-in scheduler or switch to **CRON expression** and provide a custom expression. Set a date and time for the task to initially start. When done, click **Continue**. Set up the schedule 5. Top up your Ankr Automation account: click **Deposit** and add some BNB for the gas fees, then click **Continue**. Enter task details 6. Click **Create Task** to finish the process. Finish creating the Task 7. Confirm in MetMask deployment of your automation to the Ankr Automation registrar. You may be also asked to confirm a CRON wrapping transaction, so that makes up 2 txs in total. Confirm deployment of automation 8. You'll be redirected to [Ankr Automation Dashboard](https://www.ankr.com/automate/dashboard/) to view and manage created Tasks. Check created task on Ankr Automation Dashboard ## Next read * [Automation overview](/automation/overview/) * [Custom logic automation](/automation/custom-logic-automation/) * [Manage automation tasks](/automation/manage-tasks) * [Create compatible contracts](/automation/create-compatible-contracts/) --- url: https://www.ankr.com/docs/basic-tutorials/ankrjs-advanced-apis-react-quickstart-guide/ title: Ankr.js (Advanced APIs) React Quickstart Guide description: By Dhaiwat Pandya Ankr.js is a JavaScript library that lets you interact with Ankr's Advanced APIs. In this guide, you'll learn how to create an NFT viewer. source: docs/basic-tutorials/ankrjs-advanced-apis-react-quickstart-guide.mdx --- # Ankr.js (Advanced APIs) React Quickstart Guide **By** [**Dhaiwat Pandya**](https://twitter.com/dhaiwat10) ________________ [Ankr.js](https://github.com/ankr-network/ankr.js) is a JavaScript library that lets you interact with [Ankr's Advanced APIs](https://ankr.com/advanced-api). In this guide, you'll learn how to create an NFT viewer app using the following technologies: - [Next.js](https://nextjs.org/) as the React/frontend framework - [TailwindCSS](https://tailwindcss.com/) as the CSS framework - [Ankr.js](https://github.com/ankr-network/ankr.js) to interact with Ankr's Advanced APIs - [Ankr's Advanced APIs](https://ankr.com/advanced-api) as the data source Hello ## Prerequisites To successfully finish this guide, you'll only need [Node.js](https://nodejs.org/en/) and [Yarn](https://yarnpkg.com/) installed on your machine. ## Step 1: Set Up Your Next.js Starter Project Navigate into a directory of your choice and run the following command in your terminal to set up a new Next.js project: ``` yarn create next-app --ts ankrjs-tutorial ``` You can now navigate into the directory and launch the app: ``` cd ankrjs-tutorial && yarn dev ``` Here's what it looks like at the moment: fig2 The app currently only contains the boilerplate code provided by Next.js. Over the course of the next few sections, you'll set up Ankr.js and use it to create a gallery of NFTs for any given wallet address. Before we proceed to step 2, feel free to set up TailwindCSS by following their [official guide for Next.js.](https://tailwindcss.com/docs/guides/nextjs) ## Step 2: Install And Set Up Ankr.js Next, you will install and set up Ankr.js so that you can use it to fetch all the NFTs for a given wallet address later on. Start by installing the `ankr.js` package from npm: ``` # ./ankrjs-tutorial yarn add @ankr.com/ankr.js ``` Next, create a new file named `utils.ts` at the root of your project directory. You will initialize Ankr.js in this file. File: `./utils.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; const provider = new AnkrProvider(''); ``` Your provider instance will be your interface to the Ankr Advanced APIs whenever you want to fetch some data from them. ## Step 3: Create NFT Retrieval Function In this step, you will create a `getNfts` function that accepts a walletAddress and returns a list of NFTs owned by that address. You can utilize the `getNFTsByOwner` function provided by Ankr.js for this. File: `./utils.ts` ```javascript import AnkrProvider from '@ankr.com/ankr.js'; const provider = new AnkrProvider(''); export const getNfts = async (address: string) => { const { assets } = await provider.getNFTsByOwner({ walletAddress: address, blockchain: 'eth', }); return { nfts: assets, }; }; ``` Just to see if things are working, let's call this function on our page i.e. `./pages/index.tsx` and log out the output. File: `./pages/index.tsx` ```javascript import type { NextPage } from 'next'; import { useEffect } from 'react'; import { getNfts } from '../utils'; const Home: NextPage = () => { useEffect(() => { (async () => { const { nfts } = await getNfts( '0xB2Ebc9b3a788aFB1E942eD65B59E9E49A1eE500D' ); console.log({ nfts }); })(); }, []); return (

NFT viewer

); }; export default Home; ``` You should see a list of nfts being logged out in your browser's console. fig3 ## Step 4: Create Wallet Address Input You will now add an input to the UI that lets the user input any wallet address they want and pass it to the `getNfts` function. You can keep track of the wallet address input in a state variable named `walletAddress`, hook it up to the input element in the UI, and then pass `walletAddress` to the `getNfts` function. File: `./pages/index.tsx` ```javascript /* eslint-disable @next/next/no-img-element */ import type { NextPage } from 'next'; import Link from 'next/link'; import { useState } from 'react'; import { useNfts } from '../hooks'; const Home: NextPage = () => { const [walletAddress, setWalletAddress] = useState( '0xB2Ebc9b3a788aFB1E942eD65B59E9E49A1eE500D' ); useEffect(() => { (async () => { const { nfts } = await getNfts(walletAddress); console.log({ nfts }); })(); }, [walletAddress]); return (

NFT viewer

setWalletAddress(e.target.value)} className='rounded p-2 w-[400px] border' placeholder='Enter a wallet address here' />
); }; export default Home; ``` You should see a different list of `nfts` being logged out in the console when you change the wallet address in the input now. Congrats! You are now able to fetch the list of NFTs owned by any given address. fig4 ## Step 5: Display NFTs In Your UI You can start off by storing the list of NFTs you fetch in a state variable named `nfts`. You can then loop through `nfts` and display all the NFTs in a grid. File: `./pages/index.tsx` ```javascript /* eslint-disable @next/next/no-img-element */ import type { NextPage } from 'next'; import Link from 'next/link'; import { useState } from 'react'; import { useNfts } from '../hooks'; const Home: NextPage = () => { const [walletAddress, setWalletAddress] = useState( '0xB2Ebc9b3a788aFB1E942eD65B59E9E49A1eE500D' ); const [nfts, setNfts] = useState([]); useEffect(() => { (async () => { const { nfts } = await getNfts(walletAddress); console.log({ nfts }); setNfts(nfts); })(); }, [walletAddress]); return (
...
{nfts.map((nft) => { return (
{nft.name} {nft.name} {nft.collectionName}
); })}
); }; export default Home; ``` You should now see a gallery of all the NFTs owned by the given wallet address of your choice. LFG! Hello # Conclusion & Next Steps Ankr.js and Ankr Advanced APIs have so much more to offer than what we covered in this quick-start guide. Ankr.js gives you access to all sorts of data from seven different chains. Learn more [here!](https://github.com/ankr-network/ankr.js#️-ankrjs) Apart from that, you can make some UX improvements to the app we built in the guide. We did not handle the loading or the error state for our app. You can try fixing that on your own! If you want to go the fancy route, you can create a useNfts hook on top of the getNfts function to do this. --- url: https://www.ankr.com/docs/basic-tutorials/backend-nodejs-ipfs-file-uploader-with-filebase/ title: Create A Backend NodeJS IPFS File Uploader With Filebase description: By Manny If you’d like to understand IPFS a bit better, check out the last article written to easily understand & upload files to IPFS with filebase. This t. source: docs/basic-tutorials/backend-nodejs-ipfs-file-uploader-with-filebase.mdx --- # Create A Backend NodeJS IPFS File Uploader With Filebase **By** [**Manny**](https://twitter.com/codingwithmanny) ________________ # IPFS & Filebase If you’d like to understand IPFS a bit better, check out the last article written to easily understand & upload files to IPFS with filebase. This tutorial will focus on creating a Node Backend API that allows for uploading to IPFS with Filebase. ipfs ## Requirements Before we start, we need to make sure that you have the following installed locally on your computer. - [NVM](https://github.com/nvm-sh/nvm) or [Node v16.15.1](https://nodejs.org/en/) - [Yarn](https://yarnpkg.com/) - [Postman](https://www.postman.com/) (Optional - will also show with curl) ## Node Project Setup The first step is to setup our project from scratch with Express & Typescript. ```bash mkdir node-filebase-ipfs-uploader; cd node-filebase-ipfs-uploader; mkdir bucket; # Folder we'll be using for local testing touch bucket/.gitkeep; # To make sure we keep the folder and not its file mkdir src; # Where our code will live echo "16.15.1" > .nvmrc; nvm install; # ignore if you already have Node 16.15.1 installed yarn init -y; git init; echo "node_modules\n.env\nbucket/*\n\!bucket/.gitkeep\nbuild\n*.log" > .gitignore; yarn add aws-sdk cors express dotenv multer multer-s3 typescript @aws-sdk/client-s3 @types/cors @types/express @types/multer-s3 @types/node; yarn add -D nodemon ts-node; ./node_modules/.bin/tsc --init; # generates our tsconfig.json file ``` Now that we have our project setup, let’s make a modification to our TypeScript config file to adjust for the output folder to be set to `./build`. File: `./tsconfig.json` ```json { "compilerOptions": { /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ /* Language and Environment */ "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ "module": "commonjs" /* Specify what module code is generated. */, // "rootDir": "./", /* Specify the root folder within your source files. */ "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ // "types": [], /* Specify type package names to be included without being referenced in a source file. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ // "resolveJsonModule": true, /* Enable importing .json files. */ // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ /* JavaScript Support */ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ /* Emit */ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ // "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ "sourceMap": true /* Create source map files for emitted JavaScript files. */, // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ "outDir": "./build" /* Specify an output folder for all emitted files. */, // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ // "newLine": "crlf", /* Set the newline character for emitting files. */ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ /* Interop Constraints */ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, /* Type Checking */ "strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ /* Completeness */ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ } } ``` ## Creating Initial Server Endpoints Now that we have our initial project configuration and files setup, we’re going to create two new files that host both the endpoints and the server respectively. The first file is the endpoints and our initial Express server configurations with a single get endpoint on the root to verify that the server is working. File: `./src/app.ts` ```typescript // Imports // ======================================================== import { config } from "dotenv"; import express from "express"; import cors from "cors"; // ENV VARS // ======================================================== config(); const NODE_ENV: string = process.env.NODE_ENV || "development"; // Init // ======================================================== /** * Initial ExpressJS */ const app = express(); // Middlewares // ======================================================== /** * Allows for requests from other servers */ app.use(cors()); // Endpoints / Routes // ======================================================== /** * Main endpoint to verify that things are working and what environment mode it's running in */ app.get("/", (_req, res) => res.send({ environment: NODE_ENV })); // Exports // ======================================================== export default app; ``` Our second file imports the endpoints and runs them on a specific server. Typically you might have seen both of these in the same files, but for testing (covered in another article), it’s typically easier to run unit and integration tests without the server running to separate concerns. File: `./src/server.ts` ```typescript // Imports // ======================================================== import app from "./app"; import { config } from "dotenv"; // ENV VARS // ======================================================== config(); const NODE_ENV: string = process.env.NODE_ENV || "development"; const PORT: number = NODE_ENV === "production" ? 8080 : parseInt(process.env.PORT || "5001", 10); // Server // ======================================================== app.listen(PORT, () => console.log(`Listening on PORT ${PORT}\nEnvironment: ${NODE_ENV}`) ); ``` Next, let’s make it easier for ourselves by adding a script command to our `package.json` file, so we can run `yarn dev`. File: `./package.json` ```bash { "name": "node-filebase-ipfs-uploader", "version": "1.0.0", "main": "index.js", "license": "MIT", "scripts": { "dev": "nodemon src/server.ts" }, "dependencies": { "@aws-sdk/client-s3": "^3.113.0", "@types/cors": "^2.8.12", "@types/express": "^4.17.13", "@types/multer-s3": "^3.0.0", "@types/node": "^18.0.0", "aws-sdk": "^2.1157.0", "cors": "^2.8.5", "dotenv": "^16.0.1", "express": "^4.18.1", "multer": "^1.4.5-lts.1", "multer-s3": "^3.0.1", "typescript": "^4.7.4" }, "devDependencies": { "nodemon": "^2.0.16", "ts-node": "^10.8.1" } } ``` Now if we run `yarn dev` and open up our browser to `http://localhost:5001` we should see our server running. ``` bash # /node-filebase-ipfs-uploader yarn dev; # Expected Output # $ nodemon src/server.ts # [nodemon] 2.0.16 # [nodemon] to restart at any time, enter `rs` # [nodemon] watching path(s): *.* # [nodemon] watching extensions: ts,json # [nodemon] starting `ts-node src/server.ts` # Listening on PORT 5001 # Environment: development ``` ipfs Our server is now working, now we need to add upload functionality. Adding Local File Upload In order to get a file uploader code setup, we’re going to take advantage of an npm package called multer. [Multer](https://www.npmjs.com/package/multer) is a middleware that makes developer’s lives easier when handling files. It is originally done for just local development, but there are additional extensions that support AWS S3, which we’ll be using for Filebase. We’re going to modify our original endpoints file to include a new POST upload endpoint that utilizes multer. File: `./src/app.ts` ```typescript // Imports // ======================================================== import { config } from "dotenv"; import express from "express"; import cors from "cors"; import multer from "multer"; // ENV VARS // ======================================================== config(); const NODE_ENV: string = process.env.NODE_ENV || "development"; const FILE_DEST: string = process.env.FILE_DEST || "bucket"; const FILE_SERVER_URL: string = process.env.FILE_SERVER_URL || "http://localhost:5002"; // Init // ======================================================== /** * Initial ExpressJS */ const app = express(); // Middlewares // ======================================================== /** * Allows for requests from other servers */ app.use(cors()); /** * Main uploader middleware that configures the final `destination` of the file and how the `filename` would be set once saved */ const upload = multer({ storage: multer.diskStorage({ destination: (_req, file, callback) => { callback(null, FILE_DEST); }, filename: (_req, file, callback) => { callback(null, file.originalname); }, }), }); // Endpoints / Routes // ======================================================== /** * Main endpoint to verify that things are working and what environment mode it's running in */ app.get("/", (_req, res) => res.send({ environment: NODE_ENV })); /** * Upload endpoint that accepts an input file field of `file` */ app.post("/upload", upload.single("file"), (req, res) => { const responseData = { file: req.file?.originalname, url: `${FILE_SERVER_URL}/${req.file?.originalname}`, }; return res.json({ data: responseData }); }); // Exports // ======================================================== export default app; ``` While the server is running, let’s make an upload. **Curl:** ```bash # /node-filebase-ipfs-uploader curl --location --request POST 'http://localhost:5001/upload' \ --form 'file=@"/full/path/to/node-filebase-ipfs-uploader/test/test-forever.jpg"'; # Expected Output # {"data":{"file":"test-forever.jpg","url":"http://localhost:5002/test-forever.jpg"}} ``` **Postman:** ipfs To confirm that the file has also been uploaded, we can check our `bucket` folder to see a new `test-forever.jpg` created. We can also create a server on port 5002 to see that our file is uploaded by running the following: ```bash # /node-filebase-ipfs-uploader npx http-server -p 5002 bucket; # Expected Output # npx: installed 39 in 3.094s # Starting up http-server, serving bucket # # http-server version: 14.1.1 # # http-server settings: # CORS: disabled # Cache: 3600 seconds # Connection Timeout: 120 seconds # Directory Listings: visible # AutoIndex: visible # Serve GZIP Files: false # Serve Brotli Files: false # Default File Extension: none # # Available on: # http://127.0.0.1:5002 # http://10.0.0.6:5002 # Hit CTRL-C to stop the server ``` If we open up `http://localhost:5002/test-forever.jpg` we can see in our browser that image is there. ipfs Now that we have the base setup for our local uploads, we’re going to leverage multer-s3 to utilize Filebase’s AWS S3 Client compatibility. ## Adding Filebase IPFS Support Before we can add the code, we’ll need to create a new account at Filebase.com. Once an account has been created, we’ll need to create a new **bucket**, with the **Storage Network** set to **IPFS (All data is public)**. ipfs ipfs ipfs Once we have our newly created bucket, we’re going to take note of the name so that we can use it later, and then get our Access Keys. ipfs Now that we have the values, we’re going to create a dot environment file `.env`, but we’ll create a template (.env.example) for it because we should never save our `.env` to our git repository. ```bash # /node-filebase-ipfs-uploader echo "PORT=5001\nNODE_ENV=development\nFILEBASE_ACCESS_KEY=key\nFILEBASE_SECRET_KEY=secret\nFILEBASE_BUCKET=bucket\nFILEBASE_REGION=us-east-1\nFILE_SERVER_URL=http://localhost:5002" > .env.example; cp .env.example .env; ``` In our copied .env we’ll need to fill it out with the values we just got from Filebase. File: `./.env` ``` PORT=5001 NODE_ENV=development FILEBASE_ACCESS_KEY= FILEBASE_SECRET_KEY= FILEBASE_BUCKET= FILEBASE_REGION=us-east-1 FILE_SERVER_URL=http://localhost:5002 ``` What we want to do is create a way so that when we’re running in `development` mode the files upload to our local `bucket` folder, but when we’re in production mode, the files upload to IPFS with Filebase. To do this, we’re going to take advantage of our `NODE_ENV` and modify our `upload` middleware to use a different multer configuration when the `NODE_ENV` is set to production. More specifically, we’ll be using an extension of `multer` called `multer-s3` that handles requests regularly to AWS S3 but because Filebase is an AWS S3 compatible service, we’ll just configure it to point to Filebase. File: `./src/app.ts` ```typescript // Imports // ======================================================== import { config } from "dotenv"; import express from "express"; import cors from "cors"; import multer from "multer"; import multerS3 from "multer-s3"; import { S3Client, GetObjectCommand } from "@aws-sdk/client-s3"; // ENV VARS // ======================================================== config(); const NODE_ENV: string = process.env.NODE_ENV || "development"; const FILE_DEST: string = process.env.FILE_DEST || "bucket"; const FILE_SERVER_URL: string = process.env.FILE_SERVER_URL || "http://localhost:5002"; const FILEBASE_BUCKET = process.env.FILEBASE_BUCKET || ""; // Configured AWS S3 Client For Filebase const s3 = new S3Client({ endpoint: "https://s3.filebase.com", region: process.env.FILEBASE_REGION || "", credentials: { accessKeyId: process.env.FILEBASE_ACCESS_KEY || "", secretAccessKey: process.env.FILEBASE_SECRET_KEY || "", }, }); // Init // ======================================================== /** * Initial ExpressJS */ const app = express(); // Middlewares // ======================================================== /** * Allows for requests from other servers */ app.use(cors()); /** * Main uploader middleware that configures the final `destination` of the file and how the `filename` would be set once saved */ const upload = // If production use the s3 client NODE_ENV === "production" ? multer({ storage: multerS3({ s3: s3, bucket: FILEBASE_BUCKET, metadata: (_req, file, cb) => { cb(null, { fieldName: file.fieldname }); }, key: (_req, file, cb) => { cb(null, file.originalname); }, }), }) : multer({ storage: multer.diskStorage({ destination: (_req, file, callback) => { callback(null, FILE_DEST); }, filename: (_req, file, callback) => { callback(null, file.originalname); }, }), }); // Endpoints / Routes // ======================================================== /** * Main endpoint to verify that things are working and what environment mode it's running in */ app.get("/", (_req, res) => res.send({ environment: NODE_ENV })); /** * Upload endpoint that accepts an input file field of `file` */ app.post("/upload", upload.single("file"), async (req, res) => { const responseData = { file: req.file?.originalname, url: `${FILE_SERVER_URL}/${req.file?.originalname}`, }; // If production retrieve file data to get the ipfs CID if (NODE_ENV === "production") { const commandGetObject = new GetObjectCommand({ Bucket: FILEBASE_BUCKET, Key: req.file?.originalname, }); const response = await s3.send(commandGetObject); responseData.url = `ipfs://${response.Metadata?.cid}`; } return res.json({ data: responseData }); }); // Exports // ======================================================== export default app; ``` Now, in order to test it, we just need to create a different start script that passes a new `NODE_ENV`. To do this, we’ll need to modify our `package.json` File: `./package.json` ```bash { "name": "node-filebase-ipfs-uploader", "version": "1.0.0", "main": "index.js", "license": "MIT", "scripts": { "dev": "nodemon src/server.ts", "start": "export NODE_ENV=production && tsc && node build/server.js" }, "dependencies": { "@aws-sdk/client-s3": "^3.113.0", "@types/cors": "^2.8.12", "@types/express": "^4.17.13", "@types/multer-s3": "^3.0.0", "@types/node": "^18.0.0", "aws-sdk": "^2.1157.0", "cors": "^2.8.5", "dotenv": "^16.0.1", "express": "^4.18.1", "multer": "^1.4.5-lts.1", "multer-s3": "^3.0.1", "typescript": "^4.7.4" }, "devDependencies": { "nodemon": "^2.0.16", "ts-node": "^10.8.1" } } ``` Now when we run the following we should see our server running on port 8080. ```bash # /node-filebase-ipfs-uploader yarn start; # Expected Output # yarn run v1.22.18 # $ export NODE_ENV=production && tsc && node build/server.js # Listening on PORT 8080 # Environment: production ``` If we try uploading our file again with curl or Postman with the new address, we should get a different result. **Curl:** ```bash # /node-filebase-ipfs-uploader curl --location --request POST 'http://localhost:8080/upload' \ --form 'file=@"/full/path/to/node-filebase-ipfs-uploader/test/test-forever.jpg"'; # Expected Output # {"data":{"file":"test-forever.jpg","url":"ipfs://QmY8UXb7Nka5VWkXXRAMC1DQtamc1s8xzcjoQY6GaEbTdn"}} ``` **Postman:** ipfs Seeing that IPFS url, we can go to it directly and see that it’s actually persisted on the decentralized storage. ``` https://ipfs.filebase.io/ipfs/bafybeierozrtdlir5ywdguah573ga25a7tzzhqeh7kvlvfx2y2wqymdj7u ``` ipfs There you have it, we built a Backend IPFS File Uploader with Filebase. ### What’s Next? Now that you have the backend, the next step is to build a frontend that communicates with the backend. Another aspect that could be worked on is the deployment of the backend to either a service like Digital Ocean with Docker, or Netlify with Edge Functions. --- url: https://www.ankr.com/docs/basic-tutorials/dao-in-5min/ title: How to Create your First DAO using Plug-and-Play No-Code Solution On Ethereum description: By Krinza Momin I'm writing this article thinking about two things. First, why is the web3 community obsessed with three-letter words - think ICOs, NFTs, an. source: docs/basic-tutorials/dao-in-5min.mdx --- # How to Create your First DAO using Plug-and-Play No-Code Solution On Ethereum **By** [**Krinza Momin**](https://twitter.com/kayprasla) ____________________________________ I'm writing this article thinking about two things. First, why is the web3 community obsessed with three-letter words - think ICOs, NFTs, and now DAO? Second, will the no-code revolution really dismantle the mentality that building cool stuff is only reserved for very serious developers?! I mean, I'm no Naval Ravikant, so I won’t say that the next big thing in code is no-code but I'll rather let Chris echo that on my behalf: > "The future of coding is no coding at all." - Chris Wanstrath, CEO at GitHub. Anyway, getting back to the topic, the DAO; a new-ish type of organizational structure and another hot acronym on the block. For those of you who aren't familiar with what DAO is, [toggle the tweet](https://twitter.com/themetav3rse/status/1456337864342466561?s=20&t=wzXj7B8cqaclAlYDFi2MXw). For the rest of you, enter the playground! __________________ ### So, what are we building today? A DAO. *haha, I already read the title … tell me more!* Um, without writing a single line of code. *what do you think why I clicked on this article, huh?* Let me just show you instead. Also, was that just me talking to myself or what? Hello TL;DR: We will build a DAO on [Aragon Client](https://client.aragon.org/#/)↗ and deploy it on the Ethereum Rinkeby Testnet. By the end of this tutorial, you’ll be able to: - deploy a DAO - declare the name and symbol for your token - allocate tokens to the members of the DAO - create the first proposal question - begin the voting process - and enter your first vote in favor/against the proposal ## Wait, what’s Aragon though? Aragon is a DAO maker tool for beginners and developers to create their first of many DAOs in a couple of clicks. This tool will help you with managing your DAO members, their votes, and proposals, and will let you admin your funds directly on the blockchain without writing a single line of code. Hello ______________________________ ## Getting Started Before we get started deploying our very first DAO, make sure your Metamask wallet is connected with the Rinkeby Testnet. Next, we will need some test ethers to make transactions. So, head over to the [Rinkeby Faucet](https://faucets.chain.link/rinkeby)↗, follow through the instructions, and get yourself some test ETH. You'll at least need 0.2 test ETH. ### Setting up a DAO Head over to [Aragon Client](https://client.aragon.org/#/)↗ and follow these steps: - Click on the "Connect Account" button and select "Metamask", approve the request from MetaMask, and connect with the ‘Ethereum Rinkeby Testnet. - Navigate to the "Create an organization" option and click on that. Hello Once you select the "Create an Organization" button, you'll land to this page where you'll be given a few options as pre-configured templates for your DAO, with the details given already. Hello For this project, we will opt for the "Company" template where the tokens are transferable and decisions are based on the weighted voting system. > In a weighted voting system, all votes are valid but not equally counted. Each voter's voting power is based on the size of their stake; their individual level of status or expertise; or according to pre-defined organizational rules. - Next up, we will set up the DAO's name. The name you choose will be mapped to the organization's address and cannot be changed after you launch it. Hello - Once you set up the name from the DAO, click "Next: Configure template". ### Configure Voting Hello Now, in the above screenshot, you see a couple of different options which we will be exploring below: - **Support %** is the relative percentage of tokens that are required to vote “Yes” for a proposal to be approved. For example, if “Support” is set to 50%, then more than 50% of the tokens used to vote on a proposal must vote “Yes” for it to pass. - **Minimum Approval %** is the percentage of the total token supply that is required to vote “Yes” on a proposal before it can be approved. For example, if the “Minimum Approval” is set to 20%, then more than 20% of the outstanding token supply must vote “Yes” on a proposal for it to pass. - **Vote Duration** is the length of time that the vote will be open for participation. For example, if the Vote Duration is set to 24 hours, then token holders have 24 hours to participate in the vote. You can set the settings which might suit best for your DAO, for the sake of this project, let's go with the default configs. ### Set Tokens! Now that we have configured the voting mechanism for the DAO, you can now set a desired name and symbol for your token. Hello - Enter the token name and symbol - Enter the addresses of the DAO members or holders and allocate tokens to them. - Review the information and hit ‘Launch your organization’. After you launch your organization, the Metamask window will pop up for transaction approval. Confirm the transaction and make sure you don't select the speed-up option in MetaMask. Also, do not refresh the window. Hello With that, you should be presented with a screen similar to this: Hello ### First Proposal, First Vote Click on get started, and let us create our very first proposal to begin the voting process. Hello - Click on ‘Vote’ from the options shown or find 'Voting' from the left menu and click on ‘Create a New Vote’. - Add in the proposal question and open it for voting. This action will require you to sign a transaction for the proposal to go live. Hello Once the proposal is live, members can vote "yes" or "no" based on their decision in favor or against the question asked. The voting window will be open for the time duration set in the earlier steps. In our case, it is 24 hours only. Hello Now that you have successfully published the first proposal, you can finally register your first vote! _______________________________ ## Next Steps If you're leaving under a rock, here is some news for you - Ethereum Rinkeby Testnet will be deprecated soon. Don't fret, we're good for now and I'll update these tutorials as the testnet landscape changes. But for now, here's a task for you all: Create an exclusive club for your friends online (aka DAO) and deploy it on the Polygon network instead (here's me saving you from dollars worth of deployment cost). --- url: https://www.ankr.com/docs/basic-tutorials/dapp-on-ethereum-using-nocode/ title: Build an end-to-end Crypto Picks Board with No-Code on Ethereum description: By Krinza Momin Now that you have entered the chat, let me guess what made you swipe right on this article. Is that the “pickup lines” and you desperately w. source: docs/basic-tutorials/dapp-on-ethereum-using-nocode.mdx --- # Build an end-to-end Crypto Picks Board with No-Code on Ethereum **By** [**Krinza Momin**](https://twitter.com/kayprasla) ____________________________________ Now that you have entered the chat, let me guess what made you swipe right on this article. Is that the “pickup lines” and you desperately wanting to avoid the low level uttering of "hey.” Or is it the “no-code” buzzword that many coders roll their eyes at? In any case, at least it made an impression. So why not capitalize on both the no-code and have a crack at our idea of building a Pickup Line dApp on-chain. __________________________ ## So, what are we building exactly? In this tutorial, we will be creating a pickup line directory app with Atra and deploy it on the Ethereum Rinkeby Testnet. By the end of this you’ll be able to: - manage, customize, and deploy a decentralized database - configure triggers, which “reacts” to certain actions we make in the database - and build a minimal frontend all without writing a single line of code. [Here](https://console.atra.io/app/191ed8b7-01b1-4044-8256-0b664c77ac2d)↗ is the sample dApp all set and ready to be used for the reference, and this is exactly what we will be building. Hello ________________________ ## Wait, What’s Atra Though? Atra is a platform that offers services and tools to help users build and maintain dApps. We will be using Atra’s 3 beta services - dTables, Triggers and LiteUI to build an end-to-end application on Ethereum Rinkeby Testnet. Will explore all three services in detail below, as we move on to building our dApp. Hello Here's a brief about each beta service: - **dTables:** act as relational databases that can be deployed in one single click. Its fast, simple and offers data storage on the Ethereum public network. - **Triggers:** helps create business logic for the application. It controls access and helps map user-input values by creating a response or reacting against every action. - **LiteUI:** serves drag and drop UI elements to build a website that connects the services to the frontend and integrates decentralized resources with Ethereum instantly. Now that we have some knowledge about the tool we will be using, let's get building! ________________________ ## Getting Started Before we dive into the project, first thing we need to set up is a Metamask account with some test ethers added. If you have a MetaMask wallet installed, setup and running, you can skip to the next section. If you don’t have one, install [Metamask](https://metamask.io/download/) for your browser and follow through the steps needed to set up an account. Once Metamask is installed, make sure you are connected with the Rinkeby test network. Next, you’ll need to deposit test Ether into your wallet so you can sign some transactions. For that, head to the [faucet](https://faucets.chain.link/rinkeby) to top up your account with some ether. With that, you now have the basic requirements for building a decentralized application on Atra. So, let’s start building our dApp! ### Step 1: Create A dTable As briefed above, dTables are used to store information or any data we might want to record for our application. In our case, we will be storing user entered pickup lines to our application on the Ethereum blockchain. Follow the steps below to get the dTable created for the pickup lines: - Navigate to [console.atra.io/](https://console.atra.io/) and find the `Services` dropdown in the nav bar - Select `dTables` to land on the dTable service dashboard - Now, click the `Create Table` button and set the **Name** field to "Picks" and **Description** to whatever explanation you want to enter for the table. Hello In the next section, we will add a column for each piece of information we want to store in the database as shown in the screenshot above. Once the columns are set, click on `Create dTable`. > **Note:** Once table is created, you won't be able to edit it again as the table will be deployed to the Ethereum Rinkeby network. Hello You can monitor the status of the dTable deployment on the dTables Dashboard. The green lightning bolt means the table is successfully deployed on the network. You can even view the deployed contract on etherscan by following the next section. ### Step 2: View The Deployed Smart Contract On Etherscan Once the lighting bolt icon go green, click on the newly created table and you'll see the `Contracts` tab. - Click on that to explore the Ethereum smart contract, written in solidity Hello You can also view the creation of the table on Etherscan by clicking on the Rinkeby Address. Hello The dTables contract is specifically designed to store records. It uses methods for inserting, reading, updating, and deleting records. We can also see these contract methods in action while we insert a new record into the table. ### Step 3: Insert New Records - Click the New Record button given on the top right corner of the screen This will open a pop up on the page where you’ll see inputs for each column. We are manually going to insert a record as shown below. Hello - Click `Insert Record` and you should be able to see the newly created entry in the table as well on Etherscan Hello Hello In the next section, we will start to build the logic to allow users the ability to modify the table themselves. In this case, the users would be adding a pickup line entry to the table without paying any gas fee for their transaction. ### Step 4: Add Trigger In this section, we will add the base functionality for users to post their fav pickup lines on the dApp we are building. To add a trigger for new entries in the table, go through the steps below: - From the nav bar, select `Triggers` from the `services` dropdown and you'll land on a triggers dashboard - From the Triggers Dashboard, click the ‘Create Trigger’ button and you will land on the **Set Actions** tab on the **Create trigger** page. Hello - Once you land on the trigger page, you'll see three options. In this tutorial, we will only be using the `Insert` action, as we want to allow users to create a new entry on the board. - Select ‘Insert a Record’ as the method type, `Picks` as the table we want to modify and configure the value mapping to the values as shown below: Hello Click on `Next` and you will land on the Conditions tab, which is where you can set conditions that must be met for your trigger to execute. In this tutorial, we will not use conditions. Next, we will set the configuration for payment of the transactions. Because we don't want to charge users ETH to add pickup lines to the board, therefore we will be marking "**No**" under the payment option and move on to the next step. Hello At this point, we’re almost done. We just have to name and review the **Trigger** which you can refer from the screenshot below. Hello - Once done, click on `Deploy` and wait for the trigger to go live. Hello Click on the `InsertPicks` Trigger and in the details tab, click ‘Grant Permission’ which will give the underlying smart contract permission to interact with the dTable’s smart contract. Now that we have our table and trigger ready, let's go ahead a create a UI for this project using the LiteUI service. ### Step 5: Create The User Interface In this section, we will combine everything we just created into one simple user interface. LiteUI will bring together our dTables and Triggers, and give us a public website URL which we can share with our users. To start building the UI, you can follow through design I made in the reference website or you can go ahead and create your own user interface for the dApp. - First, select `LiteUI` option from the **Services** dropdown in the navigation and create a new LiteUI - Click the `Plus` button in the upper right of the dashboard and give a name to your dApp Hello - Next, we can add our first page which will serve as our home page. Click the **Add Page ** button in the purple header, type whatever you want to call the home page, hit enter or click ‘Save’ to add the page to our LiteUI Hello Now that we have named our application and created the first page, it’s time to add a UI Element to the home page. Go ahead and add some `text`, our `dTable` and then the `form` for users to be able to entry new pickup lines in our board. Once you add all of the UI elements to the website, click `Save` in the upper right corner of the page. Enter back into the LiteUI from the dashboard, click the 'Open Public URL' link under the Update button and you are good to share this link with everyone to add their fav pickup lines to the board. Hello With that, your dApp is ready! The URL is accessible to anyone, however the user will need MetaMask installed and have testnet Ether to post pickup lines to the board through the `InsertPick` form within our dApp. Hello ______________________ ## Next Steps Now that you have created your first dApp with Atra, you can go explore and experiment with the services offered. Here are some ideas to stimulate your creativity: - Build a Clone Craigslist Website with No-Code - Create a Job Directory website without writing a single line of code - Build a voting app on-chain with no-code --- url: https://www.ankr.com/docs/basic-tutorials/file-storage-on-ipfs-with-filebase/ title: Filebase to store files to IPFS description: By Manny If you’re just getting started with web3 or just haven’t touched decentralized storage before, then Filebase is a good way to bridge the gap betwee. source: docs/basic-tutorials/file-storage-on-ipfs-with-filebase.mdx --- # Filebase to store files to IPFS **By** [**Manny**](https://twitter.com/codingwithmanny) ________________ ## IPFS & Filebase If you’re just getting started with web3 or just haven’t touched decentralized storage before, then Filebase is a good way to bridge the gap between traditional storage and Interplanetary File System (IPFS). ipfs If you read that last line and asked yourself “What the heck is IPFS”, then let’s break it down in simple terms, it’s a decentralized storage system that lives forever. In other words, make sure you know what you’re uploading before hand. ipfs ## Why Would You Want Forever Storage? One of the main reasons for storing a file forever is to either give value to its permanence or keep a full record of data that is immutable (can never be modified), which adds to its validity of authenticity. One of main uses for this currently are Non-Fungible Tokens (NFTs). If you get past the highly priced JPGs then there is value in authentic data. In the offline world, authentic data comes in the form government issued identification, supply chain logs, wills, deeds, contracts, and basically anything that could potentially be forged. Web3 is still young, and IPFS is still being adopted by major browsers, but decentralized storage definitely has a use, alongside traditional web2 storage. ## Getting Started With Filebase Web3 is growing and until it has a mass adoption there will still be a need for web2 solutions that bridge the gap. Filebase is the bridge to web3 decentralized storage on IPFS. The good news is that Filebase is currently 5GB of storage without any credit card, so take advantage and upload that entire collection of Gilmore Girls* to IPFS. Just create an account at [Filebase.com](https://console.filebase.com/signup). *(Don’t listen to me. This is probably a bad idea) ipfs ## Uploading Your First File The first step will be to create a bucket, by going to the Buckets section and click **Create Bucket**. If you’re familiar with AWS S3, then buckets are another way of saying folders. Why they chose the names buckets, I have no idea, but my guess is that instead of trying to organize things into folders, they just dumped everything into a bucket and ignore trying to organize anything. ipfs Give your Bucket a name, to try and organize things, and select the **IPFS (All data is public)** as the **Storage Network**. ipfs Click on your newly created bucket to open it up and take a look at its emptiness that screams “I need some files!” ipfs In your new bucket, click upload and File, to be prompted with file to upload, and select an image to start with to make things easier. ipfs Tada! You have uploaded a file to IPFS. Click on the new file to see its details. ipfs In the details, Right-Click the link in a new tab and wait for it to load. ipfs ipfs You should also be able to access the file from this public gateways URL ``` https://ipfs.filebase.io/ipfs/bafybeiblmwzu3evblahlvasdbs2a7p4qk6n6yaihcznvyqpp7mabfadkd4 ``` ## Deleting Your Files Wait, how can you delete a file that lives forever and is immutable? ipfs The answer is you can’t, the file lives forever. What you’re really deleting is just the reference to it in Filebase. A good way to test this theory is to use other IPFS Gateways to access the file. Depending on the Gateway, the request to load the file may differ. We can access the file natively through the Opera Web Browser at: ``` ipfs://bafybeiblmwzu3evblahlvasdbs2a7p4qk6n6yaihcznvyqpp7mabfadkd4 ``` ipfs We can use Cloudfare’s IPFS Gateway to also access the file through a browser that doesn’t natively support IPFS. ``` https://cloudflare-ipfs.com/ipfs/QmRG4BgEVcD3MuNaL3SxmZJcCEEYkRomw6PFEaha1Gagi2 ``` ipfs We can also still access our file through Filebase’s IPFS Gateway, even after we’ve deleted it in Filebase. ipfs ### What’s Next Now that we can see that we can upload files directly to IPFS with Filebase, we can start to think about what we can do to built on top of this. With IPFS in mind, you can explore the following: - Build a Frontend file uploader with React & Filebase - Store your NFT Images Permanently On-Chain with IPFS --- url: https://www.ankr.com/docs/advanced-tutorials/donation-based-crowdfunding-dapp-on-polygon-with-ankr/ title: An End-to-End Tutorial to Create and Deploy a Fully Decentralized Crowdfunding dApp on Polygon using Rainbowkit, Wagmi and Ankr description: By Krinza Momin In this tutorial, we’ll be building a donation-based crowdfunding dApp on Polygon where users can start a fundraising project for anyone to. source: docs/advanced-tutorials/donation-based-crowdfunding-dapp-on-polygon-with-ankr.mdx --- # An End-to-End Tutorial to Create and Deploy a Fully Decentralized Crowdfunding dApp on Polygon using Rainbowkit, Wagmi and Ankr **By** [**Krinza Momin**](https://twitter.com/kayprasla) ____________________________________ In this tutorial, we’ll be building a donation-based crowdfunding dApp on Polygon where users can start a fundraising project for anyone to contribute and support the campaign by pledging the amount of their wish. By the end of this tutorial, you'll be able to: - deploy crowdfunding smart contract on polygon - and create a full-fledged frontend for your dApp Hello ## The Functionalities 1. **Start New Campaign** — users will be able to start a new crowdfunding project by inputting some details about the campaign like title, story and goal amount to be raised. 2. **View Projects** — users can see all the existing projects and campaign details on the homepage 3. **Make Donation** — anyone can fund to the project they want to support in POL tokens ## The Tech Stack - Smart Contract Language: Solidity - Smart Contract Deploy and Verify Scripts: Javascript - Smart Contract Development Environment: [Hardhat](https://hardhat.org/)↗ - Frontend Language: React - TypeScript - Wallet Connect: [Rainbowkit](https://www.rainbowkit.com/)↗ - Interacting with Contract through Frontend: [Wagmi](https://wagmi.sh/)↗ - User Interface: [TailwindCSS](https://tailwindcss.com/)↗ - RPC provider: [Ankr](https://www.ankr.com/protocol/)↗ __________________________________________ # Getting Started **Prerequisite:** To successfully finish this guide, you'll need Node.js and Yarn installed on your machine. We will begin the project by forking this [Crowdfunding-dApp🌈 Starter Repository](https://github.com/kaymomin/Starterkit-Crowdfunding-dApp)↗ that I have prepared which includes basic configurations, wallet connect with rainbowkit and complete structure of empty files and folders to get us started with our dApp. To clone the repo, click the **fork** button at the top-right of the linked GitHub page. > Note in the code block below, make sure you paste the repo URL of your own cloned repository. Once the repository has been forked, clone it locally to get building on top of it by following the steps below: - Navigate into a directory of your choice and run the following command in your terminal to set up a local clone of the starterkit ```bash git clone https://github.com/kaymomin/Starterkit-Crowdfunding-dApp.git ``` - Now, let's navigate into the cloned directory and set up the development environment ```bash cd starterkit-crowdfunding-dapp ``` ``` bash yarn ``` - To launch the starter kit, run the following command in the VSCode terminal ``` bash yarn dev ``` and you will be able to see the starter-kit webpage. Here's what the site will look like at this point: Hello ## Step 1: Setup Hardhat Configs Navigate back to the project and find the `hardhat.config.js` file in root directory and the following code: **File:** `hardhat.config.js` ```javascript /** * @type import('hardhat/config').HardhatUserConfig */ require("dotenv").config(); require("@nomiclabs/hardhat-ethers"); require("@nomiclabs/hardhat-etherscan"); module.exports = { solidity: "0.8.15", defaultNetwork: "mumbai", networks: { hardhat: {}, mumbai: { //ankr's free public rpc url: "https://rpc.ankr.com/polygon_mumbai", accounts: [`0x${process.env.PRIVATE_KEY}`], }, }, etherscan: { apiKey: { polygon: process.env.POLYGONSCAN_API_KEY || "", polygonMumbai: process.env.POLYGONSCAN_API_KEY || "", }, }, }; ``` In this file, we have configured the solidity version, network details and plugged [Ankr's free public RPC](https://www.ankr.com/protocol/public/polygon/)↗ for Polygon Mumbai Testnet. Did you notice how we are sourcing the PRIVATE_KEY and POLYGONSCAN_API_KEY variable in this file? We are loading them up from `process.env` using the dotenv library. So before we move ahead to next steps, let's add these variables in our `.env` file. - Head over to the `.env` file and create these two environment variables: **File:** `.env` ```bash PRIVATE_KEY=ADD_YOUR_WALLET_PRIVATE_KEY POLYGONSCAN_API_KEY=ADD_YOUR_POLYGONSCAN_API_KEY ``` Here, you need to set your wallet's [private key](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key)↗ and API key from [Polygonscan](https://polygonscan.com/)↗. You can follow their [tutorial](https://docs.polygonscan.com/getting-started/viewing-api-usage-statistics)↗ if you aren't familiar with how to get one. ___________________________ ## Step 2: Write Crowdfunding Smart Contract Now that we have everything setup, we are all ready to write the smart contract for the donation based crowdfund platform. For that, navigate to `contracts` directory and you'll find `crowdfunding.sol` file. Add the following code in that file: **File:** `contracts/crowdfunding.sol` ```javascript // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.15; //contract to record all crowdfunding projects contract CrowdFactory { address[] public publishedProjs; event Projectcreated( string projTitle, uint256 goalAmount, address indexed ownerWallet, address projAddress, uint256 indexed timestamp ); function totalPublishedProjs() public view returns (uint256) { return publishedProjs.length; } function createProject( string memory projectTitle, uint256 projgoalAmount, string memory projDescript, address ownerWallet ) public { //initializing CrowdfundingProject contract CrowdfundingProject newproj = new CrowdfundingProject( //passing arguments from constructor function projectTitle, projgoalAmount, projDescript, ownerWallet ); //pushing project address publishedProjs.push(address(newproj)); //calling Projectcreated (event above) emit Projectcreated( projectTitle, projgoalAmount, msg.sender, address(newproj), block.timestamp ); } } contract CrowdfundingProject { //defining state variables string public projTitle; string public projDescription; uint256 public goalAmount; uint256 public raisedAmount; address ownerWallet; //address where amount to be transferred event Funded( address indexed donar, uint256 indexed amount, uint256 indexed timestamp ); constructor( string memory projectTitle, uint256 projgoalAmount, string memory projDescript, address ownerWallet_ ) { //mapping values projTitle = projectTitle; goalAmount = projgoalAmount; projDescription = projDescript; ownerWallet = ownerWallet_; } //donation function function makeDonation() public payable { //if goal amount is achieved, close the proj require(goalAmount > raisedAmount, "GOAL ACHIEVED"); //record walletaddress of donor (bool success, ) = payable(ownerWallet).call{value: msg.value}(""); require(success, "VALUE NOT TRANSFERRED"); //calculate total amount raised raisedAmount += msg.value; emit Funded(msg.sender, msg.value, block.timestamp); } } ``` You'll see we have initiated two contracts: 1. **CrowdfundingProject** - deals with a single project or campaign being create. It includes the `makeDonation()` function which calculates the amount raised and checks if the `goalAmount` is achieved or not while recording the wallet address of the donor. 2. **CrowdFactory** - records for all the crowdfunding projects being created and launched. Now, let's compile hardhat to see if everything's good to go! ```bash yarn hardhat compile # output # Compiled n Solidity file successfully ``` __________________________________ ## Step 3: Write the Deploy Script(s) Now that we've got our contract set up, let's create the deployment scripts. There will be two scripts, one for deploying the **CrowdFactory** contract and second for a dummy campaign creation with some dummy project info. - For the first script, navigate to the `scripts` folder and add the following code in `deploy.js` file **File:** `scripts/deploy.js` ```javascript const { ethers } = require("hardhat"); async function main() { // Grab the contract factory const CrowdFactory = await ethers.getContractFactory("CrowdFactory"); // Start deployment, returning a promise that resolves to a contract object const crowd = await CrowdFactory.deploy(); // Instance of the contract await crowd.deployed(); console.log("Contract deployed to address:", crowd.address); } main() .then(() => process.exit(0)) .catch((error) => { console.error(error); process.exit(1); }); ``` - Save this file and run the following command to deploy the **CrowdFactory** contract ```bash yarn hardhat run scripts/deploy.js --network mumbai ``` Running this command will prompt you with the address of the deployed contract. Here's the contract I [deployed](https://mumbai.polygonscan.com/address/0xA6A30bCc591107d932CA12a50FC616BAb5E58cdA).↗ ***Note your contract address as you will need it in your next deployment script.*** ____________________ Before we go on deploying another contract, let's save this contract address in a file named **constants.tx** under **src** directory. **File:** `src/constants.tx` ```javascript //add your contract's address here export const FACTORY_CONTRACT_ADDRESS = "0xA6A30bCc591107d932CA12a50FC616BAb5E58cdA"; //just for testing purpose export const DEBUG = false; ``` _______________ Now let's deploy another contract with a sudo campaign details for us to get started. For this, we are going to use **createCampaigns.js** file under `scripts` directory. Navigate to that file and save the following code. > Note: In this file you need to edit two things. First the contract address we got in the above step. Replace your contract address with the address mentioned already in the script (check line 6). Second, on line 13, replace my wallet address with yours. **File:** `scripts/createCampaigns.js` ``` const { ethers } = require("hardhat"); async function main() { const contract = await ethers.getContractAt("CrowdFactory", //add the contract address that you just deployed in the last step "0xA6A30bCc591107d932CA12a50FC616BAb5E58cdA") //line 6 await contract.createProject( "first title", ethers.utils.parseUnits("0.1", 18), "description", //insert your wallet's public key "0x81AE60AC85F0b81Cc00e2B294d83A03f40d1deF5") //line 13 } main() .then(() => process.exit(0)) .catch((error) => { console.error(error); process.exit(1); }); ``` Once done, run the following command to deploy this script as well: ``` yarn hardhat run scripts/createCampaigns.js --network mumbai ``` ## Step 4: Get Contract ABI for Verified Codes In this step, we are going to do two things: 1. we will verify our smart contracts on [Polygonscan](https://mumbai.polygonscan.com/)↗ 2. get contract ABIs for verified contract source codes **Verifying Smart Contracts** - Go to `verify-factory.js` file under scripts folder and add the following verify script: > Note: In this file you need to edit one thing. The **contractAddress** you see on line number 5 needs to be replaced by your contract's address. **File:** `scripts/verify-factory.js` ```javascript const { run } = require("hardhat"); async function main() { //add the contract address that you deployed in the prev steps const contractAddress = "0xA6A30bCc591107d932CA12a50FC616BAb5E58cdA"; //line 5 try { await run("verify:verify", { address: contractAddress, constructorArguments: [], contract: "contracts/crowdfunding.sol:CrowdFactory", }); } catch (error) { if (error.message.toLowerCase().includes("already verified")) { console.log("Already verified!"); } else { console.log(error); } } } main() .then(() => process.exit(0)) .catch((error) => { console.error(error); process.exit(1); }); ``` - Now in the terminal, run this command to verify the **CrowdFactory** smart contract on polygonscan: ``` yarn hardhat run scripts/verify-factory.js --network mumbai ``` **Output of this command:** `Successfully verified contract CrowdFactory on Etherscan.` `https://mumbai.polygonscan.com/address/0xA6A30bCc591107d932CA12a50FC616BAb5E58cdA#code` - Head over to the Mumbai Polygonscan link you get as the output after running the command and it will land you to the verified contract's page - Scroll down and you'll find **Contract ABI** section Hello - Copy the ABI and paste it in the `crowdfactory.json` file under `src/abis` directory - Go back to the same polygonscan link, click on the **Read Contract **button and query "0" from the **publishedProjs**. > Copy and save the address it outputs, we will need it in *line 5* of the next file. Now, we are going to follow the similar steps to first verify our dummy crowdfunding project and get the contract's ABI. - Navigate to `verify-crowdfundingproject.js` file under **scripts** folder and insert the following code in the file: > Replace contractAddress in the file with the one we saved above querying the 0th publishedProj and also insert your wallet address on line 9 **File:** `scripts/verify-crowdfundingproject.js` ```javascript const { run, ethers } = require("hardhat"); async function main() { //replace contractAddress with the one we saved above querying the 0th publishedProj const contractAddress = "0xcf092E8bDCDC1FA8B15Ebeb9D97453D498067Df1"; //line5 const args = [ "first title", ethers.utils.parseUnits("0.1", 18), "description", //Insert you wallet's public address here "YOUR_WALLET_PUBLIC_ADDRESS", //line 9 ]; try { await run("verify:verify", { address: contractAddress, constructorArguments: args, contract: "contracts/crowdfunding.sol:CrowdfundingProject", }); } catch (error) { if (error.message.toLowerCase().includes("already verified")) { console.log("Already verified!"); } else { console.log(error); } } } main() .then(() => process.exit(0)) .catch((error) => { console.error(error); process.exit(1); }); ``` - Once you save the above file, run this command to verify it on polygonscan: ``` yarn hardhat run scripts/verify-crowdfundingproject.js --network mumbai ``` **Output of this command:** `Successfully verified contract CrowdfundingProject on Etherscan.` `https://mumbai.polygonscan.com/address/0xcf092E8bDCDC1FA8B15Ebeb9D97453D498067Df1#code` - Head over to the Mumbai Polygonscan link you get as the output after running the command and it will land you to the verified contract's page - Scroll down, find **Contract ABI** section and copy-paste ABI in the `crowdfundingproject.json` file under `src/abis` directory Once this is done, run the following command in the terminal: ``` yarn typechain ``` TypeChain is a typescript binding and code generator used to create smart contracts that features static typing and IDE support. _____________________________________ ## Step 5: Write Hooks, Utils and Read As the heading suggests, this section will be no less than a lot of code. We will begin by updating the `hooks.ts` under `src` directory. In this file, we will be creating generic hooks to access the write and read functions of both "crowdfactory" and "CrowdfundingProject" contracts. **File:** `src/hooks.ts` ```javascript import { useContract, useContractRead, useContractWrite } from "wagmi"; import CROWDFACTORY_ABI from "./abis/crowdfactory.json"; import CROWNFUNDINGPROJECT_ABI from "./abis/crowdfundingproject.json"; import { FACTORY_CONTRACT_ADDRESS } from "./constants"; import type { Crowdfactory } from "./contract-types/Crowdfactory"; import type { Crowdfundingproject } from "./contract-types/Crowdfundingproject"; /*////////////////////////////////////////////////////////////// CROWD FACTORY //////////////////////////////////////////////////////////////*/ export function useCrowdFactoryContract(): Crowdfactory { const contract = useContract({ addressOrName: FACTORY_CONTRACT_ADDRESS, contractInterface: CROWDFACTORY_ABI, }); return contract as Crowdfactory; } // create a generic hook to access write functions of contract export function useCrowdFactoryFunctionWriter( functionName: string ): ReturnType { const contractWrite = useContractWrite({ addressOrName: FACTORY_CONTRACT_ADDRESS, contractInterface: CROWDFACTORY_ABI, functionName: functionName, }); return contractWrite; } export interface UseCrowdFactoryFunctionReaderProps { functionName: string; args?: any[]; } // create a generic hook to access read functions of contract export function useCrowdFactoryFunctionReader({ functionName, args, }: UseCrowdFactoryFunctionReaderProps): ReturnType { const contractRead = useContractRead({ addressOrName: FACTORY_CONTRACT_ADDRESS, contractInterface: CROWDFACTORY_ABI, functionName: functionName, args: args, watch: true, }); return contractRead; } /*////////////////////////////////////////////////////////////// CROWD FUNDING PROJECT //////////////////////////////////////////////////////////////*/ export function useCrowdfundingProjectContract( contractAddress: string ): Crowdfundingproject { const contract = useContract({ addressOrName: contractAddress, contractInterface: CROWNFUNDINGPROJECT_ABI, }); return contract as Crowdfundingproject; } export interface UseCrowdfundingProjectFunctionWriterProps { contractAddress: string; functionName: string; } export function useCrowdfundingProjectFunctionWriter({ contractAddress, functionName, }: UseCrowdfundingProjectFunctionWriterProps): ReturnType< typeof useContractWrite > { const contractWrite = useContractWrite({ addressOrName: contractAddress, contractInterface: CROWNFUNDINGPROJECT_ABI, functionName: functionName, }); return contractWrite; } export interface UseCrowdfundingProjectFunctionReaderProps { contractAddress: string; functionName: string; args?: any[]; } // create a generic hook to access read functions of contract export function useCrowdfundingProjectFunctionReader({ contractAddress, functionName, args, }: UseCrowdfundingProjectFunctionReaderProps): ReturnType< typeof useContractRead > { const contractRead = useContractRead({ addressOrName: contractAddress, contractInterface: CROWNFUNDINGPROJECT_ABI, functionName: functionName, args: args, watch: true, }); return contractRead; } ``` Now, let's move to the other file named "**utils.ts**". In this file we are creating helper functions to convert wei into POL. **File:** `src/utils.ts` ```javascript //helper functions to convert wei into pol import type { BigNumberish } from "ethers"; import { BigNumber, utils } from "ethers"; /** * Return the `value` converted to BigNumber. * * @param value string value preferred. * @return BigNumber value */ export function toBN(value: BigNumberish): BigNumber { return BigNumber.from(value); } /** * Return the `gasPrice` converted to gwei. * formatUnits(value: BigNumberish, unitName?: BigNumberish | undefined): string * BigNumberish -> string, BigNumber, number, BytesLike or BigInt.`https://docs.ethers.io/v5/api/utils/bignumber/#BigNumberish` * * @param gasPrice BigNumberish value to be converted, preferred is BigNumber. * @return string value */ export function toGwei(gasPrice: BigNumberish): string { return utils.formatUnits(gasPrice, "gwei"); } /** * Return the `value` converted to BigNumber wei. * parseUnits(value: string, unitName?: BigNumberish | undefined): BigNumber * BigNumberish -> string, BytesLike, BigNumber, number or BigInt.`https://docs.ethers.io/v5/api/utils/bignumber/#BigNumberish` * * @param value the string value to be converted. * @param decimals decimal value or BigNumberish. * @return BigNumber value or undefined. */ export function toWei(value: string, decimals: number = 18): BigNumber { return utils.parseUnits(value, decimals); } /** * Return the `value` converted to string from wei. * formatUnits(value: BigNumberish, unitName?: BigNumberish | undefined): string * BigNumberish -> string, BigNumber, number, BytesLike or BigInt.`https://docs.ethers.io/v5/api/utils/bignumber/#BigNumberish` * * @param value BigNumberish value to be converted, preferred is BigNumber. * @param decimals decimal value or BigNumberish. * @return string value. */ export function fromWei(value: BigNumberish, decimals: number = 18): string { return utils.formatUnits(value, decimals); } /** * Returns true if the string value is zero in hex * @param hexNumberString */ export default function isZero(hexNumberString: string) { return /^0x0*$/.test(hexNumberString); } ``` And last but not at all the least, "**read.ts**" under the **src** directory which will contain [view and pure functions](https://www.geeksforgeeks.org/solidity-view-and-pure-functions/).↗ **File:** `src/read.ts` ```javascript //read function //view and pure functions (Smartcontract) import type { BigNumber } from "ethers"; import type { Result } from "ethers/lib/utils"; import { DEBUG } from "./constants"; import type { Crowdfactory } from "./contract-types/Crowdfactory"; import type { Crowdfundingproject } from "./contract-types/Crowdfundingproject"; import { useCrowdFactoryFunctionReader, useCrowdfundingProjectFunctionReader, } from "./hooks"; /*////////////////////////////////////////////////////////////// CROWD FACTORY //////////////////////////////////////////////////////////////*/ export function useTotalPublishedProjs(): number | undefined { const totalPublishedProjsReader = useCrowdFactoryFunctionReader({ functionName: "totalPublishedProjs", }); const totalPublishedProjs: | Awaited> | Result | undefined = totalPublishedProjsReader.data; DEBUG && console.log("totalPublishedProjs: ", totalPublishedProjs?.toString()); if (!totalPublishedProjs) return undefined; return parseInt(totalPublishedProjs.toString()) as number; } export function usePublishedProjs(index: number): string | undefined { const publishedProjsReader = useCrowdFactoryFunctionReader({ functionName: "publishedProjs", args: [index], }); const publishedProjs: | Awaited> | Result | undefined = publishedProjsReader.data; DEBUG && console.log("publishedProjs: ", publishedProjs); if (!publishedProjs) return undefined; return publishedProjs as unknown as string; } /*////////////////////////////////////////////////////////////// CROWD FUNDING PROJECT //////////////////////////////////////////////////////////////*/ export function useProjTitle(contractAddress: string): string | undefined { const projTitleReader = useCrowdfundingProjectFunctionReader({ contractAddress: contractAddress, functionName: "projTitle", }); const projTitle: | Awaited> | Result | undefined = projTitleReader.data; DEBUG && console.log("projTitle: ", projTitle); if (!projTitle) return undefined; return projTitle as unknown as string; } export function useProjDescription( contractAddress: string ): string | undefined { const projDescriptionReader = useCrowdfundingProjectFunctionReader({ contractAddress: contractAddress, functionName: "projDescription", }); const projDescription: | Awaited> | Result | undefined = projDescriptionReader.data; DEBUG && console.log("projDescription: ", projDescription); if (!projDescription) return undefined; return projDescription as unknown as string; } export function useGoalAmount(contractAddress: string): BigNumber | undefined { const goalAmountReader = useCrowdfundingProjectFunctionReader({ contractAddress: contractAddress, functionName: "goalAmount", }); const goalAmount: | Awaited> | Result | undefined = goalAmountReader.data; DEBUG && console.log("goalAmount: ", goalAmount); if (!goalAmount) return undefined; return goalAmount as unknown as BigNumber; } export function useRaisedAmount( contractAddress: string ): BigNumber | undefined { const raisedAmountReader = useCrowdfundingProjectFunctionReader({ contractAddress: contractAddress, functionName: "raisedAmount", }); const raisedAmount: | Awaited> | Result | undefined = raisedAmountReader.data; DEBUG && console.log("raisedAmount: ", raisedAmount); if (!raisedAmount) return undefined; return raisedAmount as unknown as BigNumber; } ``` __________________________ ## Step 6: Create Components In this step, we are going to head over to `components` folder under `src` directory. First up, navigate to "**CreateCampaign.tsx**" file and insert the following code. In this file, we will be using custom hook we made in hooks.ts for writing functions along with the coding the UI. **File:** `src/components/CreateCampaign.tsx` ```javascript import { DEBUG } from "../constants"; import type { Crowdfactory } from "../contract-types/Crowdfactory"; import { useCrowdFactoryFunctionWriter } from "../hooks"; import { toWei } from "../utils"; import { useAddRecentTransaction } from "@rainbow-me/rainbowkit"; import type { ChangeEvent, FormEvent } from "react"; import { useState } from "react"; import { useAccount } from "wagmi"; function CreateCampaign() { const [title, setTitle] = useState(""); const [amount, setAmount] = useState(""); const [story, setStory] = useState(""); const { address } = useAccount(); // custom hook we made in hooks.ts for writing functions const { writeAsync, isError } = useCrowdFactoryFunctionWriter("createProject"); // rainbow kit txn handler const addRecentTransaction = useAddRecentTransaction(); // onChange handler for title const handleTitle = (e: ChangeEvent) => { e.preventDefault(); const value = e.target.value; DEBUG && console.log("title: ", value); // set title setTitle(value); }; // onChange handler for amount const handleAmount = (e: ChangeEvent) => { e.preventDefault(); const value = e.target.value; DEBUG && console.log("amount: ", value); // set amount setAmount(value); }; // onChange handler for story const handleStory = (e: ChangeEvent) => { e.preventDefault(); const value = e.target.value; DEBUG && console.log("story: ", value); // set story setStory(value); }; const handleSubmit = async (e: FormEvent) => { if (!title || !amount || !story || !address) { return; } try { e.preventDefault(); console.log("submit!"); DEBUG && console.log({ title, amount, story }); const amountToWei = toWei(amount); DEBUG && console.log("amountToWei: ", amountToWei); const functionArgs: Parameters = [ title, amountToWei, story, address, ]; const tx = await writeAsync({ args: functionArgs, }); console.log("tx >>> ", tx); addRecentTransaction({ hash: tx.hash, description: "Create Project Transaction", }); } catch (error) { console.log("errror >>> ", error); } }; return ( <>
Create Crowdfunding Project